Skip to content

Commit

Permalink
fix felaqua attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
benleb committed Sep 7, 2021
1 parent 69e88a2 commit d68d1c3
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,15 +205,12 @@ def state(self) -> float | None:

@property
def extra_state_attributes(self) -> dict[str, Any]:
"""Return the remaining water."""
"""Return additional attrs."""

attrs = {}

if (
state := cast(SureFelaqua, self._coordinator.data[self._id])
.raw_data()
.get("status")
):
if state := cast(SureFelaqua, self._coordinator.data[self._id]).raw_data():

for weight in state.get("drink", {}).get("weights", {}):
attr_key = f"weight_{weight['index']}"
attrs[attr_key] = weight
Expand Down

0 comments on commit d68d1c3

Please sign in to comment.