rework fpl api

This commit is contained in:
Yordan Suarez
2022-08-02 11:10:57 -04:00
parent a1dbe51f10
commit a9d343f1f5
16 changed files with 1129 additions and 489 deletions

View File

@@ -43,6 +43,9 @@ async def async_setup_entry(hass, entry, async_add_devices):
"""Setup sensor platform."""
accounts = entry.data.get("accounts")
territory = entry.data.get("territory")
print(f"setting sensor for {territory}")
coordinator = hass.data[DOMAIN][entry.entry_id]
fpl_accounts = []
@@ -50,6 +53,8 @@ async def async_setup_entry(hass, entry, async_add_devices):
if DEBUG:
for account in accounts:
fpl_accounts.append(TestSensor(coordinator, entry, account))
fpl_accounts.append(FplProjectedBillSensor(coordinator, entry, account))
else:
for account in accounts:
# Test Sensor