Skip to content

Commit

Permalink
expense values to positive numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
sanghviharshit committed Jan 30, 2024
1 parent 0236551 commit 00ebe0d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/monarchmoney/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,14 +460,14 @@ def _handle_coordinator_update(self) -> None:
cashflow = update_data.get("cashflow")
for c in cashflow.get("byCategory"):
if c.get("groupBy").get("category").get("group").get("type") == "expense":
expense_cats[c.get("groupBy").get("category").get("name")] += c.get(
expense_cats[c.get("groupBy").get("category").get("name")] += -1 * c.get(
"summary"
).get("sum")


c = cashflow.get("summary")[0]

self._state = c.get("summary").get("sumExpense")
self._state = -1 * c.get("summary").get("sumExpense")
self._expense_cats = expense_cats

self.async_write_ha_state()
Expand Down

0 comments on commit 00ebe0d

Please sign in to comment.