Skip to content

Commit

Permalink
fix unloading errors, and bump to use pychlorinator v0.2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielNagy committed Jan 30, 2024
1 parent 008de06 commit 949695e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions custom_components/astralpool_halo_chlorinator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,9 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:

async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload a config entry."""
await hass.config_entries.async_forward_entry_unload(entry, PLATFORMS)
return True
unload_ok = True
for platform in PLATFORMS:
if not await hass.config_entries.async_forward_entry_unload(entry, platform):
unload_ok = False

return unload_ok
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
_LOGGER = logging.getLogger(__name__)


class ChlorinatorDataUpdateCoordinator(DataUpdateCoordinator):
class ChlorinatorDataUpdateCoordinator(DataUpdateCoordinator[dict[str, Any]]):
"""Data coordinator for getting Chlorinator updates."""

def __init__(self, hass: HomeAssistant, chlorinator: HaloChlorinatorAPI) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"iot_class": "local_polling",
"requirements": [
"bluetooth-data-tools>=0.4.0",
"pychlorinator>=0.2.6"
"pychlorinator>=0.2.7"
],
"version": "0.1.0"
}
4 changes: 4 additions & 0 deletions custom_components/astralpool_halo_chlorinator/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
SensorEntity,
SensorEntityDescription,
SensorStateClass,
EntityCategory,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity import DeviceInfo
Expand Down Expand Up @@ -109,6 +110,7 @@
native_unit_of_measurement="L",
device_class=None,
state_class=SensorStateClass.MEASUREMENT,
entity_category=EntityCategory.DIAGNOSTIC,
),
"DosingPumpSecs": SensorEntityDescription(
key="DosingPumpSecs",
Expand All @@ -133,6 +135,7 @@
native_unit_of_measurement="mA",
device_class=None,
state_class=SensorStateClass.MEASUREMENT,
entity_category=EntityCategory.DIAGNOSTIC,
),
"RealCelllevel": SensorEntityDescription(
key="RealCelllevel",
Expand All @@ -141,6 +144,7 @@
native_unit_of_measurement=None,
device_class=None,
state_class=SensorStateClass.MEASUREMENT,
entity_category=EntityCategory.DIAGNOSTIC,
),
"PreviousDaysCellLoad": SensorEntityDescription(
key="PreviousDaysCellLoad",
Expand Down

0 comments on commit 949695e

Please sign in to comment.