Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion custom_components/victron/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ class microgrid_error(Enum):
230, UINT16, 1, entityType=ButtonWriteType()
),
"vebus_microgrid_error": RegisterInfo(
231, UINT16, TextReadEntityType(microgrid_error)
231, UINT16, entityType=TextReadEntityType(microgrid_error)
),
}

Expand Down
5 changes: 4 additions & 1 deletion custom_components/victron/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
ReadEntityType,
TextReadEntityType,
register_info_dict,
UINT16_MAX,
)
from .coordinator import victronEnergyDeviceUpdateCoordinator

Expand Down Expand Up @@ -181,7 +182,9 @@ def _handle_coordinator_update(self) -> None:
if self.entity_type is not None and isinstance(
self.entity_type, TextReadEntityType
):
if data in {item.value for item in self.entity_type.decodeEnum}:
if data in (UINT16_MAX, float(UINT16_MAX)):
self._attr_native_value = None
elif data in {item.value for item in self.entity_type.decodeEnum}:
self._attr_native_value = self.entity_type.decodeEnum(
data
).name.split("_DUPLICATE")[0]
Expand Down