Commit Graph
67 Commits
Author SHA1 Message Date
Erik MontnemeryandGitHub 201ac314a4 Align DeviceRegistryEntrySnapshot with the device registry model (#176654) 2026-07-17 09:39:13 +02:00
epenetandGitHub 0c4bc95bdd Migrate base entity attributes to StrEnum (#174633) 2026-06-24 15:38:49 +01:00
epenetandGitHub f9bf7ab122 Migrate sensor entity attributes to StrEnum (#174595) 2026-06-24 09:05:32 +02:00
MichaelandGitHub e19601f991 Remove deprecated APCUPSD sensors (#172280) 2026-05-27 00:17:42 +02:00
5472a537ed Replace unused mock_setup_entry arguments with @pytest.mark.usefixtures (#170760)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-16 11:02:36 +02:00
Franck NijhofandGitHub a9207988f5 Fix line length violations in tests/components a (#170806) 2026-05-15 13:07:01 -04:00
epenetandGitHub 88525955ce Remove import annotations from tests (#169527) 2026-04-30 09:30:46 +02:00
Artur PragaczandGitHub bafef2065f Rework user-given entity name logic (#162763) 2026-03-17 11:09:20 +01:00
epenetandGitHub fd3258a6d3 Use constants for update_entity calls in tests (#162920) 2026-02-13 13:54:40 +01:00
Yuxin WangandGitHub 5fa4f6de11 Mark datetime sensors as unknown when parsing fails (#161952) 2026-02-01 17:41:01 +01:00
Artur PragaczandGitHub 0130919128 Improve entity id generation (#160302) 2026-01-14 14:34:52 +01:00
Yuxin WangandGitHub 0b5d6ee538 Add TIMESTAMP device classes to corresponding sensors in APCUPSD (#160577) 2026-01-12 17:10:25 +01:00
Yuxin WangandGitHub b8e3d57fea Deprecate useless sensors in APCUPSD integration (#151525) 2025-11-18 17:09:38 +01:00
Yuxin WangandGitHub a494d3ec69 Sort the resources for deterministic sensor addition order in APCUPSD (#152467) 2025-09-17 10:41:19 +02:00
Yuxin WangandGitHub 82b57568a0 Set diagnostic entity category for "mode" in APCUPSD (#152246) 2025-09-13 18:38:47 +02:00
Yuxin WangandGitHub c4bea5616c Upgrade aioapcaccess to 1.0.0 (#151844) 2025-09-12 19:09:46 +02:00
Yuxin WangandGitHub f051f4ea99 Add more test logic to APCUPSD (#151336) 2025-09-01 13:15:11 +02:00
Yuxin WangandGitHub 010a8cc693 Attach serial_number to devices in APC UPS Daemon (#151421) 2025-08-30 18:20:46 +02:00
ffcd5167b5 Use fixtures instead of helper functions for APCUPSD tests (#151172)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2025-08-28 16:11:31 +02:00
Yuxin WangandGitHub 0786e333ce Remove tests for setting up multiple integrations for APCUPSD (#151125) 2025-08-25 10:33:00 +02:00
Yuxin WangandGitHub 2d69d2ef1c Remove unnecessary tests for APCUPSD (#151126) 2025-08-25 07:00:13 +02:00
Yuxin WangandGitHub f44578f45f Add more exception types for cannot_connect test in APCUPSD (#150830) 2025-08-18 07:19:47 +02:00
Yuxin WangandGitHub 79cfea3fea Use mock_setup_entry fixture for APCUPSD (#150392) 2025-08-10 21:35:47 +02:00
bf33e286d6 Add recovery test logic for connection failure for APCUPSD (#150382)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2025-08-10 20:32:25 +02:00
Yuxin WangandGitHub c678bcd4f1 Split test_config_flow_duplicate tests into two separate ones for APCUPSD (#150379) 2025-08-10 17:35:48 +02:00
Yuxin WangandGitHub 2c36a74da5 Also test unique ID in config flow test for APCUPSD (#150362) 2025-08-10 07:49:25 +02:00
Erik MontnemeryandGitHub d77a3fca83 Exclude is_new from DeviceEntry snapshots (#149801) 2025-08-01 11:01:26 +02:00
Erik MontnemeryandGitHub 0d7608f7c5 Deprecate DeviceEntry.suggested_area (#149730) 2025-08-01 10:34:34 +02:00
Yuxin WangandGitHub 85aa7bef1e Add sensor categorizations for APCUPSD (#146863)
* Add sensor categorizations

* Fix snapshot problem

* Fix snapshot problem
2025-06-16 08:43:31 +02:00
Abílio CostaandGitHub b626204f63 Add default device class display precision for Sensor (#145013)
* Add default device class display precision for Sensor

* Renaming, docstrings, cleanup

* Simplify units list

* Fix tests

* Fix missing precision when suggested is specified

* Update snapshots

* Fix when unit of measurement is not valid

* Fix tests

* Fix deprecated unit usage

* Fix goalzero tests

The sensor native_value method was accessing the data dict and trowing,
since the mock did not have any data for the sensors.

Since now the precision is always specified (it was missing for those
sensors), the throw was hitting async_update_entity_options in _update_suggested_precision.
Previously, async_update_entity_options was not called since it had no
precision.

* Fix metoffice

* Fix smartthings

* Add default sensor data for Tesla Wall Connector tests

* Update snapshots

* Revert spaces

* Update smartthings snapshots

* Add missing sensor mock for tesla wall connector

* Address review comments

* Add doc comment

* Add cap to doc comment

* Update comment

* Update snapshots

* Update comment
2025-05-26 19:40:29 +02:00
Erik MontnemeryandGitHub 4e1d5fbeb0 Add WS command to help reset custom entity_id (#145504)
* Add WS command to help reset custom entity_id

* Calculate suggested object id from entity properties

* Fix logic and add additional tests

* Adjust test

* Update folder_watcher test

* Handle current entity id matches the automatic entity id

* Don't store calculated_object_id

* Update snapshots

* Update snapshots

* Update test

* Tweak logic for reusing current entity_id

* Improve test

* Don't assign same entity_id to several entities

* Prioritize custom entity name

* Update snapshots

* Update snapshots
2025-05-26 19:28:27 +02:00
68a4e1a112 Add reconfigure config flow to APCUPSD (#143801)
* Add reconfigure config flow

* Add reconfigure config flow

* Add more subtests for wrong device

* Reduce the patch scopes

* Address comments

* Fix

---------

Co-authored-by: Joostlek <joostlek@outlook.com>
2025-05-26 15:10:30 +02:00
Simone ChemelliandGitHub 484a547758 Fix pylance warning on SnapshotAssertion import (#145206) 2025-05-19 13:55:48 +02:00
Joost LekkerkerkerandGitHub 49b7559b1f Fix snapshots in APC (#144901) 2025-05-14 17:14:57 +02:00
Yuxin WangandGitHub 11644d48ee Use snapshot testing for APCUPSD integration (#130770)
* First try to use snapshot testing for sensors

* Use snapshot testing

* Add ambr files

* Update comment

* Address review comments

* Remove duplicate async init integration call

* Add device test for cases w/o SERIALNO

* Use friendlier snapshot names

* Use * to mandate keyed argument for async_init_integration

* Always pass mock config entry ID

* Fix incorrect ID
2025-05-14 16:04:07 +02:00
Yuxin WangandGitHub 844515787b Fallback to config entry ID as unique ID when serialno is not available for APCUPSD (#130852) 2025-04-10 16:45:46 +02:00
Yuxin WangandGitHub 43d8c0bb6e Fallback to None for literal "Blank" serial number for APCUPSD integration (#136297)
* Fallback to None for Blank serial number

* Fix comments
2025-01-22 22:10:52 -06:00
epenetandGitHub 4d804649fc Migrate apcupsd to use runtime_data (#125539) 2024-09-08 22:07:19 +02:00
Yuxin WangandGitHub bf3a2cf393 Add graceful handling for LASTSTEST sensor in APCUPSD (#113125)
* Add handling for LASTSTEST sensor

* Set the state to unknown instead of unavailable

* Use LASTSTEST constant and revise the logic to add it to the entity list

* Use LASTSTEST constant
2024-07-31 13:01:48 +02:00
Yuxin WangandGitHub 269b8b07c4 Add handling for different STATFLAG formats in APCUPSD (#120870)
* Add handling for different STATFLAG formats

* Just use removesuffix
2024-07-01 07:30:08 +02:00
epenetandGitHub b8e57f6174 Use relative imports in tests [a-i] (#119280) 2024-06-10 12:52:34 +02:00
Joost LekkerkerkerandGitHub 9b41e3d124 Use is in enum comparison in config flow tests A-E (#114669) 2024-04-02 11:22:05 -10:00
6bb4e7d62c Bump ruff to 0.3.4 (#112690)
Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-26 00:02:16 +01:00
Yuxin WangandGitHub 76052a5385 Implement diagnostics platform for APCUPSD (#112284)
* Implement diagnostic platform for APCUPSd

* Put APCUPSd in gold quality scale

* Revert quality scale update

* Use snapshot testing for apcupsd

* Prettify the code
2024-03-24 23:40:41 +01:00
00ec7f11f0 Enable Ruff rule PT007 (#113764)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2024-03-19 09:01:07 +01:00
fe9cc6705c Add ruff rule PIE804 (#113620)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-16 12:45:18 -10:00
Yuxin WangandGitHub 405bf076b2 Remove a redundant check in APCUPSD's config flow (#113032)
Remove a redundant check that is impossible to happen in practice
2024-03-11 08:38:44 +01:00
Yuxin WangandGitHub db31afe019 Migrate APCUPSD to has entity name (#112997)
* Properly set entity names for APCUPSD

* Add test cases to prevent future regressions

* Fix tests due to the updated entity IDs

* Prettify code

* Remove redundant translation key
2024-03-10 23:56:25 +01:00
Marc MuellerandGitHub aa16a9d707 Add empty line after module docstring (3) (#112750) 2024-03-08 20:38:34 +01:00
Marc MuellerandGitHub 32f3f46542 Add empty line after module docstring (2) [tests.components] (#112737) 2024-03-08 19:16:21 +01:00