Skip to content

Commit

Permalink
Add Airzone Cloud Air Quality zone binary sensors (home-assistant#106573
Browse files Browse the repository at this point in the history
)

* airzone_cloud: add Air Quality binary sensor

Signed-off-by: Álvaro Fernández Rojas <[email protected]>

* airzone_cloud: binary_sensor: rename Air Quality

Add "active" to indicate status.

Signed-off-by: Álvaro Fernández Rojas <[email protected]>

---------

Signed-off-by: Álvaro Fernández Rojas <[email protected]>
  • Loading branch information
Noltari authored Feb 24, 2024
1 parent d3d6870 commit 766596a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions homeassistant/components/airzone_cloud/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from aioairzone_cloud.const import (
AZD_ACTIVE,
AZD_AIDOOS,
AZD_AQ_ACTIVE,
AZD_ERRORS,
AZD_PROBLEMS,
AZD_SYSTEMS,
Expand Down Expand Up @@ -76,6 +77,10 @@ class AirzoneBinarySensorEntityDescription(BinarySensorEntityDescription):
device_class=BinarySensorDeviceClass.RUNNING,
key=AZD_ACTIVE,
),
AirzoneBinarySensorEntityDescription(
key=AZD_AQ_ACTIVE,
translation_key="air_quality_active",
),
AirzoneBinarySensorEntityDescription(
attributes={
"warnings": AZD_WARNINGS,
Expand Down
7 changes: 7 additions & 0 deletions homeassistant/components/airzone_cloud/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,12 @@
}
}
}
},
"entity": {
"binary_sensor": {
"air_quality_active": {
"name": "Air Quality active"
}
}
}
}
6 changes: 6 additions & 0 deletions tests/components/airzone_cloud/test_binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,19 @@ async def test_airzone_create_binary_sensors(hass: HomeAssistant) -> None:
assert state.attributes.get("warnings") is None

# Zones
state = hass.states.get("binary_sensor.dormitorio_air_quality_active")
assert state.state == STATE_OFF

state = hass.states.get("binary_sensor.dormitorio_problem")
assert state.state == STATE_OFF
assert state.attributes.get("warnings") is None

state = hass.states.get("binary_sensor.dormitorio_running")
assert state.state == STATE_OFF

state = hass.states.get("binary_sensor.salon_air_quality_active")
assert state.state == STATE_OFF

state = hass.states.get("binary_sensor.salon_problem")
assert state.state == STATE_OFF
assert state.attributes.get("warnings") is None
Expand Down

0 comments on commit 766596a

Please sign in to comment.