mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 17:27:10 +00:00
Simplify callback logging, add stop log
This commit is contained in:
parent
4feef3dd0d
commit
0d32bd7a19
@ -29,6 +29,7 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
|||||||
_WEMO_SUBSCRIPTION_REGISTRY.start()
|
_WEMO_SUBSCRIPTION_REGISTRY.start()
|
||||||
def stop_wemo(event):
|
def stop_wemo(event):
|
||||||
""" Shutdown Wemo subscriptions and subscription thread on exit"""
|
""" Shutdown Wemo subscriptions and subscription thread on exit"""
|
||||||
|
_LOGGER.info("Shutting down subscriptions.")
|
||||||
_WEMO_SUBSCRIPTION_REGISTRY.stop()
|
_WEMO_SUBSCRIPTION_REGISTRY.stop()
|
||||||
|
|
||||||
hass.bus.listen_once(hass.EVENT_HOMEASSISTANT_STOP, stop_wemo)
|
hass.bus.listen_once(hass.EVENT_HOMEASSISTANT_STOP, stop_wemo)
|
||||||
@ -66,8 +67,8 @@ class WemoSwitch(SwitchDevice):
|
|||||||
def _update_callback(self, _device, _params):
|
def _update_callback(self, _device, _params):
|
||||||
""" Called by the wemo device callback to update state. """
|
""" Called by the wemo device callback to update state. """
|
||||||
_LOGGER.info(
|
_LOGGER.info(
|
||||||
'Subscription update for %s, sevice=%s params=%s',
|
'Subscription update for %s, sevice=%s',
|
||||||
self.name, _device, _params)
|
self.name, _device)
|
||||||
self.update_ha_state(True)
|
self.update_ha_state(True)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
Loading…
x
Reference in New Issue
Block a user