baudneo / cync-lan

Local async MQTT controller for Cync / C by GE smart devices - designed for Home Assistant.
Other
16 stars 1 forks source link

State machine issues - devices show offline/online when the opposite is true. #4

Closed baudneo closed 5 months ago

baudneo commented 7 months ago

Describe the bug After the script runs for awhile, some devices may show offline when they are online and vice versa.

To Reproduce Steps to reproduce the behavior: Let it run for an extended amount of time, the state of each device may not align with its true state.

Expected behavior The script tracks each devices state correctly, it does not go out of sync.

This is a known issue that I am tracking. State machine logic will need to be addressed.

BT only bulbs are an issue as well but, it seems they broadcast BT mesh info events over the 0x83 data channel.

baudneo commented 6 months ago

I think I have the fix, just need to implement properly.

When the device closes and reconnects, I try and replace it's socket reader and writer in place and keep the background async task running. I think I need to cancel the task, remove the old device and then replace it with a new cyncHttpDevice instance.

baudneo commented 6 months ago

Hoping https://github.com/baudneo/cync-lan/commit/177f877b29802b03a06a77e39b3d590b3106b269 fixes this issue, please test and report back. Building new images for release 0.0.1-beta.4 shortly.

baudneo commented 5 months ago

https://github.com/baudneo/cync-lan/commit/19a5276c36c4c73c978df94597fcc0b395b25d93 hopefully fully solves this issue.

baudneo commented 5 months ago

Confirmed fixed and stable after https://github.com/baudneo/cync-lan/commit/12f3d52f1d31dc002a752f138d6ef6c3f48ab1ca