Add fuelcell gas consumption sensors to ViCare integration (#105461)

* add fuel cell gas consumption sensors

* add total gas consumption sensors

* add uom

* Update strings.json

* reorder

* Revert "reorder"

This reverts commit 0bcaa3b4e61eaa852228b1e6e5ae8302843f92a7.

* Revert "add uom"

This reverts commit b3c0dc47563e79ee30c730ba0f6e99cb5e5004af.

* Update sensor.py
This commit is contained in:
Christopher Fenner 2024-01-31 13:23:51 +01:00 committed by GitHub
parent a61b18155b
commit 2f312f56f6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 86 additions and 0 deletions

View File

@ -210,6 +210,68 @@ GLOBAL_SENSORS: tuple[ViCareSensorEntityDescription, ...] = (
unit_getter=lambda api: api.getGasConsumptionHeatingUnit(),
state_class=SensorStateClass.TOTAL_INCREASING,
),
ViCareSensorEntityDescription(
key="gas_consumption_fuelcell_today",
translation_key="gas_consumption_fuelcell_today",
value_getter=lambda api: api.getFuelCellGasConsumptionToday(),
unit_getter=lambda api: api.getFuelCellGasConsumptionUnit(),
state_class=SensorStateClass.TOTAL_INCREASING,
),
ViCareSensorEntityDescription(
key="gas_consumption_fuelcell_this_week",
translation_key="gas_consumption_fuelcell_this_week",
value_getter=lambda api: api.getFuelCellGasConsumptionThisWeek(),
unit_getter=lambda api: api.getFuelCellGasConsumptionUnit(),
state_class=SensorStateClass.TOTAL_INCREASING,
entity_registry_enabled_default=False,
),
ViCareSensorEntityDescription(
key="gas_consumption_fuelcell_this_month",
translation_key="gas_consumption_fuelcell_this_month",
value_getter=lambda api: api.getFuelCellGasConsumptionThisMonth(),
unit_getter=lambda api: api.getFuelCellGasConsumptionUnit(),
state_class=SensorStateClass.TOTAL_INCREASING,
entity_registry_enabled_default=False,
),
ViCareSensorEntityDescription(
key="gas_consumption_fuelcell_this_year",
translation_key="gas_consumption_fuelcell_this_year",
value_getter=lambda api: api.getFuelCellGasConsumptionThisYear(),
unit_getter=lambda api: api.getFuelCellGasConsumptionUnit(),
state_class=SensorStateClass.TOTAL_INCREASING,
entity_registry_enabled_default=False,
),
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,
entity_registry_enabled_default=False,
),
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,
entity_registry_enabled_default=False,
),
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,
entity_registry_enabled_default=False,
),
ViCareSensorEntityDescription(
key="gas_summary_consumption_heating_currentday",
translation_key="gas_summary_consumption_heating_currentday",

View File

@ -140,6 +140,30 @@
"gas_consumption_heating_this_year": {
"name": "Heating gas consumption this year"
},
"gas_consumption_fuelcell_today": {
"name": "Fuel cell gas consumption today"
},
"gas_consumption_fuelcell_this_week": {
"name": "Fuel cell gas consumption this week"
},
"gas_consumption_fuelcell_this_month": {
"name": "Fuel cell gas consumption this month"
},
"gas_consumption_fuelcell_this_year": {
"name": "Fuel cell gas consumption this year"
},
"gas_consumption_total_today": {
"name": "Gas consumption today"
},
"gas_consumption_total_this_week": {
"name": "Gas consumption this week"
},
"gas_consumption_total_this_month": {
"name": "Gas consumption this month"
},
"gas_consumption_total_this_year": {
"name": "Gas consumption this year"
},
"gas_summary_consumption_heating_currentday": {
"name": "Heating gas consumption today"
},