Fix issues with Ambient PWS dispatcher topic (#31439)
* Correct over-broad Ambient PWS data updates * Make sure we provide a callable * Don't use a partialpull/31376/head
parent
30e803d70b
commit
bea7aae8cd
|
@ -378,7 +378,7 @@ class AmbientStation:
|
||||||
if data != self.stations[mac_address][ATTR_LAST_DATA]:
|
if data != self.stations[mac_address][ATTR_LAST_DATA]:
|
||||||
_LOGGER.debug("New data received: %s", data)
|
_LOGGER.debug("New data received: %s", data)
|
||||||
self.stations[mac_address][ATTR_LAST_DATA] = data
|
self.stations[mac_address][ATTR_LAST_DATA] = data
|
||||||
async_dispatcher_send(self._hass, TOPIC_UPDATE)
|
async_dispatcher_send(self._hass, TOPIC_UPDATE.format(mac_address))
|
||||||
|
|
||||||
_LOGGER.debug("Resetting watchdog")
|
_LOGGER.debug("Resetting watchdog")
|
||||||
self._watchdog_listener()
|
self._watchdog_listener()
|
||||||
|
@ -518,7 +518,7 @@ class AmbientWeatherEntity(Entity):
|
||||||
self.async_schedule_update_ha_state(True)
|
self.async_schedule_update_ha_state(True)
|
||||||
|
|
||||||
self._async_unsub_dispatcher_connect = async_dispatcher_connect(
|
self._async_unsub_dispatcher_connect = async_dispatcher_connect(
|
||||||
self.hass, TOPIC_UPDATE, update
|
self.hass, TOPIC_UPDATE.format(self._mac_address), update
|
||||||
)
|
)
|
||||||
|
|
||||||
async def async_will_remove_from_hass(self):
|
async def async_will_remove_from_hass(self):
|
||||||
|
|
|
@ -8,7 +8,7 @@ CONF_APP_KEY = "app_key"
|
||||||
|
|
||||||
DATA_CLIENT = "data_client"
|
DATA_CLIENT = "data_client"
|
||||||
|
|
||||||
TOPIC_UPDATE = "update"
|
TOPIC_UPDATE = "ambient_station_data_update_{0}"
|
||||||
|
|
||||||
TYPE_BINARY_SENSOR = "binary_sensor"
|
TYPE_BINARY_SENSOR = "binary_sensor"
|
||||||
TYPE_SENSOR = "sensor"
|
TYPE_SENSOR = "sensor"
|
||||||
|
|
Loading…
Reference in New Issue