mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Add configuration url to Tasmota (#57957)
This commit is contained in:
parent
1e98761f30
commit
786e1f9b6a
@ -5,6 +5,7 @@ import asyncio
|
||||
import logging
|
||||
|
||||
from hatasmota.const import (
|
||||
CONF_IP,
|
||||
CONF_MAC,
|
||||
CONF_MANUFACTURER,
|
||||
CONF_MODEL,
|
||||
@ -165,12 +166,13 @@ def _update_device(
|
||||
"""Add or update device registry."""
|
||||
_LOGGER.debug("Adding or updating tasmota device %s", config[CONF_MAC])
|
||||
device_registry.async_get_or_create(
|
||||
config_entry_id=config_entry.entry_id,
|
||||
configuration_url=f"http://{config[CONF_IP]}/",
|
||||
connections={(CONNECTION_NETWORK_MAC, config[CONF_MAC])},
|
||||
manufacturer=config[CONF_MANUFACTURER],
|
||||
model=config[CONF_MODEL],
|
||||
name=config[CONF_NAME],
|
||||
sw_version=config[CONF_SW_VERSION],
|
||||
config_entry_id=config_entry.entry_id,
|
||||
)
|
||||
|
||||
|
||||
|
@ -150,6 +150,7 @@ async def test_device_discover(
|
||||
set(), {(dr.CONNECTION_NETWORK_MAC, mac)}
|
||||
)
|
||||
assert device_entry is not None
|
||||
assert device_entry.configuration_url == f"http://{config['ip']}/"
|
||||
assert device_entry.manufacturer == "Tasmota"
|
||||
assert device_entry.model == config["md"]
|
||||
assert device_entry.name == config["dn"]
|
||||
|
Loading…
x
Reference in New Issue
Block a user