Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Airzone Cloud Air Quality zone binary sensors #106573

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions homeassistant/components/airzone_cloud/binary_sensor.py
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
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
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