Robert Svensson
ed7a888c07
Add one UniFi sensor test to validate entity attributes ( #119914 )
2024-06-21 12:59:31 +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
915658daa1
Fix failing UniFi tests related to utcnow ( #119131 )
...
* test
* Fix missed test
2024-06-08 17:58:47 +02:00
Robert Svensson
a8becb1248
Use fixtures in UniFi sensor tests ( #118921 )
2024-06-07 12:15:03 +02:00
epenet
20b5aa3e0e
Move entity_registry_enabled_by_default to decorator [q-z] ( #118793 )
2024-06-04 13:38:32 +02:00
Kim de Vos
b69f589c30
Add bandwidth sensor for unifi device ports ( #115362 )
2024-04-22 22:39:46 +02:00
Robert Svensson
83370a5bde
Remove sensor exposing UniFi WLAN password ( #115929 )
2024-04-21 20:27:44 +02:00
Kim de Vos
f23e48f373
Add sensor for CPU and memory utilization for unifi device ( #114986 )
...
Add system stats to unifi device sensors
2024-04-08 19:29:54 +02:00
Bruno Henrique
9f9a141112
Add UniFi WLAN Password sensor ( #114419 )
...
* Adding UniFi WLAN Password Sensor
* Adding UniFi WLAN Password Sensor
* Adding UniFi WLAN Password Sensor
* Adding UniFi WLAN Password Sensor
Co-authored-by: Robert Svensson <Kane610@users.noreply.github.com>
* Adding UniFi WLAN Password Sensor
Co-authored-by: Robert Svensson <Kane610@users.noreply.github.com>
* Adding UniFi WLAN Password Sensor
* Adding UniFi WLAN Password Sensor
* Adding UniFi WLAN Password Sensor
---------
Co-authored-by: Robert Svensson <Kane610@users.noreply.github.com>
2024-03-30 19:49:33 +01:00
Marc Mueller
87165c0d6e
Add empty line after module docstring [tests t-z] ( #112712 )
2024-03-08 14:44:56 +01:00
Robert Svensson
ab4750c2ea
Remove unnecessary access to UniFi hub object in tests ( #112275 )
...
* Remove unnecessary access to UniFi hub object
* Split strings
* Skip + on concatenating f-strings
* Use single quotes inside double quotes
2024-03-05 08:23:17 +01:00
Robert Svensson
2f026ca963
Unifi rename controller to hub ( #110976 )
...
* Rename controller.py to hub.py
* Rename UniFiController to UnifiHub
* Rename controller instances into hub
* Rename controller to hub in tests
* Rename aiounifi Controller references to api
* Update strings
* Rename test_controller test_hub
* Narrow scope of test_remove_sensors
2024-02-20 08:51:22 +01:00
Jan-Philipp Benecke
22e62f42e6
Use entity & device registry fixtures in unifi tests ( #110889 )
2024-02-18 23:47:10 +01:00
wittypluck
7d24ae88e6
Mark Unifi bandwidth sensors as unavailable when client disconnects ( #109812 )
...
* Set sensor as unavailable instead of resetting value to 0 on disconnect
* Update unit test on unavailable bandwidth sensor
2024-02-06 18:33:10 +01:00
wittypluck
d94421e1a4
Reset UniFi bandwidth sensor when client misses heartbeat ( #104522 )
...
* Reset UniFi bandwidth sensor when client misses heartbeat
* Fix initialization sequence
* Code simplification: remove heartbeat_timedelta, unique_id and tracker logic
* Add unit tests
* Remove unused _is_connected attribute
* Remove redundant async_initiate_state
* Make is_connected_fn optional, heartbeat detection will only happen if not None
* Add checks on is_connected_fn
2024-01-14 15:19:43 +01:00
Joseph Block
1271f16385
Add Unifi device state for additional diagnostics ( #105138 )
...
* Add device state for additional diagnostics
* Add state test and fix existing tests
* Utilize IntEnum and dict for state lookup
* Update aiounifi to v68
2023-12-16 08:38:21 +01:00
Jan-Philipp Benecke
b5785003a3
Migrate unifi tests to use freezegun ( #105343 )
2023-12-09 12:55:40 +01:00
wittypluck
b79eae2e94
Update Unifi bandwidth sensors ( #101598 )
...
* Change bandwidth sensors device class, state class, unit of measurement, icon
* Reformat imports
* Reformat imports
* Revert suggested_unit_of_measurement. Add unit tests.
2023-10-22 17:14:49 +02:00
Robert Svensson
01b5854968
Rework UniFi websocket ( #100614 )
...
* Rework websocket management
* remove unnecessary fixture
* Remove controller from mock_unifi_websocket
* Mock api.login in reconnect method
* Remove unnecessary edits
* Minor clean up
* Bump aiounifi to v63
* Wait on task cancellation
2023-09-27 10:56:24 +02:00
Robert Svensson
cf47a6c515
Add UniFi device uptime and temperature sensors ( #99307 )
...
* Add UniFi device uptime and temperature sensors
* Add native_unit_of_measurement to temperature
Remove seconds and milliseconds from device uptime
2023-09-09 11:12:44 +02:00
Robert Svensson
b0e40d95ad
Bump aiounifi to v61 ( #99686 )
...
* Bump aiounifi to v61
* Alter a test to cover the upstream change
2023-09-05 21:13:28 +02:00
Marc Mueller
72e6f79086
Replace remaining utcnow calls + add ruff check ( #97964 )
2023-08-25 03:23:43 +02:00
Chris
5b6a7edd8d
Add Unifi outlet switches for PDU devices ( #98320 )
...
Updates the Unifi outlet switching feature to support PDU devices
2023-08-13 20:06:12 +02:00
Chris
87753bdb82
Add UniFi power stats for PDU overall AC outlet metrics ( #98217 )
2023-08-12 18:12:59 +02:00
Chris
fe1f617a35
Add unifi power stats for PDU outlets ( #98081 )
...
Adds support for power stats for PDU outlets.
2023-08-10 18:25:03 +02:00
Robert Svensson
02c27d8ad2
UniFi WLAN availability affected by WLAN enabled ( #98020 )
2023-08-09 18:52:35 +02:00
Robert Svensson
66cb407e4f
Improve counting of UniFi WLAN Clients sensor ( #97785 )
2023-08-04 19:22:46 +02:00
Robert Svensson
89069bb9b8
Add WLAN clients reporting to UniFi Sensor platform ( #97234 )
2023-07-26 08:00:17 +02:00
epenet
69a46d4002
Adjust pylint plugin for components fixtures ( #90217 )
...
* Adjust pylint plugin for components fixtures
* Adjust components
* Use MagicMock
* Adjust
* Use None
2023-03-26 15:21:19 +02:00
Robert Svensson
8564768d9e
UniFi library controls add/update signalling ( #89525 )
...
* Library controls add/update signalling
* Remove add/remove signalling
* Remove unifi_entity_base and unifi_client to make mypy pass
2023-03-11 20:14:39 +01:00
Robert Svensson
9ff45ca013
Allow loading UniFi entities on config options change ( #88762 )
...
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2023-03-06 16:08:14 +01:00
epenet
9a5f88f55f
Add type hints to integration tests (part 23) ( #88235 )
2023-02-17 16:40:46 +01:00
Franck Nijhof
ed79265843
Enable Ruff PT006 ( #88165 )
...
* Enable Ruff PT006
* Adjust existing cases
* Fix tests
* Remove unneeded parentheses
2023-02-15 14:09:50 +01:00
Erik Montnemery
cc564026fa
Move EntityCategory to homeassistant.const ( #87792 )
...
* Move EntityCategory to homeassistant.const
* Fix more imports
2023-02-09 20:15:37 +01:00
epenet
278050a73f
Add type hints to integration tests (t-z) ( #87707 )
2023-02-08 19:10:53 +01:00
Robert Hillis
d5b2062774
Disable uptime sensor by default in Unifi ( #87484 )
...
Disable Uptime sensor by default in Unifi
2023-02-05 19:28:28 +01:00
Robert Svensson
e33cea9ff7
Add PoE power sensor to UniFi integration ( #84314 )
...
* Add PoE power sensor to UniFi integration
* Add unit of power
* Only update state if value has changed
* Remove stale print
* Subscribe to specific sensor to remove unnecessary state changes
Co-authored-by: J. Nick Koston <nick@koston.org>
2022-12-29 22:55:00 +01:00
Robert Svensson
360f36eb71
Unifi use entity description with sensors ( #81930 )
...
* Move bandwidth sensors
* Add uptime sensor
* Use bound
* Fix review comments from other PR
2022-12-14 20:54:33 +01:00
Robert Svensson
92eaa539b6
Simplify mocking UniFi websocket ( #80652 )
...
* Simplify mocking UniFi websocket
* Fix one more
2022-10-20 19:37:13 +02:00
Robert Svensson
d0ed4b1ff2
Replace constants with enums in UniFi ( #80637 )
...
Replace constants with enums
Fix bad imports
2022-10-20 00:10:01 +03:00
Robert Svensson
597fca9072
Make UniFi bandwidth sensors be about current transfer rather than total transfer ( #64701 )
2022-01-24 13:50:54 +01:00
Robert Hillis
85c122f3e5
Use enums in unifi tests ( #62151 )
2021-12-17 11:12:43 +01:00
Christopher Bailey
5a72c9f7c3
Rename various usages of UniFi to better identify only UniFi Network ( #59568 )
...
* Renames various usages of UniFi to better indentify only UniFi Network
* Apply suggestions from code review
Co-authored-by: Robert Svensson <Kane610@users.noreply.github.com>
* Missed renames
* Updates more locations
* Removes instances of application/controller
* Missed a spot
* Updates all UniFi Controller instances
* Fixes typo
* Reverts changes to translations
Co-authored-by: Robert Svensson <Kane610@users.noreply.github.com>
2021-11-26 22:44:49 +01:00
Robert Svensson
47f6313e5b
Add entity category to UniFi sensors and switches ( #58484 )
2021-10-26 20:23:20 +02:00
Robert Svensson
d12110556f
More restrictive state updates of UniFi uptime sensor ( #53111 )
...
* More restrictive state updates of uptime sensor
* Remove commented out old version of uptime test
2021-07-19 10:54:31 +02:00
Robert Svensson
597bf67f5a
UniFi has changed to not report uptime in epoch form ( #47492 )
2021-03-12 11:55:11 -08:00
Robert Svensson
793929f2ea
Increase test coverage of UniFi integration ( #46347 )
...
* Increase coverage of init
* Increase coverage of config_flow
* Improve coverage of controller
* Minor improvement to switch test
* Fix review comment
* Mock websocket class
* Replace the rest of the old websocket event tests
* Improve websocket fixture for cleaner tests
* Fix typing
* Improve connection state signalling based on Martins feedback
* Improve tests of reconnection_mechanisms based on Martins review comments
* Fix unload entry
* Fix isort issue after rebase
* Fix martins comment on not using caplog
* Fix wireless clients test
* Fix martins comments on wireless clients test
2021-03-05 21:28:41 +01:00
Robert Svensson
ae2c7e4c74
Improve UniFi tests ( #45871 )
2021-02-05 16:31:47 +01:00