mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Requesting data from last seven days (#49485)
This commit is contained in:
parent
39cb22374d
commit
28a909c463
@ -774,8 +774,12 @@ class DataManager:
|
|||||||
async def async_get_measures(self) -> dict[MeasureType, Any]:
|
async def async_get_measures(self) -> dict[MeasureType, Any]:
|
||||||
"""Get the measures data."""
|
"""Get the measures data."""
|
||||||
_LOGGER.debug("Updating withings measures")
|
_LOGGER.debug("Updating withings measures")
|
||||||
|
now = dt.utcnow()
|
||||||
|
startdate = now - datetime.timedelta(days=7)
|
||||||
|
|
||||||
response = await self._hass.async_add_executor_job(self._api.measure_get_meas)
|
response = await self._hass.async_add_executor_job(
|
||||||
|
self._api.measure_get_meas, None, None, startdate, now, None, startdate
|
||||||
|
)
|
||||||
|
|
||||||
# Sort from oldest to newest.
|
# Sort from oldest to newest.
|
||||||
groups = sorted(
|
groups = sorted(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user