mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +00:00
Add daily energy consumption sensor for melcloud (#78682)
This commit is contained in:
parent
253647aaa9
commit
e39c4db438
@ -141,6 +141,11 @@ class MelCloudDevice:
|
|||||||
name=self.name,
|
name=self.name,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def daily_energy_consumed(self) -> float | None:
|
||||||
|
"""Return energy consumed during the current day in kWh."""
|
||||||
|
return self.device.daily_energy_consumed
|
||||||
|
|
||||||
|
|
||||||
async def mel_devices_setup(hass, token) -> dict[str, list[MelCloudDevice]]:
|
async def mel_devices_setup(hass, token) -> dict[str, list[MelCloudDevice]]:
|
||||||
"""Query connected devices from MELCloud."""
|
"""Query connected devices from MELCloud."""
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"name": "MELCloud",
|
"name": "MELCloud",
|
||||||
"config_flow": true,
|
"config_flow": true,
|
||||||
"documentation": "https://www.home-assistant.io/integrations/melcloud",
|
"documentation": "https://www.home-assistant.io/integrations/melcloud",
|
||||||
"requirements": ["pymelcloud==2.5.6"],
|
"requirements": ["pymelcloud==2.5.8"],
|
||||||
"codeowners": ["@vilppuvuorinen"],
|
"codeowners": ["@vilppuvuorinen"],
|
||||||
"iot_class": "cloud_polling",
|
"iot_class": "cloud_polling",
|
||||||
"loggers": ["pymelcloud"]
|
"loggers": ["pymelcloud"]
|
||||||
|
@ -57,6 +57,15 @@ ATA_SENSORS: tuple[MelcloudSensorEntityDescription, ...] = (
|
|||||||
value_fn=lambda x: x.device.total_energy_consumed,
|
value_fn=lambda x: x.device.total_energy_consumed,
|
||||||
enabled=lambda x: x.device.has_energy_consumed_meter,
|
enabled=lambda x: x.device.has_energy_consumed_meter,
|
||||||
),
|
),
|
||||||
|
MelcloudSensorEntityDescription(
|
||||||
|
key="daily_energy",
|
||||||
|
name="Daily Energy Consumed",
|
||||||
|
icon="mdi:factory",
|
||||||
|
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
||||||
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
|
value_fn=lambda x: x.device.daily_energy_consumed,
|
||||||
|
enabled=lambda x: True,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
ATW_SENSORS: tuple[MelcloudSensorEntityDescription, ...] = (
|
ATW_SENSORS: tuple[MelcloudSensorEntityDescription, ...] = (
|
||||||
MelcloudSensorEntityDescription(
|
MelcloudSensorEntityDescription(
|
||||||
@ -77,6 +86,15 @@ ATW_SENSORS: tuple[MelcloudSensorEntityDescription, ...] = (
|
|||||||
value_fn=lambda x: x.device.tank_temperature,
|
value_fn=lambda x: x.device.tank_temperature,
|
||||||
enabled=lambda x: True,
|
enabled=lambda x: True,
|
||||||
),
|
),
|
||||||
|
MelcloudSensorEntityDescription(
|
||||||
|
key="daily_energy",
|
||||||
|
name="Daily Energy Consumed",
|
||||||
|
icon="mdi:factory",
|
||||||
|
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
|
||||||
|
device_class=SensorDeviceClass.ENERGY,
|
||||||
|
value_fn=lambda x: x.device.daily_energy_consumed,
|
||||||
|
enabled=lambda x: True,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
ATW_ZONE_SENSORS: tuple[MelcloudSensorEntityDescription, ...] = (
|
ATW_ZONE_SENSORS: tuple[MelcloudSensorEntityDescription, ...] = (
|
||||||
MelcloudSensorEntityDescription(
|
MelcloudSensorEntityDescription(
|
||||||
|
@ -1703,7 +1703,7 @@ pymazda==0.3.7
|
|||||||
pymediaroom==0.6.5.4
|
pymediaroom==0.6.5.4
|
||||||
|
|
||||||
# homeassistant.components.melcloud
|
# homeassistant.components.melcloud
|
||||||
pymelcloud==2.5.6
|
pymelcloud==2.5.8
|
||||||
|
|
||||||
# homeassistant.components.meteoclimatic
|
# homeassistant.components.meteoclimatic
|
||||||
pymeteoclimatic==0.0.6
|
pymeteoclimatic==0.0.6
|
||||||
|
@ -1198,7 +1198,7 @@ pymata-express==1.19
|
|||||||
pymazda==0.3.7
|
pymazda==0.3.7
|
||||||
|
|
||||||
# homeassistant.components.melcloud
|
# homeassistant.components.melcloud
|
||||||
pymelcloud==2.5.6
|
pymelcloud==2.5.8
|
||||||
|
|
||||||
# homeassistant.components.meteoclimatic
|
# homeassistant.components.meteoclimatic
|
||||||
pymeteoclimatic==0.0.6
|
pymeteoclimatic==0.0.6
|
||||||
|
Loading…
x
Reference in New Issue
Block a user