From e4a713207ddcecba285319104a19d1e4caffc993 Mon Sep 17 00:00:00 2001 From: Georgi Kirichkov Date: Wed, 2 Nov 2016 21:23:43 +0200 Subject: [PATCH] Fixes in TP-Link Switch logging 0 values on init (#4026) * Fixes in TP-Link Switch logging 0 values on init On init of component the emeter would log to influxdb and possibly other inputs a 0 value, instead of not logging anything. Initial polling should circumvent that behavior and avoid logging inconsistencies. * Refactors update call in __init__ --- homeassistant/components/switch/tplink.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/switch/tplink.py b/homeassistant/components/switch/tplink.py index 06c67dcf5ea..3554e0b933f 100644 --- a/homeassistant/components/switch/tplink.py +++ b/homeassistant/components/switch/tplink.py @@ -37,7 +37,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None): host = config.get(CONF_HOST) name = config.get(CONF_NAME) - add_devices([SmartPlugSwitch(SmartPlug(host), name)]) + add_devices([SmartPlugSwitch(SmartPlug(host), name)], True) class SmartPlugSwitch(SwitchDevice):