From a95236af77b0665d34463f2adc2b5165c7f6c039 Mon Sep 17 00:00:00 2001 From: Brendan Dahl Date: Thu, 25 Jan 2024 19:43:25 -0500 Subject: [PATCH] feat: add humidifier status --- custom_components/ha_carrier/binary_sensor.py | 17 +++++++++++++++++ custom_components/ha_carrier/manifest.json | 2 +- requirements.txt | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/custom_components/ha_carrier/binary_sensor.py b/custom_components/ha_carrier/binary_sensor.py index 4c6eeb1..eb83cc8 100644 --- a/custom_components/ha_carrier/binary_sensor.py +++ b/custom_components/ha_carrier/binary_sensor.py @@ -27,6 +27,7 @@ async def async_setup_entry(hass, config_entry: ConfigEntry, async_add_entities) entities.extend( [ OnlineSensor(updater), + HumidifierSensor(updater), ] ) for zone in updater.carrier_system.config.zones: @@ -86,3 +87,19 @@ def _status_zone(self): def is_on(self) -> bool | None: """Return true if occupied.""" return self._status_zone.occupancy + + +class HumidifierSensor(CarrierEntity, BinarySensorEntity): + """Displays occupancy state.""" + + _attr_device_class = BinarySensorDeviceClass.MOISTURE + + def __init__(self, updater): + """Create identifiers.""" + self._updater = updater + super().__init__(f"Humidifier Running", updater) + + @property + def is_on(self) -> bool | None: + if self._updater.carrier_system.status.humidifier_on is not None: + return self._updater.carrier_system.status.filter_used diff --git a/custom_components/ha_carrier/manifest.json b/custom_components/ha_carrier/manifest.json index a6bd435..7ecd426 100644 --- a/custom_components/ha_carrier/manifest.json +++ b/custom_components/ha_carrier/manifest.json @@ -8,6 +8,6 @@ "iot_class": "cloud_polling", "issue_tracker": "https://github.com/dahlb/ha_carrier/issues", "loggers": ["carrier_api"], - "requirements": ["carrier-api==1.11.1"], + "requirements": ["carrier-api==1.12.0"], "version": "1.20.8" } diff --git a/requirements.txt b/requirements.txt index fb1b3f6..c0bca58 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,4 @@ colorlog==6.8.0 homeassistant==2023.3.0 pip>=8.0.3,<23.4 ruff==0.1.14 -carrier-api==1.11.1 +carrier-api===1.12.0