Skip to content

Commit 344e5d4

Browse files
authored
Take another stab at detecting inactive subscriptions (#386)
1 parent b9c222e commit 344e5d4

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

simplipy/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ async def async_get_systems(self) -> dict[int, SystemV2 | SystemV3]:
348348
await self.async_update_subscription_data()
349349

350350
for sid, subscription in self.subscription_data.items():
351-
if subscription["activated"] == 0 or not subscription["status"]["isActive"]:
351+
if not subscription["status"]["hasBaseStation"]:
352352
LOGGER.info("Skipping inactive subscription: %s", sid)
353353
continue
354354

tests/system/test_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ async def test_deactivated_system(
3434
authenticated_simplisafe_server: A authenticated API connection.
3535
subscriptions_response: An API response payload.
3636
"""
37-
subscriptions_response["subscriptions"][0]["activated"] = 0
37+
subscriptions_response["subscriptions"][0]["status"]["hasBaseStation"] = 0
3838

3939
async with authenticated_simplisafe_server:
4040
authenticated_simplisafe_server.add(

0 commit comments

Comments
 (0)