Skip to content

Commit

Permalink
Add more debug logging and cleanup sensor device registration
Browse files Browse the repository at this point in the history
  • Loading branch information
sfstar committed Apr 30, 2024
1 parent 8adae6c commit 3df092b
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion custom_components/victron/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def __init__(self, coordinator: victronEnergyDeviceUpdateCoordinator, descriptio
self._attr_name = f"{description.name}"

#VE.CAN device zero is present under unit 100. This seperates non system / settings entities into the seperate can device
if description.slave == 100 and not description.key.startswith(("settings", "system")) :
if description.slave == 100 and not description.key.startswith("settings", "system") :
actual_id = 0
else:
actual_id = description.slave
Expand Down
2 changes: 1 addition & 1 deletion custom_components/victron/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def __init__(self, coordinator: victronEnergyDeviceUpdateCoordinator, descriptio
self._attr_name = f"{description.name}"

#VE.CAN device zero is present under unit 100. This seperates non system / settings entities into the seperate can device
if description.slave == 100 and not description.key.startswith(("settings", "system")) :
if description.slave == 100 and not description.key.startswith("settings", "system") :
actual_id = 0
else:
actual_id = description.slave
Expand Down
2 changes: 1 addition & 1 deletion custom_components/victron/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def __init__(self, coordinator: victronEnergyDeviceUpdateCoordinator, descriptio
self.data_key = str(self.description.slave) + "." + str(self.description.key)

#VE.CAN device zero is present under unit 100. This seperates non system / settings entities into the seperate can device
if description.slave == 100 and not description.key.startswith(("settings", "system")) :
if description.slave == 100 and not description.key.startswith("settings", "system") :
actual_id = 0
else:
actual_id = description.slave
Expand Down
2 changes: 1 addition & 1 deletion custom_components/victron/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def __init__(self, hass: HomeAssistant, coordinator: victronEnergyDeviceUpdateCo
self._attr_name = f"{description.name}"

#VE.CAN device zero is present under unit 100. This seperates non system / settings entities into the seperate can device
if description.slave == 100 and not description.key.startswith(("settings", "system")) :
if description.slave == 100 and not description.key.startswith("settings", "system") :
actual_id = 0
else:
actual_id = description.slave
Expand Down
6 changes: 3 additions & 3 deletions custom_components/victron/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ async def async_setup_entry(
for slave, registerLedger in register_set.items():
for name in registerLedger:
for register_name, registerInfo in register_info_dict[name].items():
# _LOGGER.debug("unit == " + str(slave) + " registerLedger == " + str(registerLedger) + " registerInfo ")
# _LOGGER.debug(str(registerInfo.slave))
_LOGGER.debug("unit == " + str(slave) + " registerLedger == " + str(registerLedger) + " registerInfo ")
_LOGGER.debug(str(registerInfo.slave))
if config_entry.options[CONF_ADVANCED_OPTIONS]:
if not isinstance(registerInfo.entityType, ReadEntityType) or isinstance(registerInfo.entityType, BoolReadEntityType):
continue
Expand Down Expand Up @@ -131,7 +131,7 @@ def __init__(self, coordinator: victronEnergyDeviceUpdateCoordinator, descriptio
self.entity_type = description.entity_type

#VE.CAN device zero is present under unit 100. This seperates non system / settings entities into the seperate can device
if description.slave == 100 and not description.key.startswith(("settings", "system")) :
if description.slave == 100 and not description.key.startswith("settings", "system") :
actual_id = 0
else:
actual_id = description.slave
Expand Down
2 changes: 1 addition & 1 deletion custom_components/victron/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def __init__(self, hass: HomeAssistant, coordinator: victronEnergyDeviceUpdateCo
self.data_key = str(self.description.slave) + "." + str(self.description.key)

#VE.CAN device zero is present under unit 100. This seperates non system / settings entities into the seperate can device
if description.slave == 100 and not description.key.startswith(("settings", "system")) :
if description.slave == 100 and not description.key.startswith("settings", "system") :
actual_id = 0
else:
actual_id = description.slave
Expand Down

0 comments on commit 3df092b

Please sign in to comment.