mirror of
https://github.com/home-assistant/core.git
synced 2025-12-26 14:08:21 +00:00
Add explicit support for Luxembourg Smarty meter in dsmr integration (#43975)
* Add support for Luxembourg Smarty meter * Add config flow test * Add sensor tests
This commit is contained in:
@@ -242,3 +242,26 @@ async def test_options_flow(hass):
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert entry.options == {"time_between_update": 15}
|
||||
|
||||
|
||||
async def test_import_luxembourg(hass, dsmr_connection_send_validate_fixture):
|
||||
"""Test we can import."""
|
||||
await setup.async_setup_component(hass, "persistent_notification", {})
|
||||
|
||||
entry_data = {
|
||||
"port": "/dev/ttyUSB0",
|
||||
"dsmr_version": "5L",
|
||||
"precision": 4,
|
||||
"reconnect_interval": 30,
|
||||
}
|
||||
|
||||
with patch("homeassistant.components.dsmr.async_setup_entry", return_value=True):
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN,
|
||||
context={"source": config_entries.SOURCE_IMPORT},
|
||||
data=entry_data,
|
||||
)
|
||||
|
||||
assert result["type"] == "create_entry"
|
||||
assert result["title"] == "/dev/ttyUSB0"
|
||||
assert result["data"] == {**entry_data, **SERIAL_DATA}
|
||||
|
||||
Reference in New Issue
Block a user