Commit graph

112 commits

Author SHA1 Message Date
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
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
efc89cd34f
Unifi websocket manager (#111041)
* Move hub into .hub.hub

* Move websocket to own module

* Minor shuffle
2024-02-24 16:20:59 -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
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
Robert Svensson
6271fe333d
Rework some UniFi unique IDs (#104390) 2023-11-24 11:18:55 +01:00
Robert Svensson
721c45b7a3
Rework UniFi client configuration (#99483) 2023-10-22 23:39:54 +02:00
Robert Svensson
f909199125
Remove hard coded Icon from Unifi device scanner (#100401) 2023-09-14 20:13:46 +02:00
Robert Svensson
13cd873e38
Fix devices not always reporting IP - bump aiounifi to v62 (#100149) 2023-09-11 21:50:29 +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
89069bb9b8
Add WLAN clients reporting to UniFi Sensor platform (#97234) 2023-07-26 08:00:17 +02:00
Robert Svensson
0d7711f787
Fix UniFi client tracker host_name missing (#91188) 2023-04-11 11:56:55 +02:00
Robert Svensson
a0b6da33ab
Strict typing of UniFi integration (#90278)
* Fix typing of UniFi controller

* Strict typing of unifi.__init__

* Strict typing of UniFi config_flow

* Strict typing of UniFi switch

* Strict typing UniFi sensor

* Strict typing UniFi device tracker

* Strict typing of UniFi

* Fix library issues related to typing
2023-03-26 09:57:13 +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
Robert Svensson
288a4203ab
Make client tracker use common UniFi entity class (#84942)
* Make client tracker use common UniFi entity class

* Fix tests

* Fix mypy

* Remove legacy data

* Fix comment: skip else use return

* Minor change

* Remove missed stuff from previous rebase

* Import async_device_available_fn from entities.py rather than specifying it in device_tracker

* Avoid using asserts

* Keep explicit parenthesis for readability

* Allow loading entities on option changes
2023-03-11 06:23:49 +01:00
Franck Nijhof
5e81d28116
Update black to 23.1.0 (#87188) 2023-02-02 18:35:24 +01:00
Robert Svensson
7729a5cf8a
Bump aiounifi to v44 (#86381)
fixes undefined
2023-01-22 19:34:48 +01:00
Robert Svensson
a75bad3a83
Move add Device tracker entities to UniFi controller (#84883) 2023-01-03 20:59:28 +01:00
Robert Svensson
60de2a82c7
Make device tracker use common UniFi entity class (#84786) 2022-12-30 22:27:45 +01:00
Robert Svensson
de5c7b0414
Rework UniFi device tracker to utilizing entity description (#81979)
* Rework UniFi device tracker to utilizing entity description

* Use bound

* Fix review comments from other PR
2022-12-28 22:29:11 +01:00
epenet
2214fff3b4
Cleanup device_tracker imports (#81139) 2022-10-28 17:40:37 +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
Franck Nijhof
a8f1cc0d33
Remove unneeded guards from (async_)add_entities call (#80471) 2022-10-17 21:11:58 +02:00
Robert Svensson
bfd12730f2
Bump aiounifi to v35 (#79040)
* Update imports
Replace constants with enums

* Import new request objects

* Bump aiounifi to v35
2022-09-25 20:08:56 +02:00
epenet
b5402f9b57
Import device tracker constants from root (#78242) 2022-09-12 20:50:44 -04:00
Marc Mueller
c9ddb10024
Use device_tracker SourceType enum [s-z] (#75966) 2022-07-31 14:01:18 +02:00
epenet
a27d483009
Remove unifi from mypy ignore list (#74456)
* Remove unifi diagnostics from mypy ignore list

* Remove unifi init from mypy ignore list

* Remove unifi device tracker from mypy ignore list

* Adjust doc string

* Adjust doc string

* Remove unifi entity base from mypy ignore list

* Keep comprehension

* Remove unifi config flow from mypy ignore list

* Fix circular import
2022-07-06 10:25:53 +02:00
Robert Svensson
dc0d065901
Fix UniFi device tracker on controllers only reporting events (#72240)
Add events to UniFi client tracker in case controller does not report proper data
2022-05-24 16:06:30 +02:00
Jelte Zeilstra
75058e63a4
Create Update entities for Ubiquiti network devices (#71700)
Co-authored-by: Robert Svensson <Kane610@users.noreply.github.com>
2022-05-13 09:17:41 +02:00
Robert Svensson
caf71c854f
Handle situation where mac might not exist in clients (#71016) 2022-04-28 21:36:52 +03:00
Robert Svensson
e387e6d332
Add logging to UniFi device tracker for help debugging client status (#70824)
* Add logging to UniFi device tracker for help debugging client status

* Add if _LOGGER.isEnabledFor(logging.DEBUG)
2022-04-26 13:49:03 -07:00
Robert Svensson
46c2bd0eb0
Tweak UniFi client tracker (#67129) 2022-02-23 09:26:46 -10:00
Robert Svensson
a15bdbbc4a
UniFi events aren't reliable for device tracker usage, use last_seen instead (#64147) 2022-01-24 15:11:33 +01:00
Paulus Schoutsen
2b4bb49eb7
Make device tracker entities work better (#63328)
Co-authored-by: Franck Nijhof <git@frenck.dev>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-01-04 23:16:43 -08:00
epenet
e01b0a3625
Add setup type hints to sonos, unifi and wake_on_lan (#62876)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-12-27 23:42:24 +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
epenet
6391376d6f
Use DeviceInfo in unifi (#58620)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-10-28 18:26:21 +02:00
Robert Svensson
26c5f89207
Allow data sources to affect client tracker state after reconnecting to UniFi controller (#58269) 2021-10-26 22:04:16 +02:00
Robert Svensson
b8cf6513d9
Address late review of unifi (#58080)
* Fix late comment from 57570

* Remove other references to legacy ways
2021-10-20 10:59:07 +02:00
Robert Svensson
93899e981f
UniFi lies about the client being noted, using the real note instead if it exists (#53542) 2021-07-27 12:35:16 +02:00
Robert Svensson
63616a9e36
Use config_entry.on_unload rather than local listener implementation in UniFi (#49496) 2021-04-20 08:50:42 -10:00
Franck Nijhof
8d5ce53098
Merge of nested IF-IF cases - S-W (#48372) 2021-03-27 10:54:59 +01:00
Erik Montnemery
1fc8e32d86
Update integrations t-z to override extra_state_attributes() (#47760) 2021-03-11 20:16:26 +01:00
Robert Svensson
83a75b02ea
Code quality improvements to UniFi integration (#45794)
* Do less inside try statements

* Replace controller id with config entry id since it doesn't serve a purpose anymore

* Improve how controller connection state is communicated in the client and device tracker
Remove the need to disable arguments-differ lint

* Remove broad exception handling from config flow
I'm not sure there ever was a reason for this more than to catch all exceptions

* Replace site string with constant for SSDP title_placeholders

* Unload platforms in the defacto way

* Noone reads the method descriptions

* Improve file descriptions
2021-02-01 17:55:16 +01:00
Robert Svensson
26764a805b
Don't parse previous messages when UniFi connection state change to available (#45544)
* Don't parse previous messages when connection state change to available

* Disable pylint for arguments-differ W0221 message
2021-01-26 16:41:28 +01:00
J. Nick Koston
536e835b39
Switch frequently used unifi controller properties to attributes (#45365) 2021-01-20 16:58:02 -06:00