From 766596abdc1e63aafde9ab293cd5b6a76f643d3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Sat, 24 Feb 2024 14:41:12 +0100 Subject: [PATCH] Add Airzone Cloud Air Quality zone binary sensors (#106573) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * airzone_cloud: add Air Quality binary sensor Signed-off-by: Álvaro Fernández Rojas * airzone_cloud: binary_sensor: rename Air Quality Add "active" to indicate status. Signed-off-by: Álvaro Fernández Rojas --------- Signed-off-by: Álvaro Fernández Rojas --- homeassistant/components/airzone_cloud/binary_sensor.py | 5 +++++ homeassistant/components/airzone_cloud/strings.json | 7 +++++++ tests/components/airzone_cloud/test_binary_sensor.py | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/homeassistant/components/airzone_cloud/binary_sensor.py b/homeassistant/components/airzone_cloud/binary_sensor.py index 9f99e49f6501b..20b747dfae360 100644 --- a/homeassistant/components/airzone_cloud/binary_sensor.py +++ b/homeassistant/components/airzone_cloud/binary_sensor.py @@ -7,6 +7,7 @@ from aioairzone_cloud.const import ( AZD_ACTIVE, AZD_AIDOOS, + AZD_AQ_ACTIVE, AZD_ERRORS, AZD_PROBLEMS, AZD_SYSTEMS, @@ -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, diff --git a/homeassistant/components/airzone_cloud/strings.json b/homeassistant/components/airzone_cloud/strings.json index 12f155b448683..fe7c38c83742a 100644 --- a/homeassistant/components/airzone_cloud/strings.json +++ b/homeassistant/components/airzone_cloud/strings.json @@ -15,5 +15,12 @@ } } } + }, + "entity": { + "binary_sensor": { + "air_quality_active": { + "name": "Air Quality active" + } + } } } diff --git a/tests/components/airzone_cloud/test_binary_sensor.py b/tests/components/airzone_cloud/test_binary_sensor.py index ca40a7320469f..b81631728b489 100644 --- a/tests/components/airzone_cloud/test_binary_sensor.py +++ b/tests/components/airzone_cloud/test_binary_sensor.py @@ -41,6 +41,9 @@ 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 @@ -48,6 +51,9 @@ async def test_airzone_create_binary_sensors(hass: HomeAssistant) -> 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