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

Update Frequency #98

Open
lux4rd0 opened this issue Jul 21, 2022 · 8 comments
Open

Update Frequency #98

lux4rd0 opened this issue Jul 21, 2022 · 8 comments

Comments

@lux4rd0
Copy link

lux4rd0 commented Jul 21, 2022

Hello!! I wanted to say that I love this integration! It's exactly what I was looking for to build out entities from scheduled calendar events. I did want to check that if I wanted to change the update frequency, is this the right place to make the change:

in __init__.py

Change:

MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=120)

to:

MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=3600)

In this case - 2 minutes to 15 minutes.

My particular use case doesn't have me updating my calendar often... So pinging every 2 minutes for an update that probably won't happen isn't needed. I didn't see an "update frequency" in the UI configuration - so just checking.

Thanks!

@LordMike
Copy link

I too would like this :)

@mbenecke
Copy link

mbenecke commented Jan 4, 2023

a configuration option would be awesome.

Do you like to add it by yourself? Or do you like to have an pull request?

@Olen
Copy link
Collaborator

Olen commented Jan 5, 2023

In this case - 2 minutes to 15 minutes.

3600 seconds = 60 minutes btw.

But remember that the frequency is not only about how ofte the remote calendar is polled, but also about how often the calendar entities are updated - and thereby also how quickly after an event has been added or removed from a calendar it will show up. AND how quickly after an event has passed it will update the sensors for the upcoming events. In this case, it would take up to 60 minutes from an event has passeed until it is removed from the event_1 sensor and the rest of the sensors are renumbered as well.

I don't really see any big benefits of increasing the polling interval, unless HA is installed on a very limited and metered connection, so every byte count.

If anything, it needs to be set as an option, since I for one would not accept the calendar and related entries to be updated so rarely.

With that said, I think this integration needs a lot more love, especially now that the core calendar integration has received a lot of updates in the last releases.

@PixelJonas
Copy link

PixelJonas commented Jan 12, 2023

I'm coming here from a metered connection where every byte counts 🤣 .
I think having an update interval would be nice. Maybe it could be like:

auto-update every X seconds, or when an event ends.

As I'm pulling the dates for the local recycling company (which do not change on a daily basis) I'd like to configure the sensor to only update once a day.

My 2 cent.

@tremor69
Copy link

I have a related problem with the update frequency. The garbage calendar of my city blocks me if I make more request than once a day. Currently I have patched my local install of the integration. Would it be possible to decouple updating entities and making calendar requests? I would be able to create a pull request if someone can point me in the right direction regarding the necessary ha documentation.

@Olen
Copy link
Collaborator

Olen commented May 26, 2023

Once a day sounds really crazy (but I do trust you).

Possibly not the solution you are looking for, but there is another integration specifically for garbage collection:
https://github.com/mampfes/hacs_waste_collection_schedule

It probably already has logic for this if it is a known issue and it has support for your region.

@tremor69
Copy link

Unfortunately my municipality is not supported. I already checked. But maybe it is easier to add support to the other integration. I'll check that.

@Olen
Copy link
Collaborator

Olen commented May 26, 2023

They have a generic ical module as well. But I don't know how often it polls the server.

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

No branches or pull requests

6 participants