Skip to content

Commit

Permalink
stick to same data type when no type is specified in config
Browse files Browse the repository at this point in the history
  • Loading branch information
thematrixdev committed Oct 16, 2024
1 parent 147fbc7 commit a377af9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/clp/manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "11.7.3",
"version": "11.7.4",
"domain": "clp",
"name": "CLP",
"documentation": "https://github.com/thematrixdev/home-assistant-clp",
Expand Down
5 changes: 5 additions & 0 deletions custom_components/clp/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ def __init__(
self._timeout = timeout
self._retry_delay = retry_delay

self._initialized = False
self._type = type
self._get_acct = get_acct
self._get_bill = get_bill
Expand Down Expand Up @@ -796,3 +797,7 @@ async def async_update(self) -> None:
if not self._hourly_task_last_fetch_time or datetime.datetime.now(self._timezone) > self._hourly_task_last_fetch_time + HOURLY_TASK_INTERVAL:
if self._get_hourly or self._type == '' or self._type.upper() == 'HOURLY':
await self.renewable_get_hourly()

if not self._initialized:
self._initialized = True
self._type = self._state_data_type

0 comments on commit a377af9

Please sign in to comment.