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
parent
cc0d0a38d7
commit
e4a713207d
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue