diff --git a/homeassistant/components/melcloud/__init__.py b/homeassistant/components/melcloud/__init__.py index d8a044d23f6..5eefb3db487 100644 --- a/homeassistant/components/melcloud/__init__.py +++ b/homeassistant/components/melcloud/__init__.py @@ -141,6 +141,11 @@ class MelCloudDevice: 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]]: """Query connected devices from MELCloud.""" diff --git a/homeassistant/components/melcloud/manifest.json b/homeassistant/components/melcloud/manifest.json index 2f209667daf..f4853f48c8c 100644 --- a/homeassistant/components/melcloud/manifest.json +++ b/homeassistant/components/melcloud/manifest.json @@ -3,7 +3,7 @@ "name": "MELCloud", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/melcloud", - "requirements": ["pymelcloud==2.5.6"], + "requirements": ["pymelcloud==2.5.8"], "codeowners": ["@vilppuvuorinen"], "iot_class": "cloud_polling", "loggers": ["pymelcloud"] diff --git a/homeassistant/components/melcloud/sensor.py b/homeassistant/components/melcloud/sensor.py index f9fdfa3a161..3d407b0916b 100644 --- a/homeassistant/components/melcloud/sensor.py +++ b/homeassistant/components/melcloud/sensor.py @@ -57,6 +57,15 @@ ATA_SENSORS: tuple[MelcloudSensorEntityDescription, ...] = ( value_fn=lambda x: x.device.total_energy_consumed, 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, ...] = ( MelcloudSensorEntityDescription( @@ -77,6 +86,15 @@ ATW_SENSORS: tuple[MelcloudSensorEntityDescription, ...] = ( value_fn=lambda x: x.device.tank_temperature, 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, ...] = ( MelcloudSensorEntityDescription( diff --git a/requirements_all.txt b/requirements_all.txt index ec747177b0d..cf31d39f2db 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1703,7 +1703,7 @@ pymazda==0.3.7 pymediaroom==0.6.5.4 # homeassistant.components.melcloud -pymelcloud==2.5.6 +pymelcloud==2.5.8 # homeassistant.components.meteoclimatic pymeteoclimatic==0.0.6 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index d7fd8a19edf..a9d0d35db66 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1198,7 +1198,7 @@ pymata-express==1.19 pymazda==0.3.7 # homeassistant.components.melcloud -pymelcloud==2.5.6 +pymelcloud==2.5.8 # homeassistant.components.meteoclimatic pymeteoclimatic==0.0.6