-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Device sync improvements #23
Conversation
This PR solves issue #18 |
@hildensia not to push you, but do you have time to review this pr? |
@@ -50,6 +51,12 @@ async def sender_task(self): | |||
await self.sync_scenes(0) | |||
await self.get_device_names() | |||
|
|||
logging.info("Waiting until all devices are retreived") | |||
await trio.sleep(5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why 5s? Could we react to the actual event somehow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem faced here is that it is not known how many devices will be returned. So we can wait for the first device name to return, but then we still don't know how much devices will show up. The best thing to do imo, is to rerun this sync some times more often, but it is not necessary to do this every 30 seconds. It takes some time to implement that. Is it ok that this becomes an issue and it is resolved later?
Only minor things. Can you run the |
PEB8
This PR improves the way devices are synced. It has got a reverse engineered device sync implementation from the original app. It does this by using the DEVICE_NAME_REPLY, grabbing the ID of the device and send it back with a bogus device state. This will trigger DEVICE_STATUS_UPDATE to be sent to ELRO Connects. With this, ELRO Connects will get all the devices and their statuses within ~40 seconds after launch.
The protocol documentation has also been updated.