Skip to content

Update entities after turning on/off entity #6

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

Open
wilfredktlr opened this issue Jan 18, 2023 · 4 comments · Fixed by #11
Open

Update entities after turning on/off entity #6

wilfredktlr opened this issue Jan 18, 2023 · 4 comments · Fixed by #11
Assignees

Comments

@wilfredktlr
Copy link
Contributor

Currently the status of the entity is not directly updated after turning it on/off (for instance the light). I think this is because the status is not processed after executing the action (only every 10 seconds using the refresh_status() method).

@djerik djerik self-assigned this Jan 18, 2023
@djerik djerik linked a pull request Jan 19, 2023 that will close this issue
@djerik djerik reopened this Jan 19, 2023
@djerik
Copy link
Owner

djerik commented Jan 19, 2023

I have added code to notify HA of changes in mertik data.

Calculation of Switch on/off is still delayed, as mertik flags does not tell that is on nor that it is igniting before much later. Maybe #10 will reveal how logic can be improved

@wilfredktlr
Copy link
Contributor Author

I think it will be a good idea to rewrite the process response method now that we know a bit more about the structure of the request/response (#10). This way it will not only update on a status refresh but directly on the response you receive when you send a request to do something. I'll create a new issue later today describing my idea in more detail.

PS. I think it's best to start working on this after mertik.py has been moved to its own repository.

@djerik
Copy link
Owner

djerik commented Jan 22, 2023

Not sure I understand "This way it will not only update on a status refresh but directly on the response you receive when you send a request to do something". It already processes the response if there is any and HA is updated. Only exception I know is SetFlameHeight, that does not have a response, so a status update is requested

@wilfredktlr
Copy link
Contributor Author

When you execute a command (say turning the light on or off) you get a response from the WiFi-module with the current status. I now see that you added code to directly reflect the change in Home Assistant instead of awaiting the response.

I did a quick test and it didn't work as expected. I'll try to test later this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants