Skip to content

Commit

Permalink
change connection availability var to reflect actual state
Browse files Browse the repository at this point in the history
  • Loading branch information
sfstar committed Feb 28, 2025
1 parent 6f17a01 commit 46e2e59
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions custom_components/victron/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ async def _async_update_data(self) -> dict:
self.logger.debug(self.decodeInfo)

parsed_data = OrderedDict()
unavailable_entities = OrderedDict()
available_entities = OrderedDict()

if self.data is None:
self.data = {"data": OrderedDict(), "availability": OrderedDict()}
Expand All @@ -85,7 +85,7 @@ async def _async_update_data(self) -> dict:
for key in register_info_dict[name]:
full_key = str(unit) + "." + key
# self.data["data"][full_key] = None
unavailable_entities[full_key] = False
available_entities[full_key] = False

_LOGGER.warning(
"No valid data returned for entities of slave: %s (if the device continues to no longer update) check if the device was physically removed. Before opening an issue please force a rescan to attempt to resolve this issue",
Expand All @@ -102,12 +102,12 @@ async def _async_update_data(self) -> dict:
)
for key in register_info_dict[name]:
full_key = str(unit) + "." + key
unavailable_entities[full_key] = True
available_entities[full_key] = True

return {
"register_set": self.decodeInfo,
"data": parsed_data,
"availability": unavailable_entities,
"availability": available_entities,
}

def parse_register_data(
Expand Down

0 comments on commit 46e2e59

Please sign in to comment.