feat(python): allow exporting unit serial number

[no changelog]
This commit is contained in:
Roman Zeyde
2025-10-03 13:27:06 +02:00
committed by Roman Zeyde
parent cb23774065
commit a7fe6b8977
5 changed files with 65 additions and 0 deletions

View File

@@ -473,3 +473,10 @@ def authenticate(
except authentication.DeviceNotAuthentic:
click.echo("Device is not authentic.")
sys.exit(5)
@cli.command()
@with_session(seedless=True)
def serial_number(session: "Session") -> str:
"""Get serial number."""
return device.get_serial_number(session)

View File

@@ -650,3 +650,8 @@ def authenticate(session: "Session", challenge: bytes) -> messages.AuthenticityP
def set_brightness(session: "Session", value: Optional[int] = None) -> str | None:
ret = session.call(messages.SetBrightness(value=value), expect=messages.Success)
return _return_success(ret)
def get_serial_number(session: "Session") -> str:
ret = session.call(messages.GetSerialNumber(), expect=messages.SerialNumber)
return ret.serial_number