Skip to content

Commit 2cb6944

Browse files
committed
Fix excluded devices and add testing
1 parent 3dfdecc commit 2cb6944

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

custom_components/victron_mqtt/hub.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def __init__(self, hass: HomeAssistant, entry: ConfigEntry) -> None:
7575
excluded_device_types: list[DeviceType] = [
7676
dt
7777
for device_string in excluded_device_strings
78-
if (dt := DeviceType.from_device_code(device_string)) is not None
78+
if (dt := DeviceType.from_code(device_string)) is not None
7979
]
8080

8181
_LOGGER.info(

custom_components/victron_mqtt/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@
1818
"X_MqttOnLan": "1"
1919
}
2020
],
21-
"version": "2026.1.4"
21+
"version": "2026.1.5"
2222
}

tests/test_hub.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from victron_mqtt.testing import create_mocked_hub, finalize_injection, inject_message
1313

1414
from custom_components.victron_mqtt.const import (
15+
CONF_EXCLUDED_DEVICES,
1516
CONF_INSTALLATION_ID,
1617
CONF_MODEL,
1718
CONF_ROOT_TOPIC_PREFIX,
@@ -51,7 +52,8 @@ def basic_config(request):
5152
CONF_SERIAL: "HQ12345678",
5253
CONF_ROOT_TOPIC_PREFIX: "N/",
5354
CONF_UPDATE_FREQUENCY_SECONDS: 30,
54-
CONF_SIMPLE_NAMING: request.param
55+
CONF_SIMPLE_NAMING: request.param,
56+
CONF_EXCLUDED_DEVICES: ["battery"], # Exclude battery devices
5557
}
5658

5759

0 commit comments

Comments
 (0)