mirror of
https://github.com/home-assistant/core.git
synced 2026-02-15 07:36:16 +00:00
Add more Melcloud sensors (#160770)
Co-authored-by: Joostlek <joostlek@outlook.com>
This commit is contained in:
@@ -3,6 +3,9 @@
|
||||
"sensor": {
|
||||
"energy_consumed": {
|
||||
"default": "mdi:factory"
|
||||
},
|
||||
"fan_frequency": {
|
||||
"default": "mdi:fan"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user