Use voluptuous for Verisure (#3169)
* Migrate to voluptuous * Update type and add missing config variable
This commit is contained in:
1 parent
abff2f2b36
commit
7aafa309c9
5 files changed
+47
-26
No files matched your search
@@ -2,11 +2,12 @@
|
||||
Support for Verisure Smartplugs.
|
||||
|
||||
For more details about this platform, please refer to the documentation at
|
||||
documentation at https://home-assistant.io/components/verisure/
|
||||
https://home-assistant.io/components/switch.verisure/
|
||||
"""
|
||||
import logging
|
||||
|
||||
from homeassistant.components.verisure import HUB as hub
|
||||
from homeassistant.components.verisure import CONF_SMARTPLUGS
|
||||
from homeassistant.components.switch import SwitchDevice
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
@@ -14,7 +15,7 @@ _LOGGER = logging.getLogger(__name__)
|
||||
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
"""Setup the Verisure switch platform."""
|
||||
if not int(hub.config.get('smartplugs', '1')):
|
||||
if not int(hub.config.get(CONF_SMARTPLUGS, 1)):
|
||||
return False
|
||||
|
||||
hub.update_smartplugs()
|
||||
|
||||
Reference in new issue
Block a user