1
0
mirror of https://github.com/home-assistant/core.git synced 2026-02-14 23:28:42 +00:00

Add more Melcloud sensors (#160770)

Co-authored-by: Joostlek <joostlek@outlook.com>
This commit is contained in:
Florent Fourcot
2026-02-12 22:39:21 +01:00
committed by GitHub
parent fdf02cf657
commit b7b6c1a72e
3 changed files with 55 additions and 1 deletions

View File

@@ -3,6 +3,9 @@
"sensor": {
"energy_consumed": {
"default": "mdi:factory"
},
"fan_frequency": {
"default": "mdi:fan"
}
}
},

View File

@@ -15,7 +15,14 @@ from homeassistant.components.sensor import (
SensorEntityDescription,
SensorStateClass,
)
from homeassistant.const import UnitOfEnergy, UnitOfTemperature
from homeassistant.const import (
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
EntityCategory,
UnitOfEnergy,
UnitOfFrequency,
UnitOfPower,
UnitOfTemperature,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback
@@ -79,6 +86,41 @@ ATW_SENSORS: tuple[MelcloudSensorEntityDescription, ...] = (
value_fn=lambda x: x.device.tank_temperature,
enabled=lambda x: True,
),
MelcloudSensorEntityDescription(
key="condensing_temperature",
translation_key="condensing_temperature",
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
value_fn=lambda x: x.device.get_device_prop("CondensingTemperature"),
enabled=lambda x: True,
),
MelcloudSensorEntityDescription(
key="fan_frequency",
translation_key="fan_frequency",
native_unit_of_measurement=UnitOfFrequency.HERTZ,
device_class=SensorDeviceClass.FREQUENCY,
state_class=SensorStateClass.MEASUREMENT,
value_fn=lambda x: x.device.get_device_prop("HeatPumpFrequency"),
enabled=lambda x: True,
),
MelcloudSensorEntityDescription(
key="rssi",
entity_registry_enabled_default=False,
native_unit_of_measurement=SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
device_class=SensorDeviceClass.SIGNAL_STRENGTH,
entity_category=EntityCategory.DIAGNOSTIC,
value_fn=lambda x: x.device.wifi_signal,
enabled=lambda x: True,
),
MelcloudSensorEntityDescription(
key="energy_produced",
translation_key="energy_produced",
native_unit_of_measurement=UnitOfPower.KILO_WATT,
device_class=SensorDeviceClass.POWER,
value_fn=lambda x: x.device.get_device_prop("CurrentEnergyProduced"),
enabled=lambda x: True,
),
)
ATW_ZONE_SENSORS: tuple[MelcloudSensorEntityDescription, ...] = (
MelcloudSensorEntityDescription(

View File

@@ -43,9 +43,18 @@
},
"entity": {
"sensor": {
"condensing_temperature": {
"name": "Condensing temperature"
},
"energy_consumed": {
"name": "Energy consumed"
},
"energy_produced": {
"name": "Energy produced"
},
"fan_frequency": {
"name": "Fan frequency"
},
"flow_temperature": {
"name": "Flow temperature"
},