Make dispatch signals unique per server (#28029)

This commit is contained in:
jjlawren 2019-10-21 03:44:07 -05:00 committed by Martin Hjelmare
parent 6844d203a1
commit d1fcc5762b
4 changed files with 18 additions and 6 deletions

View file

@ -49,7 +49,9 @@ class PlexSensor(Entity):
"""Run when about to be added to hass."""
server_id = self._server.machine_identifier
unsub = async_dispatcher_connect(
self.hass, PLEX_UPDATE_SENSOR_SIGNAL, self.async_refresh_sensor
self.hass,
PLEX_UPDATE_SENSOR_SIGNAL.format(server_id),
self.async_refresh_sensor,
)
self.hass.data[PLEX_DOMAIN][DISPATCHERS][server_id].append(unsub)