Skip to content

Commit

Permalink
fix: consumptions not received (#30)
Browse files Browse the repository at this point in the history
* fix: check date to max today

* bump version
  • Loading branch information
duhow authored Oct 29, 2024
1 parent 5c06e2b commit be80f6b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion custom_components/aigues_barcelona/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/duhow/hass-aigues-barcelona/issues",
"requirements": [],
"version": "0.4.2"
"version": "0.4.3"
}
3 changes: 1 addition & 2 deletions custom_components/aigues_barcelona/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ async def _async_update_data(self):
_LOGGER.info(f"Updating coordinator data for {self.contract}")
TODAY = datetime.now()
LAST_WEEK = TODAY - timedelta(days=7)
TOMORROW = TODAY + timedelta(days=1)

try:
previous = datetime.fromisoformat(self._data.get(CONF_STATE, ""))
Expand All @@ -155,7 +154,7 @@ async def _async_update_data(self):
# TODO: change once recaptcha is fiexd
# await self.hass.async_add_executor_job(self._api.login)
consumptions = await self.hass.async_add_executor_job(
self._api.consumptions, LAST_WEEK, TOMORROW, self.contract
self._api.consumptions, LAST_WEEK, TODAY, self.contract
)
except ConfigEntryAuthFailed as exp:
_LOGGER.error("Token has expired, cannot check consumptions.")
Expand Down

0 comments on commit be80f6b

Please sign in to comment.