Don't bother with a partial

This commit is contained in:
Aaron Bach
2020-02-03 11:47:18 -07:00
parent 5bfa94495b
commit 50e7c72505

View File

@@ -1,6 +1,5 @@
"""Support for SimpliSafe alarm systems."""
import asyncio
from functools import partial
import logging
from simplipy import API
@@ -57,7 +56,7 @@ _LOGGER = logging.getLogger(__name__)
CONF_ACCOUNTS = "accounts"
DATA_LISTENER = "listener"
TOPIC_UPDATE = partial("{domain}_update_{system_id}".format, domain=DOMAIN)
TOPIC_UPDATE = "simplisafe_update_data_{0}"
DEFAULT_SOCKET_MIN_RETRY = 15
DEFAULT_WATCHDOG_SECONDS = 5 * 60
@@ -390,7 +389,7 @@ class SimpliSafe:
"""Update a system."""
await system.update()
_LOGGER.debug('Updated REST API data for "%s"', system.name)
async_dispatcher_send(self._hass, TOPIC_UPDATE(system_id=system.system_id))
async_dispatcher_send(self._hass, TOPIC_UPDATE.format(system.system_id))
tasks = [update_system(system) for system in self.systems.values()]
@@ -467,7 +466,7 @@ class SimpliSafe:
self.last_websocket_data[data["sid"]] = event
system = self.systems[data["sid"]]
_LOGGER.debug('Updated websocket data for "%s"', system.name)
async_dispatcher_send(self._hass, TOPIC_UPDATE(system_id=data["sid"]))
async_dispatcher_send(self._hass, TOPIC_UPDATE.format(data["sid"]))
_LOGGER.debug("Resetting websocket watchdog")
self._websocket_watchdog_listener()
@@ -551,7 +550,7 @@ class SimpliSafeEntity(Entity):
self.async_schedule_update_ha_state(True)
self._async_unsub_dispatcher_connect = async_dispatcher_connect(
self.hass, TOPIC_UPDATE(system_id=self._system.system_id), update
self.hass, TOPIC_UPDATE.format(self._system.system_id), update
)
async def async_update(self):