Requesting data from last seven days (#49485)
parent
39cb22374d
commit
28a909c463
|
@ -774,8 +774,12 @@ class DataManager:
|
|||
async def async_get_measures(self) -> dict[MeasureType, Any]:
|
||||
"""Get the measures data."""
|
||||
_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.
|
||||
groups = sorted(
|
||||
|
|
Loading…
Reference in New Issue