mirror of
https://github.com/home-assistant/core.git
synced 2025-07-12 07:47:08 +00:00
Add Airzone Cloud WebServer CPU/Memory sensors (#122667)
airzone_cloud: sensor: add WebServer CPU/Memory Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
This commit is contained in:
parent
58419f14e8
commit
888ffc002f
@ -1,6 +1,12 @@
|
|||||||
{
|
{
|
||||||
"entity": {
|
"entity": {
|
||||||
"sensor": {
|
"sensor": {
|
||||||
|
"cpu_usage": {
|
||||||
|
"default": "mdi:cpu-32-bit"
|
||||||
|
},
|
||||||
|
"free_memory": {
|
||||||
|
"default": "mdi:memory"
|
||||||
|
},
|
||||||
"thermostat_coverage": {
|
"thermostat_coverage": {
|
||||||
"default": "mdi:signal"
|
"default": "mdi:signal"
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,9 @@ from aioairzone_cloud.const import (
|
|||||||
AZD_AQ_PM_1,
|
AZD_AQ_PM_1,
|
||||||
AZD_AQ_PM_2P5,
|
AZD_AQ_PM_2P5,
|
||||||
AZD_AQ_PM_10,
|
AZD_AQ_PM_10,
|
||||||
|
AZD_CPU_USAGE,
|
||||||
AZD_HUMIDITY,
|
AZD_HUMIDITY,
|
||||||
|
AZD_MEMORY_FREE,
|
||||||
AZD_TEMP,
|
AZD_TEMP,
|
||||||
AZD_THERMOSTAT_BATTERY,
|
AZD_THERMOSTAT_BATTERY,
|
||||||
AZD_THERMOSTAT_COVERAGE,
|
AZD_THERMOSTAT_COVERAGE,
|
||||||
@ -54,6 +56,22 @@ AIDOO_SENSOR_TYPES: Final[tuple[SensorEntityDescription, ...]] = (
|
|||||||
)
|
)
|
||||||
|
|
||||||
WEBSERVER_SENSOR_TYPES: Final[tuple[SensorEntityDescription, ...]] = (
|
WEBSERVER_SENSOR_TYPES: Final[tuple[SensorEntityDescription, ...]] = (
|
||||||
|
SensorEntityDescription(
|
||||||
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
|
entity_registry_enabled_default=False,
|
||||||
|
key=AZD_CPU_USAGE,
|
||||||
|
native_unit_of_measurement=PERCENTAGE,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
|
translation_key="cpu_usage",
|
||||||
|
),
|
||||||
|
SensorEntityDescription(
|
||||||
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
|
entity_registry_enabled_default=False,
|
||||||
|
key=AZD_MEMORY_FREE,
|
||||||
|
native_unit_of_measurement=PERCENTAGE,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
|
translation_key="free_memory",
|
||||||
|
),
|
||||||
SensorEntityDescription(
|
SensorEntityDescription(
|
||||||
device_class=SensorDeviceClass.SIGNAL_STRENGTH,
|
device_class=SensorDeviceClass.SIGNAL_STRENGTH,
|
||||||
entity_category=EntityCategory.DIAGNOSTIC,
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
|
@ -39,6 +39,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sensor": {
|
"sensor": {
|
||||||
|
"cpu_usage": {
|
||||||
|
"name": "CPU usage"
|
||||||
|
},
|
||||||
|
"free_memory": {
|
||||||
|
"name": "Free memory"
|
||||||
|
},
|
||||||
"thermostat_coverage": {
|
"thermostat_coverage": {
|
||||||
"name": "Signal percentage"
|
"name": "Signal percentage"
|
||||||
}
|
}
|
||||||
|
@ -21,8 +21,11 @@ async def test_airzone_create_sensors(hass: HomeAssistant) -> None:
|
|||||||
assert state.state == "20.0"
|
assert state.state == "20.0"
|
||||||
|
|
||||||
# WebServers
|
# WebServers
|
||||||
state = hass.states.get("sensor.webserver_11_22_33_44_55_66_signal_strength")
|
state = hass.states.get("sensor.webserver_11_22_33_44_55_66_cpu_usage")
|
||||||
assert state.state == "-56"
|
assert state.state == "32"
|
||||||
|
|
||||||
|
state = hass.states.get("sensor.webserver_11_22_33_44_55_66_free_memory")
|
||||||
|
assert state.state == "42616"
|
||||||
|
|
||||||
state = hass.states.get("sensor.webserver_11_22_33_44_55_67_signal_strength")
|
state = hass.states.get("sensor.webserver_11_22_33_44_55_67_signal_strength")
|
||||||
assert state.state == "-77"
|
assert state.state == "-77"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user