mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-28 19:46:29 +00:00
Expose machine ID (#5953)
Expose the unique machine ID of the local system via the Supervisor API. This allows to identify a particular machine across reboots, backup restores and updates. The machine ID is a stable identifier that does not change unless the underlying hardware is changed or the operating system is reinstalled.
This commit is contained in:
parent
0e8ace949a
commit
3d026b9534
@ -17,6 +17,7 @@ from ..const import (
|
||||
ATTR_ICON,
|
||||
ATTR_LOGGING,
|
||||
ATTR_MACHINE,
|
||||
ATTR_MACHINE_ID,
|
||||
ATTR_NAME,
|
||||
ATTR_OPERATING_SYSTEM,
|
||||
ATTR_STATE,
|
||||
@ -48,6 +49,7 @@ class APIRoot(CoreSysAttributes):
|
||||
ATTR_OPERATING_SYSTEM: self.sys_host.info.operating_system,
|
||||
ATTR_FEATURES: self.sys_host.features,
|
||||
ATTR_MACHINE: self.sys_machine,
|
||||
ATTR_MACHINE_ID: self.sys_machine_id,
|
||||
ATTR_ARCH: self.sys_arch.default,
|
||||
ATTR_STATE: self.sys_core.state,
|
||||
ATTR_SUPPORTED_ARCH: self.sys_arch.supported,
|
||||
|
@ -246,6 +246,7 @@ ATTR_LOGO = "logo"
|
||||
ATTR_LONG_DESCRIPTION = "long_description"
|
||||
ATTR_MAC = "mac"
|
||||
ATTR_MACHINE = "machine"
|
||||
ATTR_MACHINE_ID = "machine_id"
|
||||
ATTR_MAINTAINER = "maintainer"
|
||||
ATTR_MAP = "map"
|
||||
ATTR_MEMORY_LIMIT = "memory_limit"
|
||||
|
@ -673,7 +673,7 @@ class CoreSysAttributes:
|
||||
|
||||
@property
|
||||
def sys_machine_id(self) -> str | None:
|
||||
"""Return machine id."""
|
||||
"""Return machine ID."""
|
||||
return self.coresys.machine_id
|
||||
|
||||
@property
|
||||
|
Loading…
x
Reference in New Issue
Block a user