mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 02:07:09 +00:00
Add daily and monthly consumption sensors to the rympro integration (#137953)
This commit is contained in:
parent
98ab16cf99
commit
2bd9918ee8
@ -42,6 +42,12 @@ class RymProDataUpdateCoordinator(DataUpdateCoordinator[dict[int, dict]]):
|
|||||||
try:
|
try:
|
||||||
meters = await self.rympro.last_read()
|
meters = await self.rympro.last_read()
|
||||||
for meter_id, meter in meters.items():
|
for meter_id, meter in meters.items():
|
||||||
|
meter["monthly_consumption"] = await self.rympro.monthly_consumption(
|
||||||
|
meter_id
|
||||||
|
)
|
||||||
|
meter["daily_consumption"] = await self.rympro.daily_consumption(
|
||||||
|
meter_id
|
||||||
|
)
|
||||||
meter["consumption_forecast"] = await self.rympro.consumption_forecast(
|
meter["consumption_forecast"] = await self.rympro.consumption_forecast(
|
||||||
meter_id
|
meter_id
|
||||||
)
|
)
|
||||||
|
@ -36,6 +36,20 @@ SENSOR_DESCRIPTIONS: tuple[RymProSensorEntityDescription, ...] = (
|
|||||||
suggested_display_precision=3,
|
suggested_display_precision=3,
|
||||||
value_key="read",
|
value_key="read",
|
||||||
),
|
),
|
||||||
|
RymProSensorEntityDescription(
|
||||||
|
key="monthly_consumption",
|
||||||
|
translation_key="monthly_consumption",
|
||||||
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
|
suggested_display_precision=3,
|
||||||
|
value_key="monthly_consumption",
|
||||||
|
),
|
||||||
|
RymProSensorEntityDescription(
|
||||||
|
key="daily_consumption",
|
||||||
|
translation_key="daily_consumption",
|
||||||
|
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||||
|
suggested_display_precision=3,
|
||||||
|
value_key="daily_consumption",
|
||||||
|
),
|
||||||
RymProSensorEntityDescription(
|
RymProSensorEntityDescription(
|
||||||
key="monthly_forecast",
|
key="monthly_forecast",
|
||||||
translation_key="monthly_forecast",
|
translation_key="monthly_forecast",
|
||||||
|
@ -23,6 +23,12 @@
|
|||||||
"total_consumption": {
|
"total_consumption": {
|
||||||
"name": "Total consumption"
|
"name": "Total consumption"
|
||||||
},
|
},
|
||||||
|
"monthly_consumption": {
|
||||||
|
"name": "Monthly consumption"
|
||||||
|
},
|
||||||
|
"daily_consumption": {
|
||||||
|
"name": "Daily consumption"
|
||||||
|
},
|
||||||
"monthly_forecast": {
|
"monthly_forecast": {
|
||||||
"name": "Monthly forecast"
|
"name": "Monthly forecast"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user