Commit Graph

290 Commits (dc5bfba902ce531e97ccbb8385a49a298f8cee21)

Author SHA1 Message Date
Maciej Bieniek 3132700492
Add ability to translate ENUM sensor states in Unifi integration (#131921) 2024-12-18 15:02:44 +01:00
Erik Montnemery ecb3bf79f3
Revert "Add support for subentries to config entries" (#133470)
Revert "Add support for subentries to config entries (#117355)"

This reverts commit ad15786115.
2024-12-18 13:51:05 +01:00
Erik Montnemery ad15786115
Add support for subentries to config entries (#117355)
* Add support for subentries to config entries

* Improve error handling and test coverage

* Include subentry_id in subentry containers

* Auto-generate subentry_id and add optional unique_id

* Tweak

* Update tests

* Fix stale docstring

* Address review comments

* Typing tweaks

* Add methods to ConfigEntries to add and remove subentry

* Improve ConfigSubentryData typed dict

* Update test snapshots

* Adjust tests

* Fix unique_id logic

* Allow multiple subentries with None unique_id

* Add number of subentries to config entry JSON representation

* Add subentry translation support

* Allow integrations to implement multiple subentry flows

* Update translations schema

* Adjust exception text

* Change subentry flow init step to user

* Prevent creating a subentry with colliding unique_id

* Update tests

* Address review comments

* Remove duplicaetd unique_id collision check

* Remove change from the future

* Improve test coverage

* Add default value for unique_id
2024-12-12 20:16:18 +01:00
Erik Montnemery bd55fe868d
Allow update entities to report progress as a float (#128930)
* Allow update entities to report progress as a float

* Add test

* Update snapshots

* Update recorder test

* Use _attr_* in MockUpdateEntity
2024-10-24 21:20:18 +02:00
Erik Montnemery e861cab727
Add update_percentage state attribute to update entity (#128877)
* Add update_percentage state attribute to update entity

* Update tests

* Update tests
2024-10-21 15:31:48 +02:00
epenet 906cecf087
Cleanup unused snapshots (#128549)
* Cleanup unused snapshots

* Cleanup a few more

* Cleanup systemmonitor

* Cleanup voip
2024-10-17 10:41:57 +02:00
Jan Rieger cda62a4ff3
Add missing icons to unifi (#126934) 2024-09-27 18:50:00 +02:00
Jan Rieger 2d68f9a986
Use icon translations in unifi (#126903)
* Use icon translations in unifi

* Update snapshots

* Add state icons

* Address feedback

* Update snapshot
2024-09-27 17:43:25 +02: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 edad766fd3
Use start_reauth helper method in integration tests (u-z) (#124796) 2024-08-28 16:51:16 +02:00
Ian d99f1631ca
Add Uplink info to UniFi Device tracker attributes (#123032)
Add device uplink mac sensor
2024-08-20 07:57:03 +02:00
Kim de Vos a8a7d01a84
Add temperature sensors for unifi device (#122518)
* Add temperature sensors for device

* Move to single line

* Use right reference

* Always return a value

* Update tests

* Use slugify for id name

* Return default value if not present

* Make _device_temperature return value

* Add default value if temperatures is None

* Set value to go over all code paths

* Add test for no matching temperatures

* make first part deterministic
2024-08-16 21:37:24 +02:00
Robert Svensson 37328c78c1
Use snapshot in UniFi switch tests (#122871)
* Use snapshot in UniFi switch tests

* Fix review comment
2024-08-15 21:29:32 +02:00
Robert Svensson 04598c6fb1
Use more snapshot in UniFi sensor tests (#122875)
* Use more snapshot in UniFi sensor tests

* Fix comment
2024-08-14 15:45:08 +02:00
Joost Lekkerkerker e8d7eb05ae
Delete unused snapshots (#123656)
* Delete unused snapshots

* Delete unused snapshots
2024-08-12 13:28:09 +02:00
Robert Svensson 5eff4f9816
Unifi improve fixture typing (#122864)
* Improve typing of UniFi fixtures

* Improve fixture typing, excluding image, sensor, switch

* Improve fixture typing in image tests

* Improve fixtures typing in sensor tests

* Improve fixture typing in switch tests

* Fix review comment
2024-07-30 19:33:25 +02:00
bdowden 18a7d15d14
Add Traffic Rule switches to UniFi Network (#118821)
* Add Traffic Rule switches to UniFi Network

* Retrieve Fix unifi traffic rule switches

Poll for traffic rule updates; have immediate feedback in the UI for modifying traffic rules

* Remove default values for unifi entity; Remove unnecessary code

* Begin updating traffic rule unit tests

* For the mock get request, allow for meta and data properties to not be appended to support v2 api requests

Fix traffic rule unit tests;

* inspect path to determine json response instead of passing an argument

* Remove entity id parameter from tests; remove unused code; rename traffic rule unique ID prefix

* Remove parameter with default.

* More code removal;

* Rename copy/paste variable; remove commented code; remove duplicate default code

---------

Co-authored-by: ViViDboarder <ViViDboarder@gmail.com>
2024-07-30 17:26:08 +02:00
Kim de Vos 896cd27bea
Add sensors for Unifi latency (#116737)
* Add sensors for Unifi latency

* Add needed guard and casting

* Use new types

* Add WAN2 support

* Add literals

* Make ids for WAN and WAN2 unique

* Make methods general

* Update sensor.py

* add more typing

* Simplify usage make_wan_latency_sensors

* Simplify further

* Move latency entity creation to method

* Make method internal

* simplify tests

* Apply feedback

* Reduce boiler copied code and add support function

* Add external method for share logic between

* Remove none

* Add more tests

* Apply feedback and change code to improve code coverage
2024-07-30 17:20:56 +02:00
Robert Resch ad50136dbd
Add created_at/modified_at to config entries (#122456) 2024-07-29 22:08:46 +02:00
Robert Svensson 53131390ac
Use snapshot in UniFi image tests (#122608)
* Use snapshot in UniFi image tests

* Make Image access_token deterministic
2024-07-26 19:22:09 +02:00
Robert Svensson 33ea67e1d0
Remove last references to hass.data[UNIFI_DOMAIN] (#122642) 2024-07-26 12:29:21 +02:00
Robert Svensson 51d5e21203
Remove unused fixtures in UniFi tests (#122628) 2024-07-26 09:48:12 +02:00
Robert Svensson e015c0a6ae
Use snapshot in UniFi device tracker tests (#122603) 2024-07-25 18:16:58 +02:00
Robert Svensson 81c8ba87ab
Use snapshot in UniFi button tests (#122602) 2024-07-25 18:16:25 +02:00
Robert Svensson 08d7beb803
Use snapshots in UniFi update tests (#122599) 2024-07-25 17:32:31 +02:00
Marc Mueller 8e024ad20f
Fix invalid Any annotations (#122212) 2024-07-20 02:46:27 +02:00
Marc Mueller 281c66b6c2
Fix invalid dict annotations in tests (#122178) 2024-07-19 14:45:42 +02:00
Robert Svensson aeabe3ab95
Mark UniFi power cycle button as unavailable if PoE is not enabled on port (#122035) 2024-07-16 20:16:36 +02:00
Robert Svensson 61111f5d71
Fix bad access to UniFi runtime_data when not assigned (#121725)
* Fix bad access to runtime_data when not assigned

* Fix review comment

* Clean up if statements
2024-07-10 23:53:11 +02:00
Marc Mueller f11b316dac
Import Generator from collections.abc (4) (#120917) 2024-07-01 11:54:42 +02:00
Richard Kroegel f672eec515
Fix unifi device tracker test imports (#120864) 2024-06-30 16:27:03 +02:00
Robert Svensson 8b3319b772
Improve UniFi device tracker tests (#120795) 2024-06-30 15:26:45 +02:00
Robert Svensson 289a630578
Improve UniFi device tracker tests Pt2 (#120796) 2024-06-30 15:25:38 +02:00
Robert Svensson e961ddd5fe
Simplify UniFi uptime sensor test (#120794) 2024-06-30 15:22:15 +02:00
wittypluck 3549aaf69c
Reject small uptime updates for Unifi clients (#120398)
Extend logic to reject small uptime updates to Unifi clients + add unit tests
2024-06-28 22:47:20 +02:00
Robert Svensson ed7a888c07
Add one UniFi sensor test to validate entity attributes (#119914) 2024-06-21 12:59:31 +02:00
Robert Svensson 6ddc872655
Improve UniFi device tracker client tests (#119982) 2024-06-21 12:20:13 +02:00
Robert Svensson 6fb5a12ef1
Make UniFi services handle unloaded config entry (#120028) 2024-06-21 10:36:52 +02:00
Robert Svensson 49349de74e
Unifi break out switch availability test to separate test (#119990) 2024-06-19 22:40:13 +02:00
Robert Svensson 970836da0c
Clean up config option tests in UniFi device tracker tests (#119978) 2024-06-19 19:42:23 +02:00
epenet 3e9d25f81d
Add missing argument type hints to component tests (#119671) 2024-06-14 09:26:46 +02:00
Robert Svensson 707e422a31
Add UniFi sensor for number of clients connected to a device (#119509)
Co-authored-by: Kim de Vos <kim.de.vos@vippsmobilepay.com>
2024-06-12 18:20:31 +02:00
Robert Svensson 325352e197
Fixture cleanup in UniFi tests (#119227)
* Make sure all mock_device_registry are used with usefixtuers

* Make sure to use name with fixtures and rename functions to start with fixture_

* Streamline config_entry_setup

* Type all *_payload

* Mark @pytest.mark.usefixtures("mock_default_requests")

* Clean up unnecessary newlines after docstring
2024-06-09 16:07:36 -04:00
Robert Svensson c9911e4dd4
Rework UniFi tests to not use runtime data (#119202) 2024-06-09 15:56:26 +02:00
Robert Svensson ff493a8a9d
Rewrite the UniFi button entity tests (#118771) 2024-06-09 12:25:06 +02:00
Robert Svensson d6097573f5
Remove old UniFi test infrastructure (#119160)
Clean up hub
2024-06-08 16:44:24 -04:00
Robert Svensson 915658daa1
Fix failing UniFi tests related to utcnow (#119131)
* test

* Fix missed test
2024-06-08 17:58:47 +02:00
Robert Svensson 20df747806
Use fixtures in UniFi device tracker tests (#118912) 2024-06-07 21:28:02 +02:00
Robert Svensson a8becb1248
Use fixtures in UniFi sensor tests (#118921) 2024-06-07 12:15:03 +02:00