Update voluputous (#12463)

* Update voluputous

* Fix http config

* Fix optional with default=None

* Optional, default=none

* Fix defaults in voluptuous schemas

* Fix tests

* Fix update error

* Lint
This commit is contained in:
Paulus Schoutsen 2018-02-17 01:29:14 -08:00 committed by Pascal Vizeli
parent e4ef6b91d6
commit 3fd61d8f45
88 changed files with 207 additions and 255 deletions

View file

@ -26,7 +26,7 @@ CONF_PORTS = 'ports'
DEFAULT_INVERT_LOGIC = False
PORT_SCHEMA = vol.Schema({
vol.Optional(ATTR_NAME, default=None): cv.string,
vol.Optional(ATTR_NAME): cv.string,
vol.Optional(ATTR_INVERT_LOGIC, default=DEFAULT_INVERT_LOGIC): cv.boolean,
})
@ -42,7 +42,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
switches = []
ports = config.get(CONF_PORTS)
for port, port_entity in ports.items():
name = port_entity[ATTR_NAME]
name = port_entity.get(ATTR_NAME)
invert_logic = port_entity[ATTR_INVERT_LOGIC]
switches.append(RPiPFIOSwitch(port, name, invert_logic))