Add Airzone Cloud zone thermostat sensors (#122648)

* airzone_cloud: sensor: add zone thermostat sensors

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

* airzone_cloud: sensor: add missing signal percentage icon

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

* airzone_cloud: sensor: add signal percentage translation

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

* airzone_cloud: sensor: disable thermostat_coverage

Also add to diagnostics category.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

* Update homeassistant/components/airzone_cloud/strings.json

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

---------

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
pull/122660/head
Álvaro Fernández Rojas 2024-07-26 19:28:39 +02:00 committed by GitHub
parent 53131390ac
commit d3d522c463
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 36 additions and 0 deletions

View File

@ -0,0 +1,9 @@
{
"entity": {
"sensor": {
"thermostat_coverage": {
"default": "mdi:signal"
}
}
}
}

View File

@ -12,6 +12,8 @@ from aioairzone_cloud.const import (
AZD_AQ_PM_10,
AZD_HUMIDITY,
AZD_TEMP,
AZD_THERMOSTAT_BATTERY,
AZD_THERMOSTAT_COVERAGE,
AZD_WEBSERVERS,
AZD_WIFI_RSSI,
AZD_ZONES,
@ -98,6 +100,20 @@ ZONE_SENSOR_TYPES: Final[tuple[SensorEntityDescription, ...]] = (
native_unit_of_measurement=PERCENTAGE,
state_class=SensorStateClass.MEASUREMENT,
),
SensorEntityDescription(
device_class=SensorDeviceClass.BATTERY,
key=AZD_THERMOSTAT_BATTERY,
native_unit_of_measurement=PERCENTAGE,
state_class=SensorStateClass.MEASUREMENT,
),
SensorEntityDescription(
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False,
key=AZD_THERMOSTAT_COVERAGE,
native_unit_of_measurement=PERCENTAGE,
state_class=SensorStateClass.MEASUREMENT,
translation_key="thermostat_coverage",
),
)

View File

@ -37,6 +37,11 @@
"auto": "Auto"
}
}
},
"sensor": {
"thermostat_coverage": {
"name": "Signal percentage"
}
}
}
}

View File

@ -31,6 +31,9 @@ async def test_airzone_create_sensors(hass: HomeAssistant) -> None:
state = hass.states.get("sensor.dormitorio_air_quality_index")
assert state.state == "1"
state = hass.states.get("sensor.dormitorio_battery")
assert state.state == "54"
state = hass.states.get("sensor.dormitorio_pm1")
assert state.state == "3"
@ -40,6 +43,9 @@ async def test_airzone_create_sensors(hass: HomeAssistant) -> None:
state = hass.states.get("sensor.dormitorio_pm10")
assert state.state == "3"
state = hass.states.get("sensor.dormitorio_signal_percentage")
assert state.state == "76"
state = hass.states.get("sensor.dormitorio_temperature")
assert state.state == "25.0"