mirror of
https://github.com/home-assistant/core.git
synced 2025-08-16 19:11:42 +02:00
Strip whitespace from Nut "zero" serialno (#80141)
This commit is contained in:
@@ -148,7 +148,7 @@ def _serial_from_status(status: dict[str, str]) -> str | None:
|
|||||||
"""Find the best serialvalue from the status."""
|
"""Find the best serialvalue from the status."""
|
||||||
serial = status.get("device.serial") or status.get("ups.serial")
|
serial = status.get("device.serial") or status.get("ups.serial")
|
||||||
if serial and (
|
if serial and (
|
||||||
serial.lower() in NUT_FAKE_SERIAL or serial.count("0") == len(serial)
|
serial.lower() in NUT_FAKE_SERIAL or serial.count("0") == len(serial.strip())
|
||||||
):
|
):
|
||||||
return None
|
return None
|
||||||
return serial
|
return serial
|
||||||
|
Reference in New Issue
Block a user