mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
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__
This commit is contained in:
parent
cc0d0a38d7
commit
e4a713207d
@ -37,7 +37,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||||||
host = config.get(CONF_HOST)
|
host = config.get(CONF_HOST)
|
||||||
name = config.get(CONF_NAME)
|
name = config.get(CONF_NAME)
|
||||||
|
|
||||||
add_devices([SmartPlugSwitch(SmartPlug(host), name)])
|
add_devices([SmartPlugSwitch(SmartPlug(host), name)], True)
|
||||||
|
|
||||||
|
|
||||||
class SmartPlugSwitch(SwitchDevice):
|
class SmartPlugSwitch(SwitchDevice):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user