Update Orvibo platform to the switch component, add 'mac' option

This adds an optional 'mac' configuration option to the platform which

is passed to the underlying Orvibo library. The 'mac' option is required

when the switch is connected to a different subnet to the Home Assistant

host
This commit is contained in:
Will Hughes 2016-04-07 09:52:21 +12:00 committed by Paulus Schoutsen
parent 3bc37397d2
commit 5a32ddbe6f

View File

@ -26,9 +26,10 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
_LOGGER.error("Missing required variable: host")
continue
host = switch.get('host')
mac = switch.get('mac')
try:
switches.append(S20Switch(switch.get('name', DEFAULT_NAME),
S20(host)))
S20(host, mac=mac)))
_LOGGER.info("Initialized S20 at %s", host)
except S20Exception:
_LOGGER.exception("S20 at %s couldn't be initialized",