Skip to content

Commit

Permalink
Merge pull request #61 from jmcruvellier/dev
Browse files Browse the repository at this point in the history
Capteurs Humidité et Température ne sont plus mis à jour après minuit…
  • Loading branch information
jmcruvellier committed Nov 13, 2023
2 parents 637390b + 58a4044 commit 9219a4c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.1.1

- Bug fix [#59](https://github.com/jmcruvellier/little_monkey/issues/59)

## 0.1.0

- Version Beta
Expand Down
18 changes: 12 additions & 6 deletions custom_components/little_monkey/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,6 @@ def __init__(
self._outdoor_temp = None
self._indoor_hum = None
self._outdoor_hum = None
# Get the current date
self._current_date = datetime.date.today()
# Format the date as 'YYYY-MM-DD'
self._formatted_date = self._current_date.strftime('%Y-%m-%d')

@property
def gateway_firmware_version(self) -> str:
Expand Down Expand Up @@ -473,7 +469,12 @@ async def _kwhstat_wrapper(self) -> any:
async def _tempstat_wrapper(self) -> any:
"""Get tempstat from the API."""
try:
url = ECOJOKO_GATEWAY_URL + f"/{self._gateway_id}/device/{self._temp_hum_id}/tempstat/d4/{self._formatted_date}"
#59 bug fix
# Get the current date
current_date = datetime.date.today()
# Format the date as 'YYYY-MM-DD'
formatted_date = current_date.strftime('%Y-%m-%d')
url = ECOJOKO_GATEWAY_URL + f"/{self._gateway_id}/device/{self._temp_hum_id}/tempstat/d4/{formatted_date}"
async with async_timeout.timeout(CONF_API_TIMEOUT):
response = await self._session.get(
url=url,
Expand Down Expand Up @@ -510,7 +511,12 @@ async def _tempstat_wrapper(self) -> any:
async def _humstat_wrapper(self) -> any:
"""Get humstat from the API."""
try:
url = ECOJOKO_GATEWAY_URL + f"/{self._gateway_id}/device/{self._temp_hum_id}/humstat/d4/{self._formatted_date}"
#59 bug fix
# Get the current date
current_date = datetime.date.today()
# Format the date as 'YYYY-MM-DD'
formatted_date = current_date.strftime('%Y-%m-%d')
url = ECOJOKO_GATEWAY_URL + f"/{self._gateway_id}/device/{self._temp_hum_id}/humstat/d4/{formatted_date}"
async with async_timeout.timeout(CONF_API_TIMEOUT):
response = await self._session.get(
url=url,
Expand Down
2 changes: 1 addition & 1 deletion custom_components/little_monkey/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
DOMAIN = "little_monkey"
MANUFACTURER = "Jean-Marc Cruvellier"
MODEL = "Ecojoko"
VERSION = "0.1.0"
VERSION = "0.1.1"
ATTRIBUTION = "Data provided by https://service.ecojoko.com//"
POLL_INTERVAL = "poll_interval"
DEFAULT_POLL_INTERVAL = "5"
Expand Down
2 changes: 1 addition & 1 deletion custom_components/little_monkey/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"integration_type": "device",
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/jmcruvellier/little_monkey/issues",
"version": "0.1.0"
"version": "0.1.1"
}

0 comments on commit 9219a4c

Please sign in to comment.