diff --git a/CHANGELOG.md b/CHANGELOG.md index b79338c..1d865f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.1.1 + +- Bug fix [#59](https://github.com/jmcruvellier/little_monkey/issues/59) + ## 0.1.0 - Version Beta diff --git a/custom_components/little_monkey/api.py b/custom_components/little_monkey/api.py index b2a43d3..b7f3117 100644 --- a/custom_components/little_monkey/api.py +++ b/custom_components/little_monkey/api.py @@ -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: @@ -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, @@ -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, diff --git a/custom_components/little_monkey/const.py b/custom_components/little_monkey/const.py index 7205158..c3b2f2e 100644 --- a/custom_components/little_monkey/const.py +++ b/custom_components/little_monkey/const.py @@ -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" diff --git a/custom_components/little_monkey/manifest.json b/custom_components/little_monkey/manifest.json index e5831c0..8529d88 100644 --- a/custom_components/little_monkey/manifest.json +++ b/custom_components/little_monkey/manifest.json @@ -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" } \ No newline at end of file