mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 09:47:52 +00:00
Fix velbus via devices (#135986)
This commit is contained in:
parent
ec45cb4939
commit
4612f4da19
@ -58,6 +58,21 @@ async def velbus_scan_task(
|
||||
raise PlatformNotReady(
|
||||
f"Connection error while connecting to Velbus {entry_id}: {ex}"
|
||||
) from ex
|
||||
# create all modules
|
||||
dev_reg = dr.async_get(hass)
|
||||
for module in controller.get_modules().values():
|
||||
dev_reg.async_get_or_create(
|
||||
config_entry_id=entry_id,
|
||||
identifiers={
|
||||
(DOMAIN, str(module.get_addresses()[0])),
|
||||
},
|
||||
manufacturer="Velleman",
|
||||
model=module.get_type_name(),
|
||||
model_id=str(module.get_type()),
|
||||
name=f"{module.get_name()} ({module.get_type_name()})",
|
||||
sw_version=module.get_sw_version(),
|
||||
serial_number=module.get_serial(),
|
||||
)
|
||||
|
||||
|
||||
def _migrate_device_identifiers(hass: HomeAssistant, entry_id: str) -> None:
|
||||
|
@ -96,7 +96,7 @@ def mock_module_subdevices() -> AsyncMock:
|
||||
"""Mock a velbus module."""
|
||||
module = AsyncMock(spec=Module)
|
||||
module.get_type_name.return_value = "VMB2BLE"
|
||||
module.get_addresses.return_value = [99]
|
||||
module.get_addresses.return_value = [88]
|
||||
module.get_name.return_value = "Kitchen"
|
||||
module.get_sw_version.return_value = "2.0.0"
|
||||
module.is_loaded.return_value = True
|
||||
|
@ -79,7 +79,7 @@
|
||||
}),
|
||||
dict({
|
||||
'address': list([
|
||||
99,
|
||||
88,
|
||||
]),
|
||||
'channels': dict({
|
||||
}),
|
||||
|
Loading…
x
Reference in New Issue
Block a user