Return alias as None for new discovery devices before update (#627)

* Trim the length of the unavailable device alias

* Update to use short mac as auth required alias

* Update to return alias as none
This commit is contained in:
Steven B
2024-01-11 15:12:02 +00:00
committed by GitHub
parent fd2170c82c
commit 5b8280a8d9
5 changed files with 11 additions and 13 deletions

View File

@@ -108,6 +108,8 @@ async def test_discover_single(discovery_mock, custom_port, mocker):
assert x._discovery_info is not None
assert x.port == custom_port or x.port == discovery_mock.default_port
assert update_mock.call_count == 0
if discovery_mock.default_port == 80:
assert x.alias is None
ct = ConnectionType.from_values(
discovery_mock.device_type,

View File

@@ -70,7 +70,7 @@ async def test_children_on_since(dev):
@strip
async def test_get_plug_by_name(dev: SmartStrip):
name = dev.children[0].alias
assert dev.get_plug_by_name(name) == dev.children[0]
assert dev.get_plug_by_name(name) == dev.children[0] # type: ignore[arg-type]
with pytest.raises(SmartDeviceException):
dev.get_plug_by_name("NONEXISTING NAME")