mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Fix style issues
This commit is contained in:
parent
1e2b5e6991
commit
09b894a4aa
@ -16,6 +16,7 @@ _LOGGER = logging.getLogger(__name__)
|
|||||||
|
|
||||||
_WEMO_SUBSCRIPTION_REGISTRY = None
|
_WEMO_SUBSCRIPTION_REGISTRY = None
|
||||||
|
|
||||||
|
|
||||||
# pylint: disable=unused-argument, too-many-function-args
|
# pylint: disable=unused-argument, too-many-function-args
|
||||||
def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
||||||
""" Find and return WeMo switches. """
|
""" Find and return WeMo switches. """
|
||||||
@ -53,19 +54,23 @@ class WemoSwitch(SwitchDevice):
|
|||||||
self.insight_params = None
|
self.insight_params = None
|
||||||
self.maker_params = None
|
self.maker_params = None
|
||||||
|
|
||||||
global _WEMO_SUBSCRIPTION_REGISTRY
|
|
||||||
_WEMO_SUBSCRIPTION_REGISTRY.register(wemo)
|
_WEMO_SUBSCRIPTION_REGISTRY.register(wemo)
|
||||||
_WEMO_SUBSCRIPTION_REGISTRY.on(wemo, 'BinaryState', self._update_callback)
|
_WEMO_SUBSCRIPTION_REGISTRY.on(
|
||||||
_WEMO_SUBSCRIPTION_REGISTRY.on(wemo, 'attributeList', self._update_callback)
|
wemo, 'BinaryState', self._update_callback)
|
||||||
|
_WEMO_SUBSCRIPTION_REGISTRY.on(
|
||||||
|
wemo, 'attributeList', self._update_callback)
|
||||||
|
|
||||||
def _update_callback(self, _device, _params):
|
def _update_callback(self, _device, _params):
|
||||||
_LOGGER.info('Subscription update for %s, sevice=%s params=%s', self.name, _device, _params)
|
""" Called by the wemo device callback to update state. """
|
||||||
# import pdb; pdb.set_trace()
|
_LOGGER.info(
|
||||||
|
'Subscription update for %s, sevice=%s params=%s',
|
||||||
|
self.name, _device, _params)
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def should_poll(self):
|
def should_poll(self):
|
||||||
""" No polling should be needed with subscriptions, but leave in for initial version in case of issues. """
|
""" No polling should be needed with subscriptions """
|
||||||
|
# but leave in for initial version in case of issues.
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
Loading…
x
Reference in New Issue
Block a user