Skip to content

Commit

Permalink
Add daily and monthly consumption sensors to the rympro integration (h…
Browse files Browse the repository at this point in the history
  • Loading branch information
nivstein authored Feb 21, 2025
1 parent 98ab16c commit 2bd9918
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
6 changes: 6 additions & 0 deletions homeassistant/components/rympro/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ async def _async_update_data(self) -> dict[int, dict]:
try:
meters = await self.rympro.last_read()
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_id
)
Expand Down
14 changes: 14 additions & 0 deletions homeassistant/components/rympro/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,20 @@ class RymProSensorEntityDescription(SensorEntityDescription):
suggested_display_precision=3,
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(
key="monthly_forecast",
translation_key="monthly_forecast",
Expand Down
6 changes: 6 additions & 0 deletions homeassistant/components/rympro/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
"total_consumption": {
"name": "Total consumption"
},
"monthly_consumption": {
"name": "Monthly consumption"
},
"daily_consumption": {
"name": "Daily consumption"
},
"monthly_forecast": {
"name": "Monthly forecast"
}
Expand Down

0 comments on commit 2bd9918

Please sign in to comment.