Skip to content

Commit

Permalink
feat: add humidifier status
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlb committed Jan 26, 2024
1 parent 51c4f53 commit a95236a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
17 changes: 17 additions & 0 deletions custom_components/ha_carrier/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion custom_components/ha_carrier/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit a95236a

Please sign in to comment.