From c4bea5616cc6790c16b7d63fd119efe97dd0423e Mon Sep 17 00:00:00 2001 From: Yuxin Wang Date: Fri, 12 Sep 2025 13:09:46 -0400 Subject: [PATCH] Upgrade aioapcaccess to 1.0.0 (#151844) --- .../components/apcupsd/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- tests/components/apcupsd/__init__.py | 115 +++++++++--------- 4 files changed, 58 insertions(+), 63 deletions(-) diff --git a/homeassistant/components/apcupsd/manifest.json b/homeassistant/components/apcupsd/manifest.json index 65a1e7010cf..e0aff037d9e 100644 --- a/homeassistant/components/apcupsd/manifest.json +++ b/homeassistant/components/apcupsd/manifest.json @@ -7,5 +7,5 @@ "iot_class": "local_polling", "loggers": ["apcaccess"], "quality_scale": "platinum", - "requirements": ["aioapcaccess==0.4.2"] + "requirements": ["aioapcaccess==1.0.0"] } diff --git a/requirements_all.txt b/requirements_all.txt index cd29b2345e5..5f84d610b12 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -192,7 +192,7 @@ aioamazondevices==6.0.0 aioambient==2024.08.0 # homeassistant.components.apcupsd -aioapcaccess==0.4.2 +aioapcaccess==1.0.0 # homeassistant.components.aquacell aioaquacell==0.2.0 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 2778ab8af60..1f608db5cd2 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -180,7 +180,7 @@ aioamazondevices==6.0.0 aioambient==2024.08.0 # homeassistant.components.apcupsd -aioapcaccess==0.4.2 +aioapcaccess==1.0.0 # homeassistant.components.aquacell aioaquacell==0.2.0 diff --git a/tests/components/apcupsd/__init__.py b/tests/components/apcupsd/__init__.py index 0efeac0e45c..ac18d4e4277 100644 --- a/tests/components/apcupsd/__init__.py +++ b/tests/components/apcupsd/__init__.py @@ -2,73 +2,68 @@ from __future__ import annotations -from collections import OrderedDict from typing import Final from homeassistant.const import CONF_HOST, CONF_PORT CONF_DATA: Final = {CONF_HOST: "test", CONF_PORT: 1234} -MOCK_STATUS: Final = OrderedDict( - [ - ("APC", "001,038,0985"), - ("DATE", "1970-01-01 00:00:00 0000"), - ("VERSION", "3.14.14 (31 May 2016) unknown"), - ("CABLE", "USB Cable"), - ("DRIVER", "USB UPS Driver"), - ("UPSMODE", "Stand Alone"), - ("UPSNAME", "MyUPS"), - ("MODEL", "Back-UPS ES 600"), - ("STATUS", "ONLINE"), - ("LINEV", "124.0 Volts"), - ("LOADPCT", "14.0 Percent"), - ("BCHARGE", "100.0 Percent"), - ("TIMELEFT", "51.0 Minutes"), - ("NOMAPNT", "60.0 VA"), - ("ITEMP", "34.6 C Internal"), - ("MBATTCHG", "5 Percent"), - ("MINTIMEL", "3 Minutes"), - ("MAXTIME", "0 Seconds"), - ("SENSE", "Medium"), - ("LOTRANS", "92.0 Volts"), - ("HITRANS", "139.0 Volts"), - ("ALARMDEL", "30 Seconds"), - ("BATTV", "13.7 Volts"), - ("OUTCURNT", "0.88 Amps"), - ("LASTXFER", "Automatic or explicit self test"), - ("NUMXFERS", "1"), - ("XONBATT", "1970-01-01 00:00:00 0000"), - ("TONBATT", "0 Seconds"), - ("CUMONBATT", "8 Seconds"), - ("XOFFBATT", "1970-01-01 00:00:00 0000"), - ("LASTSTEST", "1970-01-01 00:00:00 0000"), - ("SELFTEST", "NO"), - ("STESTI", "7 days"), - ("STATFLAG", "0x05000008"), - ("SERIALNO", "XXXXXXXXXXXX"), - ("BATTDATE", "1970-01-01"), - ("NOMINV", "120 Volts"), - ("NOMBATTV", "12.0 Volts"), - ("NOMPOWER", "330 Watts"), - ("FIRMWARE", "928.a8 .D USB FW:a8"), - ("END APC", "1970-01-01 00:00:00 0000"), - ] -) +MOCK_STATUS: Final = { + "APC": "001,038,0985", + "DATE": "1970-01-01 00:00:00 0000", + "VERSION": "3.14.14 (31 May 2016) unknown", + "CABLE": "USB Cable", + "DRIVER": "USB UPS Driver", + "UPSMODE": "Stand Alone", + "UPSNAME": "MyUPS", + "MODEL": "Back-UPS ES 600", + "STATUS": "ONLINE", + "LINEV": "124.0 Volts", + "LOADPCT": "14.0 Percent", + "BCHARGE": "100.0 Percent", + "TIMELEFT": "51.0 Minutes", + "NOMAPNT": "60.0 VA", + "ITEMP": "34.6 C Internal", + "MBATTCHG": "5 Percent", + "MINTIMEL": "3 Minutes", + "MAXTIME": "0 Seconds", + "SENSE": "Medium", + "LOTRANS": "92.0 Volts", + "HITRANS": "139.0 Volts", + "ALARMDEL": "30 Seconds", + "BATTV": "13.7 Volts", + "OUTCURNT": "0.88 Amps", + "LASTXFER": "Automatic or explicit self test", + "NUMXFERS": "1", + "XONBATT": "1970-01-01 00:00:00 0000", + "TONBATT": "0 Seconds", + "CUMONBATT": "8 Seconds", + "XOFFBATT": "1970-01-01 00:00:00 0000", + "LASTSTEST": "1970-01-01 00:00:00 0000", + "SELFTEST": "NO", + "STESTI": "7 days", + "STATFLAG": "0x05000008", + "SERIALNO": "XXXXXXXXXXXX", + "BATTDATE": "1970-01-01", + "NOMINV": "120 Volts", + "NOMBATTV": "12.0 Volts", + "NOMPOWER": "330 Watts", + "FIRMWARE": "928.a8 .D USB FW:a8", + "END APC": "1970-01-01 00:00:00 0000", +} # Minimal status adapted from http://www.apcupsd.org/manual/manual.html#apcaccess-test. # Most importantly, the "MODEL" and "SERIALNO" fields are removed to test the ability # of the integration to handle such cases. -MOCK_MINIMAL_STATUS: Final = OrderedDict( - [ - ("APC", "001,012,0319"), - ("DATE", "1970-01-01 00:00:00 0000"), - ("RELEASE", "3.8.5"), - ("CABLE", "APC Cable 940-0128A"), - ("UPSMODE", "Stand Alone"), - ("STARTTIME", "1970-01-01 00:00:00 0000"), - ("LINEFAIL", "OK"), - ("BATTSTAT", "OK"), - ("STATFLAG", "0x008"), - ("END APC", "1970-01-01 00:00:00 0000"), - ] -) +MOCK_MINIMAL_STATUS: Final = { + "APC": "001,012,0319", + "DATE": "1970-01-01 00:00:00 0000", + "RELEASE": "3.8.5", + "CABLE": "APC Cable 940-0128A", + "UPSMODE": "Stand Alone", + "STARTTIME": "1970-01-01 00:00:00 0000", + "LINEFAIL": "OK", + "BATTSTAT": "OK", + "STATFLAG": "0x008", + "END APC": "1970-01-01 00:00:00 0000", +}