mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Use the logger the same way as other platforms
This commit is contained in:
parent
3ea167203f
commit
4f3b3a9e34
@ -1,8 +1,10 @@
|
|||||||
"""
|
"""
|
||||||
homeassistant.components.switch.wemo
|
homeassistant.components.switch.wemo
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Support for WeMo switches.
|
Support for WeMo switches.
|
||||||
|
|
||||||
|
For more details about this component, please refer to the documentation at
|
||||||
|
https://home-assistant.io/components/switch.wemo.html
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
@ -10,6 +12,7 @@ from homeassistant.components.switch import SwitchDevice
|
|||||||
from homeassistant.const import STATE_ON, STATE_OFF, STATE_STANDBY
|
from homeassistant.const import STATE_ON, STATE_OFF, STATE_STANDBY
|
||||||
|
|
||||||
REQUIREMENTS = ['pywemo==0.3.1']
|
REQUIREMENTS = ['pywemo==0.3.1']
|
||||||
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
# pylint: disable=unused-argument
|
# pylint: disable=unused-argument
|
||||||
@ -26,7 +29,7 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
logging.getLogger(__name__).info("Scanning for WeMo devices")
|
_LOGGER.info("Scanning for WeMo devices.")
|
||||||
switches = pywemo.discover_devices()
|
switches = pywemo.discover_devices()
|
||||||
|
|
||||||
# Filter out the switches and wrap in WemoSwitch object
|
# Filter out the switches and wrap in WemoSwitch object
|
||||||
@ -132,5 +135,4 @@ class WemoSwitch(SwitchDevice):
|
|||||||
elif self.wemo.model_name == 'Maker':
|
elif self.wemo.model_name == 'Maker':
|
||||||
self.maker_params = self.wemo.maker_params
|
self.maker_params = self.wemo.maker_params
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
logging.getLogger(__name__).warning(
|
_LOGGER.warning('Could not update status for %s', self.name)
|
||||||
'Could not update status for %s', self.name)
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user