Fix test framework running against real devices (#1235)

This commit is contained in:
Steven B.
2024-11-11 17:41:31 +00:00
committed by GitHub
parent 32671da9e9
commit 71ae06fa83
18 changed files with 158 additions and 43 deletions

View File

@@ -492,6 +492,17 @@ class SmartDevice(Device):
"""Returns the device model."""
return str(self._info.get("model"))
@property
def _model_region(self) -> str:
"""Return device full model name and region."""
if (disco := self._discovery_info) and (
disco_model := disco.get("device_model")
):
return disco_model
# Some devices have the region in the specs element.
region = f"({specs})" if (specs := self._info.get("specs")) else ""
return f"{self.model}{region}"
@property
def alias(self) -> str | None:
"""Returns the device alias or nickname."""