Skip to content

Commit

Permalink
fix ads extra
Browse files Browse the repository at this point in the history
  • Loading branch information
hekmon committed Nov 20, 2023
1 parent d85605c commit ab1e730
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions custom_components/linkytic/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1374,6 +1374,7 @@ def update(self):
# Handle entity availability
if value is None:
if self._attr_available:
self._extra = {}
if not self._serial_controller.is_connected():
_LOGGER.debug(
"%s: marking the %s sensor as unavailable: serial connection lost",
Expand Down
3 changes: 1 addition & 2 deletions custom_components/linkytic/serial_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,6 @@ def parse_ads(self, ads):
len(ads),
ads,
)
self._extra = {}
return
# let's parse ADS as EURIDIS
device_identification = {DID_YEAR: ads[2:4], DID_REGNUMBER: ads[6:]}
Expand Down Expand Up @@ -408,7 +407,7 @@ def parse_ads(self, ads):
# # Update device infos
self.device_identification = device_identification
# Parsing done
_LOGGER.debug("%s: parsed ADS: %s", self._title, repr(self._extra))
_LOGGER.debug("%s: parsed ADS: %s", self._title, repr(self.device_identification))


class InvalidChecksum(Exception):
Expand Down

0 comments on commit ab1e730

Please sign in to comment.