I'm not quite sure when this happened, however in the last few months (possibly after an HA upgrade) tryfi seems to have stopped respecting my configured polling rate. I decreased the polling rate from 10 seconds to every minute to reduce load on their servers, but it seems to have jumped back to polling every 10 seconds. In the Home Assistant Integrations page, when I clicked Configure on tryfi, it did show my configured polling rate, but the logs showed it polling every 10 seconds:
2024-06-15 11:16:27.533 DEBUG (MainThread) [custom_components.tryfi] Finished fetching tryfi data in 0.729 seconds (success: True)
2024-06-15 11:16:37.509 DEBUG (MainThread) [custom_components.tryfi] Finished fetching tryfi data in 0.705 seconds (success: True)
2024-06-15 11:16:47.400 DEBUG (MainThread) [custom_components.tryfi] Finished fetching tryfi data in 0.596 seconds (success: True)
I even tried changing the polling rate in the tryfi integration, disabling/re-enabling, restarting HA, and a few other things with no success. I went into .storage/core.config_entries, and found this:
{
"entry_id": "f714e7b707f7bed3ee72fcda818405e6",
"version": 1,
"minor_version": 1,
"domain": "tryfi",
"title": "myemail@example.com",
"data": {
"username": "myemail@example.com",
"password": "mypassword",
"polling": "10" # <--- What the code seems to read
},
"options": {
"polling": "132" # What I configured in the UI and what seems to be updated in the UI
},
"pref_disable_new_entities": false,
"pref_disable_polling": false,
"source": "user",
"unique_id": null,
"disabled_by": null
},
It seems like the config flow is now saving the polling rate in the "options" section instead of the data section, but this code still refers to the data section which isn't being updated by the config flow. I was able to work around this issue by manually updating the "data.polling" value in my .storage/core.config_entries file, but other users may be confused by this.
I'm not sure why this regression happened, but this seems to be fixed by changing from entry.data["polling"] to entry.options["polling"]
Thank you for your work on this integration.
I'm not quite sure when this happened, however in the last few months (possibly after an HA upgrade) tryfi seems to have stopped respecting my configured polling rate. I decreased the polling rate from 10 seconds to every minute to reduce load on their servers, but it seems to have jumped back to polling every 10 seconds. In the Home Assistant Integrations page, when I clicked Configure on tryfi, it did show my configured polling rate, but the logs showed it polling every 10 seconds:
I even tried changing the polling rate in the tryfi integration, disabling/re-enabling, restarting HA, and a few other things with no success. I went into
.storage/core.config_entries
, and found this:It seems like the config flow is now saving the polling rate in the "options" section instead of the data section, but this code still refers to the data section which isn't being updated by the config flow. I was able to work around this issue by manually updating the "data.polling" value in my
.storage/core.config_entries
file, but other users may be confused by this.I'm not sure why this regression happened, but this seems to be fixed by changing from
entry.data["polling"]
toentry.options["polling"]
HA v2024.5.5 hacs-tryfi v0.0.23