fishbigger / HomeAssistant-Tapo-P100-Control

A custom integration for home assistant to control the Tapo P100 plugs
MIT License
207 stars 69 forks source link

No reconnect after connection lost for lights #35

Closed wlp7s0 closed 3 years ago

wlp7s0 commented 3 years ago

Hello, I've been experimenting with L530E and discovered that if I turn off the bulb and turn it on again after some time, I need to restart HA to be able to control it. So, after power outage or connection loss, HA is not able to connect to the bulb (my HA instance is not at the same location)

urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7fdd65a50b20>: Failed to establish a new connection: [Errno 110] Operation timed out

after this message, the light.py script does no attempts to reestablish the connection and log HA logs just spams WARNING (MainThread) [homeassistant.components.light] Updating tapo_p100_control light took longer than the scheduled update interval 0:00:30 every 30 seconds. I've checked with tcpdump, no packages are send after connection broke.

To fix this, I've added p100 = PyP100.P100(192.168.2.xxx, xxx@mail, pass) as a first line in update function. Unfortunately, I don't have a lot of python programming experience and HA integration, I'm sure there is a way to make it more elegant with config parsing.

wlp7s0 commented 3 years ago

Also, checked the same conditions with plugs. Strangely no issue with plugs.

wlp7s0 commented 3 years ago

Closing the issue. Not related to this integration. https://github.com/fishbigger/TapoP100/issues/24