Skip to content

Commit

Permalink
fix: Fixed issue with accumulative cost sensors when used in the ener…
Browse files Browse the repository at this point in the history
…gy dashboard

This might take up to 24 hours for the fix to reflect
  • Loading branch information
BottlecapDave committed Aug 8, 2023
1 parent 34e93ac commit 3db7228
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

from homeassistant.core import HomeAssistant

from homeassistant.util.dt import (now)

from homeassistant.helpers.update_coordinator import (
CoordinatorEntity,
)
Expand Down Expand Up @@ -108,7 +106,7 @@ async def async_update(self):

if (consumption_and_cost is not None):
_LOGGER.debug(f"Calculated current electricity consumption cost for '{self._mpan}/{self._serial_number}'...")
self._last_reset = now()
self._last_reset = consumption_and_cost["last_reset"]
self._state = consumption_and_cost["total_cost"]

self._attributes = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from datetime import datetime

from homeassistant.core import HomeAssistant
from homeassistant.util.dt import (now)

from homeassistant.helpers.update_coordinator import (
CoordinatorEntity,
Expand Down Expand Up @@ -112,7 +111,7 @@ async def async_update(self):

if (consumption_and_cost is not None):
_LOGGER.debug(f"Calculated current gas consumption cost for '{self._mprn}/{self._serial_number}'...")
self._last_reset = now()
self._last_reset = consumption_and_cost["last_reset"]
self._state = consumption_and_cost["total_cost"]

self._attributes = {
Expand Down

0 comments on commit 3db7228

Please sign in to comment.