Commit Graph

73 Commits

Author SHA1 Message Date
tdfountain
0752807aaf Improve device action config entry lookup in NUT (#142133)
Co-authored-by: J. Nick Koston <nick@koston.org>
2025-04-30 20:46:02 +02:00
tdfountain
0b2e5cd253 Move device registry into function declaration for tests in NUT (#143349) 2025-04-22 13:11:14 -10:00
tdfountain
eb642e8a06 Remove unused variable in test util for NUT (#143304) 2025-04-19 16:22:10 -10:00
tdfountain
b97d8e163d Fix type of port in test util for NUT (#143303) 2025-04-19 16:13:05 -10:00
tdfountain
7c0d2832cd Add remove device support to NUT (#143293) 2025-04-19 16:07:42 -10:00
tdfountain
37769b94cd Remove unnecessary persistent notification in test case for NUT (#143298)
Remove unnecessary persistent notification
2025-04-20 01:55:26 +02:00
tdfountain
cd7d7cd35c Add reconfiguration flow to NUT (#142127)
* Add reconfiguration flow

* Check host/port/alias without comparing strings

* Replace repeat strings with references
2025-04-05 11:02:46 -10:00
tdfountain
1c16fb8e42 Set and check unique id of config in NUT (#141783)
* Set and check unique id in config

* Update homeassistant/components/nut/config_flow.py

Set unique ID and abort only if value is defined

Co-authored-by: J. Nick Koston <nick+github@koston.org>

* Add duplicate ID test case for multiple devices

* Add unique ID check to config flow step for UPS

* Update homeassistant/components/nut/__init__.py

Fix to only set config_entries unique ID if not None

Co-authored-by: J. Nick Koston <nick+github@koston.org>

* Remove duplicate config flow call

---------

Co-authored-by: J. Nick Koston <nick+github@koston.org>
Co-authored-by: J. Nick Koston <nick@koston.org>
2025-03-30 11:41:56 -10:00
tdfountain
e81a08916a Remove scan interval option from NUT (#141845)
Remove scan interval option and test case, migrate config and add migration test case
2025-03-30 22:34:45 +02:00
tdfountain
7fbf15edc9 Add ambient state translations in NUT (#141772)
Add ambient state translations
2025-03-29 21:00:53 -10:00
tdfountain
2be2d54a5c Replace hard coded attributes with constants for test cases in NUT (#141774)
Replace hard coded attributes with constants
2025-03-29 15:19:41 -10:00
tdfountain
2121b943a3 Add exception translation to NUT (#141629)
* Add exception translation and test cases

* Capitalize ID in error string

* Test translation placeholders, simplify test cases
2025-03-28 16:43:16 +01:00
tdfountain
9e86ca2e9e Add Switch platform and PDU dynamic outlet switches to NUT (#141159) 2025-03-22 19:27:52 -10:00
tdfountain
ddd67a7e58 Add PDU dynamic outlet buttons to NUT (#140317) 2025-03-22 13:04:20 -10:00
tdfountain
2571725eb9 Add metered PDU dynamic outlet sensors to NUT (#140179)
* Add metered PDU dynamic outlet sensors

* Make deep copy and improve efficiency of loops

* Improve performance by creating new dict

Co-authored-by: J. Nick Koston <nick+github@koston.org>

* Remove unused import copy

* Use outlet name (if available) in friendly name and remove as separate sensor

---------

Co-authored-by: J. Nick Koston <nick+github@koston.org>
2025-03-21 11:41:43 -10:00
tdfountain
1c1a950c05 Add conditional support for ambient sensors in NUT (#139675)
* Conditionally remove ambient sensors if not present

* Create ambient sensors list and use list comprehension

* Update homeassistant/components/nut/sensor.py

Co-authored-by: J. Nick Koston <nick@koston.org>

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2025-03-05 12:12:56 +00:00
tdfountain
51a881f3b5 Add ambient temperature and humidity status sensors to NUT (#124181)
Co-authored-by: J. Nick Koston <nick@koston.org>
2025-02-24 14:09:43 +00:00
epenet
fe010289b4 Use new ServiceInfo location in component tests (part 2) (#136062) 2025-01-20 13:13:45 +01:00
tdfountain
9c8d8fef16 Suggest area for NUT based on device location (#129770) 2024-11-04 18:06:45 +01:00
tdfountain
a05a34239d Show NUT device serial number if provided in Device Info (#124168) 2024-11-03 17:27:27 -06:00
Erik Montnemery
d82bff1bc2 Index config entry discovery_keys by discovery domain (#126563)
* Index config entry discovery_keys by discovery domain

* Add new signal

* Update tests

* Update homeassistant/config_entries.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Fix imports

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-09-23 21:48:11 +02:00
Erik Montnemery
b2982c18bb Reinitialize zeroconf discovery flow on unignore (#125753)
* Reinitialize zeroconf discovery flow on unignore

* Adjust tests

* Improve comments

* Fix logic for updating discovery keys

* Add tests

* Use mock_config_flow helper in new config_entries test

* Add discovery_keys attribute to ConfigEntry

* Update zeroconf rediscovery

* Change type of ConfigEntry.discovery_keys

* Update tests

* Fix DiscoveryKey.from_json_dict and add tests

* Fix test

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-09-23 16:49:21 +02:00
epenet
ead0e797c1 Use registry fixtures in tests (m-n) (#118291) 2024-05-28 13:40:45 +02:00
Michael
90a3c2e357 Store runtime data inside the config entry in NUT (#116771)
* store runtime data inside the config entry

* remove unsued constants

* add test for InvalidDeviceAutomationConfig exception

* assert entry

* add more specific type hint
2024-05-04 23:08:01 +02:00
Sid
3efee10b95 Enable Ruff RUF013 (#115333) 2024-04-10 08:55:59 +02:00
Joost Lekkerkerker
5d500cb74b Use is in enum comparison in config flow tests K-O (#114672) 2024-04-02 11:21:42 -10:00
Joost Lekkerkerker
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
J. Nick Koston
c3f4aca4e3 Add reauth support to NUT (#114131) 2024-03-25 07:59:46 -10:00
J. Nick Koston
4ac439ef88 Migrate nut to use aionut (#114078) 2024-03-23 12:02:02 -10:00
Marc Mueller
1722e23df8 Add empty line after module docstring [tests l-p] (#112710) 2024-03-08 14:55:15 +01:00
Jan-Philipp Benecke
0a57968fdc Update nut sensor tests to use parametrize (#103707)
* Update nut sensor tests to use parametrize

* Add missing model

* Check on unique_id instead of config_entry_id

* Separate tests
2023-11-09 19:01:07 +01:00
J. Nick Koston
0eca433004 Update zeroconf discovery to use IPAddress objects to avoid conversions (#100567) 2023-09-19 18:58:46 +02:00
ollo69
ce3c23cb3a Add Nut commands to diagnostics data (#96285)
* Add Nut commands to diagnostics data

* Add test for diagnostics
2023-07-12 10:56:08 +02:00
Erik Montnemery
eba04824a4 Replace assert_lists_same with pytest_unordered in integrations n-s (#94902) 2023-06-20 20:23:14 +02:00
Pablo Estevez
780d0a484d Add NUT device actions (#80986)
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-04-23 14:09:36 -05:00
Michael
1cce55d176 Add entity name translations to NUT (#90709) 2023-04-03 18:18:23 +02:00
epenet
3abf7ea18a Add type hints to integration tests (m-p) (#87705) 2023-02-08 07:48:54 -08:00
zebardy
af107d7853 Add support for additional fields to nut (#83265)
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-01-22 19:24:30 -10:00
ollo69
75886d7213 Strip whitespace from Nut "zero" serialno (#80141) 2022-10-12 10:04:48 +02:00
Franck Nijhof
7cd68381f1 Search/replace RESULT_TYPE_* by FlowResultType enum (#74642) 2022-07-07 19:57:36 +03:00
epenet
053c4428a9 Prettify json (component test fixtures) (#68892) 2022-03-30 11:37:17 +02:00
Joshua Roys
9134e5c844 Get discovered zeroconf IPv6 addresses (#65462) 2022-02-11 16:46:17 -06:00
epenet
77dfeb062f Update ZeroconfServiceInfo in tests (n-t) (#60219)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-11-23 10:35:44 -06:00
epenet
b9cbfbae58 Use ZeroconfServiceInfo in nut (#60047) 2021-11-21 15:49:03 -06:00
ollo69
21f92f6286 Add Nut device explicitly to the device registry (#59525)
* Add Nut device explicitly to the device registry

* Restore resources in data and remove unused string
2021-11-12 11:10:40 +01:00
ollo69
6cba03aa4a Remove resources selection from Nut config flow (#59450)
* Remove resources selection from Nut config flow

* Code clean-up

* Requested changes

* Apply suggestions from code review

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-11-10 13:49:05 +01:00
Paulus Schoutsen
31153ac155 Move fixtures part 1 (#58902) 2021-11-01 20:47:05 -07:00
ollo69
b01170d917 Add Nut missing tests for config flow (#57964) 2021-10-18 07:17:10 -10:00
ollo69
fe0291012c Use attr_device_info and add init tests for nut (#57725) 2021-10-17 07:43:15 -10:00
ollo69
827501659c Nut: Use coordinator data, code cleanup and add test coverage (#57643) 2021-10-13 16:05:06 -10:00