Skip to content
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

Add service to refresh state periodically #271

Closed
wants to merge 21 commits into from

Conversation

iMicknl
Copy link
Owner

@iMicknl iMicknl commented Sep 18, 2020

Screenshot 2020-09-19 at 01 21 55

Adds support for calling /setup/devices/states/refresh periodically, using the existing data update coordinator.

Fixes #167.

@@ -191,10 +223,33 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry):

async def update_listener(hass: HomeAssistant, entry: ConfigEntry):
"""Update when config_entry options update."""

async def handle_refresh_states(*_):
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the duplicate code I don't like that much.

@iMicknl iMicknl force-pushed the feature/refresh_states branch 3 times, most recently from 791c116 to 02a2628 Compare September 27, 2020 20:58
@iMicknl
Copy link
Owner Author

iMicknl commented Sep 27, 2020

I am not sure if we should allow them to set this to 5 seconds, since it is a very 'expensive' call and it looks like you get 'TooManyRequests' exception when polling on a high interval. Currently we don't catch TooManyRequests exception that well in DataUpdateCoordinator.

@vlebourl vlebourl marked this pull request as draft December 10, 2020 10:04
iMicknl and others added 15 commits January 18, 2021 09:25
Signed-off-by: Mick Vleeshouwer <[email protected]>
Signed-off-by: Mick Vleeshouwer <[email protected]>
Signed-off-by: Mick Vleeshouwer <[email protected]>
Signed-off-by: Mick Vleeshouwer <[email protected]>
Signed-off-by: Mick Vleeshouwer <[email protected]>
Signed-off-by: Mick Vleeshouwer <[email protected]>
Signed-off-by: Mick Vleeshouwer <[email protected]>
Signed-off-by: Mick Vleeshouwer <[email protected]>
Signed-off-by: Mick Vleeshouwer <[email protected]>
@iMicknl iMicknl force-pushed the feature/refresh_states branch from d419ce3 to 9fba7c0 Compare January 18, 2021 08:33
@iMicknl iMicknl marked this pull request as ready for review January 18, 2021 08:43
@iMicknl
Copy link
Owner Author

iMicknl commented Jan 19, 2021

PR has been tested and is fully functional, however I am still in doubt if we should disable this task by default.

Maybe we should add a checkbox to enable this task.

@adriweb
Copy link

adriweb commented Jan 19, 2021

That looks like something that Somfy wouldn't like, especially if set with low values. I think it would be better not enabling that, especially by default, if it can get users/software in trouble.
But I suppose you should contact Somfy to make sure.

@vlebourl
Copy link
Collaborator

Agreed, I would leave that unchecked by default and let users be responsible for making an automation to use it.

@iMicknl
Copy link
Owner Author

iMicknl commented Jan 19, 2021

That looks like something that Somfy wouldn't like, especially if set with low values. I think it would be better not enabling that, especially by default, if it can get users/software in trouble.
But I suppose you should contact Somfy to make sure.

Indeed, I am on the same page. Currently the widely used tahoma-homebridge is polling this endpoint every 30 minutes and they have many users. This endpoint is also called by tahomalink.com every time you login, however if we don't need it, we should not enable it by default.

https://github.com/dubocr/homebridge-tahoma/blob/d1a4ac3fa26adfcb06764db377f069c7bbd922ce/overkiz-api.js#L117

@francodutch
Copy link

francodutch commented Feb 7, 2021

@iMicknl as you know I would love for this to be pulled in to the master - my gate closes automatically two minutes after opening, which is not caught by Tahome unless I use an automation that calls the refresh service two minutes after my gate's state has changed from closed. I understand that caution is needed though.

@vlebourl
Copy link
Collaborator

vlebourl commented Feb 9, 2022

I think this one can be closed. This isn't something that will be added to core IMO.

@iMicknl iMicknl closed this Feb 9, 2022
fetzerch added a commit to fetzerch/homeassistant-core that referenced this pull request Sep 2, 2023
The Somfy Dexxo smart io (io:DiscreteGarageOpenerWithPartialPositionIOComponent)
supports a third position state: partial. This state is meant to be
used to ventilate the garage.

This commit adds a select entity for the position state. The
implementation is very similar to the already existing position state
for gate's with a pedestrian position.

Note: For the updates to work properly, we'd still need
iMicknl/ha-tahoma#167 /
iMicknl/ha-tahoma#271 to be implemented.
See Somfy-Developer/Somfy-TaHoma-Developer-Mode#26
for discussion with Somfy.
fetzerch added a commit to fetzerch/homeassistant-core that referenced this pull request Sep 2, 2023
The Somfy Dexxo smart io (io:DiscreteGarageOpenerWithPartialPositionIOComponent)
supports a third position state: partial. This state is meant to be
used to ventilate the garage.

This commit adds a select entity for the position state. The
implementation is very similar to the already existing position state
for gate's with a pedestrian position.

Note: For the updates to work properly, we'd still need
iMicknl/ha-tahoma#167 /
iMicknl/ha-tahoma#271 to be implemented.
See Somfy-Developer/Somfy-TaHoma-Developer-Mode#26
for discussion with Somfy.
fetzerch added a commit to fetzerch/homeassistant-core that referenced this pull request Sep 4, 2023
The Somfy Dexxo smart io (io:DiscreteGarageOpenerWithPartialPositionIOComponent)
supports a third position state: partial. This state is meant to be
used to ventilate the garage.

This commit adds a select entity for the position state. The
implementation is very similar to the already existing position state
for gate's with a pedestrian position.

Note: For the updates to work properly, we'd still need
iMicknl/ha-tahoma#167 /
iMicknl/ha-tahoma#271 to be implemented.
See Somfy-Developer/Somfy-TaHoma-Developer-Mode#26
for discussion with Somfy.
fetzerch added a commit to fetzerch/homeassistant-core that referenced this pull request Sep 4, 2023
The Somfy Dexxo smart io (io:DiscreteGarageOpenerWithPartialPositionIOComponent)
supports a third position state: partial. This state is meant to be
used to ventilate the garage.

This commit adds a select entity for the position state. The
implementation is very similar to the already existing position state
for gate's with a pedestrian position.

Note: For the updates to work properly, we'd still need
iMicknl/ha-tahoma#167 /
iMicknl/ha-tahoma#271 to be implemented.
See Somfy-Developer/Somfy-TaHoma-Developer-Mode#26
for discussion with Somfy.
fetzerch added a commit to fetzerch/homeassistant-core that referenced this pull request Sep 11, 2023
The Somfy Dexxo smart io (io:DiscreteGarageOpenerWithPartialPositionIOComponent)
supports a third position state: partial. This state is meant to be
used to ventilate the garage.

This commit adds a select entity for the position state. The
implementation is very similar to the already existing position state
for gate's with a pedestrian position.

Note: For the updates to work properly, we'd still need
iMicknl/ha-tahoma#167 /
iMicknl/ha-tahoma#271 to be implemented.
See Somfy-Developer/Somfy-TaHoma-Developer-Mode#26
for discussion with Somfy.
fetzerch added a commit to fetzerch/homeassistant-core that referenced this pull request Sep 28, 2023
The Somfy Dexxo smart io (io:DiscreteGarageOpenerWithPartialPositionIOComponent)
supports a third position state: partial. This state is meant to be
used to ventilate the garage.

This commit adds a select entity for the position state. The
implementation is very similar to the already existing position state
for gate's with a pedestrian position.

Note: For the updates to work properly, we'd still need
iMicknl/ha-tahoma#167 /
iMicknl/ha-tahoma#271 to be implemented.
See Somfy-Developer/Somfy-TaHoma-Developer-Mode#26
for discussion with Somfy.
fetzerch added a commit to fetzerch/homeassistant-core that referenced this pull request Sep 28, 2023
The Somfy Dexxo smart io (io:DiscreteGarageOpenerWithPartialPositionIOComponent)
supports a third position state: partial. This state is meant to be
used to ventilate the garage.

This commit adds a select entity for the position state. The
implementation is very similar to the already existing position state
for gate's with a pedestrian position.

Note: For the updates to work properly, we'd still need
iMicknl/ha-tahoma#167 /
iMicknl/ha-tahoma#271 to be implemented.
See Somfy-Developer/Somfy-TaHoma-Developer-Mode#26
for discussion with Somfy.
iMicknl pushed a commit to fetzerch/homeassistant-core that referenced this pull request Oct 10, 2023
The Somfy Dexxo smart io (io:DiscreteGarageOpenerWithPartialPositionIOComponent)
supports a third position state: partial. This state is meant to be
used to ventilate the garage.

This commit adds a select entity for the position state. The
implementation is very similar to the already existing position state
for gate's with a pedestrian position.

Note: For the updates to work properly, we'd still need
iMicknl/ha-tahoma#167 /
iMicknl/ha-tahoma#271 to be implemented.
See Somfy-Developer/Somfy-TaHoma-Developer-Mode#26
for discussion with Somfy.
iMicknl pushed a commit to fetzerch/homeassistant-core that referenced this pull request Nov 7, 2023
The Somfy Dexxo smart io (io:DiscreteGarageOpenerWithPartialPositionIOComponent)
supports a third position state: partial. This state is meant to be
used to ventilate the garage.

This commit adds a select entity for the position state. The
implementation is very similar to the already existing position state
for gate's with a pedestrian position.

Note: For the updates to work properly, we'd still need
iMicknl/ha-tahoma#167 /
iMicknl/ha-tahoma#271 to be implemented.
See Somfy-Developer/Somfy-TaHoma-Developer-Mode#26
for discussion with Somfy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement optional update coordinator to call refreshState periodically
5 participants