Increase Netgear speedtest period to 2 hours#85299
Conversation
|
Hey there @hacf-fr, @Quentame, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
| if sensor_data is not None: | ||
| self._value = sensor_data.native_value | ||
| else: | ||
| self.schedule_update_ha_state() |
There was a problem hiding this comment.
The entity state is always updated by default when the entity is added to Home Assistant. We don't need this line.
What was the goal with this change?
There was a problem hiding this comment.
Actually in this case the update coordinator does not fetch new data from the API when the entity is added to prevent large bandwidth usage of speedtest during boot of homeassistant.
So the goal is to have the update coordinator fetch data from the API only if no previous values are available (so this is a new entity).
@MartinHjelmare did I use the wrong command?
I think so...
Schould I have used await self.coordinator.async_request_refresh()?
Breaking change
Proposed change
Increase Netgear speedtest period from 30 minutes to 2 hours to decrease data usage, see issue: #85137
When speedtest sensors are added for the first time and no last sensor data is available, do a speedtest emidiatly.
Type of change
Additional information
Checklist
black --fast homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all..coveragerc.To help with the load of incoming pull requests: