Skip to content

Commit

Permalink
fix: check on numeric cost, references #69 (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
geertmeersman authored Sep 14, 2023
2 parents bed530e + b95890e commit 9cd3baa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion custom_components/nexxtmove/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,9 @@ def fetch_data(self):
for charge in charge_latest.get("charges"):
if charge.get("cleared") is False:
non_invoiced_charges.append(charge)
non_invoiced_amount += charge.get("costVat")
cost = charge.get("costVat")
if isinstance(cost, int | float):
non_invoiced_amount += cost

key = format_entity_name(f"{self.username} non invoiced")
data[key] = NexxtmoveItem(
Expand Down

0 comments on commit 9cd3baa

Please sign in to comment.