From f9a9477b6d47873b5bc20483eab72dd1a6bb49fd Mon Sep 17 00:00:00 2001 From: Christopher Fenner Date: Mon, 11 Dec 2023 08:37:42 +0100 Subject: [PATCH] add total gas consumption sensors --- homeassistant/components/vicare/sensor.py | 28 +++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/homeassistant/components/vicare/sensor.py b/homeassistant/components/vicare/sensor.py index f9f727b8647..848650a2e3a 100644 --- a/homeassistant/components/vicare/sensor.py +++ b/homeassistant/components/vicare/sensor.py @@ -235,6 +235,34 @@ GLOBAL_SENSORS: tuple[ViCareSensorEntityDescription, ...] = ( unit_getter=lambda api: api.getFuelCellGasConsumptionUnit(), state_class=SensorStateClass.TOTAL_INCREASING, ), + ViCareSensorEntityDescription( + key="gas_consumption_total_today", + translation_key="gas_consumption_total_today", + value_getter=lambda api: api.getGasConsumptionTotalToday(), + unit_getter=lambda api: api.getGasConsumptionUnit(), + state_class=SensorStateClass.TOTAL_INCREASING, + ), + ViCareSensorEntityDescription( + key="gas_consumption_total_this_week", + translation_key="gas_consumption_total_this_week", + value_getter=lambda api: api.getGasConsumptionTotalThisWeek(), + unit_getter=lambda api: api.getGasConsumptionUnit(), + state_class=SensorStateClass.TOTAL_INCREASING, + ), + ViCareSensorEntityDescription( + key="gas_consumption_total_this_month", + translation_key="gas_consumption_total_this_month", + value_getter=lambda api: api.getGasConsumptionTotalThisMonth(), + unit_getter=lambda api: api.getGasConsumptionUnit(), + state_class=SensorStateClass.TOTAL_INCREASING, + ), + ViCareSensorEntityDescription( + key="gas_consumption_total_this_year", + translation_key="gas_consumption_total_this_year", + value_getter=lambda api: api.getGasConsumptionTotalThisYear(), + unit_getter=lambda api: api.getGasConsumptionUnit(), + state_class=SensorStateClass.TOTAL_INCREASING, + ), ViCareSensorEntityDescription( key="gas_summary_consumption_heating_currentday", translation_key="gas_summary_consumption_heating_currentday",