Clean up superfluous Netatmo API calls (#81095)
This commit is contained in:
parent
b490f47334
commit
fa350b984a
4 changed files with 11 additions and 6 deletions
|
@ -252,7 +252,7 @@ class NetatmoDataHandler:
|
|||
self, signal_name: str, update_callback: CALLBACK_TYPE | None
|
||||
) -> None:
|
||||
"""Unsubscribe from publisher."""
|
||||
if update_callback in self.publisher[signal_name].subscriptions:
|
||||
if update_callback not in self.publisher[signal_name].subscriptions:
|
||||
return
|
||||
|
||||
self.publisher[signal_name].subscriptions.remove(update_callback)
|
||||
|
@ -288,6 +288,9 @@ class NetatmoDataHandler:
|
|||
person.entity_id: person.pseudo for person in home.persons.values()
|
||||
}
|
||||
|
||||
await self.unsubscribe(WEATHER, None)
|
||||
await self.unsubscribe(AIR_CARE, None)
|
||||
|
||||
def setup_air_care(self) -> None:
|
||||
"""Set up home coach/air care modules."""
|
||||
for module in self.account.modules.values():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue