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

Tibber, fix #129014 #129276

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions homeassistant/components/tibber/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@
"""Initialize the sensor."""
super().__init__(tibber_home=tibber_home)
self._last_updated: datetime.datetime | None = None
self._spread_load_constant = randrange(5000)
self._spread_load_constant = randrange(20 * 60)

Check warning on line 372 in homeassistant/components/tibber/sensor.py

View check run for this annotation

Codecov / codecov/patch

homeassistant/components/tibber/sensor.py#L372

Added line #L372 was not covered by tests

self._attr_available = False
self._attr_extra_state_attributes = {
Expand Down Expand Up @@ -397,7 +397,7 @@
if (
not self._tibber_home.last_data_timestamp
or (self._tibber_home.last_data_timestamp - now).total_seconds()
< 5 * 3600 + self._spread_load_constant
< 11 * 3600 + self._spread_load_constant
or not self.available
):
_LOGGER.debug("Asking for new data")
Expand Down