Use voluptuous for Verisure (#3169)

* Migrate to voluptuous

* Update type and add missing config variable
This commit is contained in:
Fabian Affolter authored and Paulus Schoutsen committed 2016-09-06 18:18:34 -07:00
1 parent abff2f2b36
commit 7aafa309c9
5 files changed
+47 -26

No files matched your search

+3 -2
View File
@@ -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()