mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 15:17:35 +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
|
import logging
|
||||||
|
|
||||||
from hatasmota.const import (
|
from hatasmota.const import (
|
||||||
|
CONF_IP,
|
||||||
CONF_MAC,
|
CONF_MAC,
|
||||||
CONF_MANUFACTURER,
|
CONF_MANUFACTURER,
|
||||||
CONF_MODEL,
|
CONF_MODEL,
|
||||||
@ -165,12 +166,13 @@ def _update_device(
|
|||||||
"""Add or update device registry."""
|
"""Add or update device registry."""
|
||||||
_LOGGER.debug("Adding or updating tasmota device %s", config[CONF_MAC])
|
_LOGGER.debug("Adding or updating tasmota device %s", config[CONF_MAC])
|
||||||
device_registry.async_get_or_create(
|
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])},
|
connections={(CONNECTION_NETWORK_MAC, config[CONF_MAC])},
|
||||||
manufacturer=config[CONF_MANUFACTURER],
|
manufacturer=config[CONF_MANUFACTURER],
|
||||||
model=config[CONF_MODEL],
|
model=config[CONF_MODEL],
|
||||||
name=config[CONF_NAME],
|
name=config[CONF_NAME],
|
||||||
sw_version=config[CONF_SW_VERSION],
|
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)}
|
set(), {(dr.CONNECTION_NETWORK_MAC, mac)}
|
||||||
)
|
)
|
||||||
assert device_entry is not None
|
assert device_entry is not None
|
||||||
|
assert device_entry.configuration_url == f"http://{config['ip']}/"
|
||||||
assert device_entry.manufacturer == "Tasmota"
|
assert device_entry.manufacturer == "Tasmota"
|
||||||
assert device_entry.model == config["md"]
|
assert device_entry.model == config["md"]
|
||||||
assert device_entry.name == config["dn"]
|
assert device_entry.name == config["dn"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user