Commit graph

81 commits

Author SHA1 Message Date
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
Kim de Vos
eb5ee1ffd1
Use slugify to create id for UniFi WAN latency (#123108)
Use slugify to create id for latency
2024-08-03 15:08:01 +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
J. Nick Koston
482cf261c0
Small speedups to unifi (#122684)
- Use a set for event_is_on to avoid linear search
- Avoid many duplicate property lookups
2024-07-27 10:19:53 +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
wittypluck
0a30032b96
Enable statistics for UniFi remaining power sensors (#120073)
Unifi: Add StateClass Measurement to all power sensors
2024-06-22 10:31:20 +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
fa815234be
Make UniFi use runtime data (#117457) 2024-05-14 21:04:26 +02:00
wittypluck
3fd863bd7c
Unifi: enable statistics for PoE port power sensor (#116308)
Add SensorStateClass.MEASUREMENT to PoE port power sensor
2024-04-27 22:21:08 +02:00
Robert Svensson
8bf3c87336
Breakout heartbeat monitor and poe command queue in UniFi (#112529)
* Split out entity helper functionality to own class

* Split out heartbeat to own class

* Break out poe command

* Make more parts private

* Make more things private and simplify naming

* Sort initialize

* Fix ruff
2024-04-23 21:45:20 +02:00
Robert Svensson
c32961f1bc
Bump aiounifi to v76 (#116005)
* Bump aiounifi to v76
2024-04-23 07:48:25 +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
Robert Svensson
a2180b16c3
Move wireless clients into entity_loader (#112813) 2024-03-09 11:30:01 +01:00
Robert Svensson
19e54debba
Unifi more polish on entity description (#112281)
* Make has_entity_name default value True

* Remove previously missed event_is_on and event_to_subscribe

* Provide default value for allowed_fn and supported_fn

* Provide default value for name_fn

* Provide default value for available_fn

* Add doc strings to required functions

* Fix some missed renames from variations of controller to hub
2024-03-09 09:19:38 +01:00
Robert Svensson
f2879e6f39
Break out UniFi platform registration to its own class (#112514) 2024-03-09 09:18:23 +01:00
Marc Mueller
062cc4bfce
Add empty line after module docstring [t-v] (#112705) 2024-03-08 10:35:23 -05:00
Robert Svensson
7c9891fff9
Break out UniFi config handling to own class (#111325) 2024-03-05 21:36:26 +01:00
Robert Svensson
99414d8b85
Streamline UniFi entity descriptions (#112136)
* Use kw_only=True to get rid of Mixins

* Clarify which inputs are optional and make them have default values
Add doc strings to optional inputs
2024-03-04 00:00:17 -05: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
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
Stephen Eisenhauer
a9fe63ed90
Reject unifi uptime sensor updates if time delta is small (#108464)
* Reject unifi uptime sensor updates if time delta is small

* Revise uptime change threshold tuning

* Use StateType helper

* Treat missing or zero uptime as None (unknown)
2024-01-29 20:30:07 +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
Erik Montnemery
0c2485bc03
Freeze integration entity descriptions (#105984)
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-12-18 16:28:13 -10: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
Robert Svensson
482e087a85
Make unifi RX-/TX-sensors diagnostic entities (#105022) 2023-12-05 08:55:15 +01:00
Robert Svensson
e80ee09f5e
Make UniFi WiFi clients numerical (#105032) 2023-12-05 08:50:32 +01:00
Robert Svensson
721c45b7a3
Rework UniFi client configuration (#99483) 2023-10-22 23:39:54 +02: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
d8445a79fc
UniFi streamline loading platforms (#100071)
* Streamline loading platforms

* Move platform registration logic to UnifiController class
2023-09-11 15:55:27 +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
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
dougiteixeira
e99ba1b0da
Move async_client_device_info_fn to entity.py (#97270)
Move client device info
2023-07-27 10:21:22 +02:00
Robert Svensson
89069bb9b8
Add WLAN clients reporting to UniFi Sensor platform (#97234) 2023-07-26 08:00:17 +02:00
Robert Svensson
7f1fff12ef
Bump aiounifi to v45 (#90250)
* Bump aiounifi to v45

* Replace local TypeVar with library TypeVar
2023-03-25 00:27:16 +01:00
Robert Svensson
ee74e21541
Rework UniFi wireless client "wired bug" logic (#89757) 2023-03-24 10:06:09 +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
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
220ec1906c
Make sensor platform use common UniFi entity class (#84818)
fixes undefined
2023-01-06 12:50:32 +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
epenet
69bc95a715
Use DATA_SIZE device class in integrations (#83895) 2022-12-13 10:17:56 +01:00
Franck Nijhof
a8f1cc0d33
Remove unneeded guards from (async_)add_entities call (#80471) 2022-10-17 21:11:58 +02: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