mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Add photovoltaic sensors to ViCare integration (#113664)
* Add photovoltaic sensors * Update strings.json * Apply suggestions from code review * change uom for daily sensor
This commit is contained in:
parent
78c7af40ed
commit
539b9d76fc
@ -694,10 +694,50 @@ GLOBAL_SENSORS: tuple[ViCareSensorEntityDescription, ...] = (
|
||||
key="photovoltaic_energy_production_today",
|
||||
translation_key="photovoltaic_energy_production_today",
|
||||
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
|
||||
suggested_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||
value_getter=lambda api: api.getPhotovoltaicProductionCumulatedCurrentDay(),
|
||||
unit_getter=lambda api: api.getPhotovoltaicProductionCumulatedUnit(),
|
||||
),
|
||||
ViCareSensorEntityDescription(
|
||||
key="photovoltaic_energy_production_this_week",
|
||||
translation_key="photovoltaic_energy_production_this_week",
|
||||
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
|
||||
suggested_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||
value_getter=lambda api: api.getPhotovoltaicProductionCumulatedCurrentWeek(),
|
||||
unit_getter=lambda api: api.getPhotovoltaicProductionCumulatedUnit(),
|
||||
entity_registry_enabled_default=False,
|
||||
),
|
||||
ViCareSensorEntityDescription(
|
||||
key="photovoltaic_energy_production_this_month",
|
||||
translation_key="photovoltaic_energy_production_this_month",
|
||||
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
|
||||
suggested_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||
value_getter=lambda api: api.getPhotovoltaicProductionCumulatedCurrentMonth(),
|
||||
unit_getter=lambda api: api.getPhotovoltaicProductionCumulatedUnit(),
|
||||
entity_registry_enabled_default=False,
|
||||
),
|
||||
ViCareSensorEntityDescription(
|
||||
key="photovoltaic_energy_production_this_year",
|
||||
translation_key="photovoltaic_energy_production_this_year",
|
||||
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
|
||||
suggested_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||
value_getter=lambda api: api.getPhotovoltaicProductionCumulatedCurrentYear(),
|
||||
unit_getter=lambda api: api.getPhotovoltaicProductionCumulatedUnit(),
|
||||
entity_registry_enabled_default=False,
|
||||
),
|
||||
ViCareSensorEntityDescription(
|
||||
key="photovoltaic_energy_production_total",
|
||||
translation_key="photovoltaic_energy_production_total",
|
||||
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
|
||||
suggested_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||
value_getter=lambda api: api.getPhotovoltaicProductionCumulatedLifeCycle(),
|
||||
unit_getter=lambda api: api.getPhotovoltaicProductionCumulatedUnit(),
|
||||
),
|
||||
ViCareSensorEntityDescription(
|
||||
key="photovoltaic_status",
|
||||
translation_key="photovoltaic_status",
|
||||
|
@ -319,6 +319,18 @@
|
||||
"photovoltaic_energy_production_today": {
|
||||
"name": "Solar energy production today"
|
||||
},
|
||||
"photovoltaic_energy_production_this_week": {
|
||||
"name": "Solar energy production this week"
|
||||
},
|
||||
"photovoltaic_energy_production_this_month": {
|
||||
"name": "Solar energy production this month"
|
||||
},
|
||||
"photovoltaic_energy_production_this_year": {
|
||||
"name": "Solar energy production this year"
|
||||
},
|
||||
"photovoltaic_energy_production_total": {
|
||||
"name": "Solar energy production total"
|
||||
},
|
||||
"photovoltaic_status": {
|
||||
"name": "Solar state",
|
||||
"state": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user