Strip whitespace from Nut "zero" serialno (#80141)

This commit is contained in:
ollo69
2022-10-12 10:04:48 +02:00
committed by GitHub
parent d71a9d6ab3
commit 75886d7213
2 changed files with 2 additions and 2 deletions

View File

@@ -148,7 +148,7 @@ def _serial_from_status(status: dict[str, str]) -> str | None:
"""Find the best serialvalue from the status."""
serial = status.get("device.serial") or status.get("ups.serial")
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 serial

View File

@@ -5,7 +5,7 @@
"driver.parameter.pollfreq": "30",
"ups.beeper.status": "disabled",
"input.voltage.nominal": "120",
"device.serial": "000000000000",
"device.serial": "000000000000 ",
"ups.timer.shutdown": "-60",
"input.voltage": "122.0",
"ups.status": "OL",