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__
pull/4183/head
Georgi Kirichkov 2016-11-02 21:23:43 +02:00 committed by Paulus Schoutsen
parent cc0d0a38d7
commit e4a713207d
1 changed files with 1 additions and 1 deletions

View File

@ -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):