1
0
mirror of https://github.com/home-assistant/core.git synced 2025-05-23 07:17:07 +00:00

99 Commits

Author SHA1 Message Date
Robert Svensson
89069bb9b8
Add WLAN clients reporting to UniFi Sensor platform () 2023-07-26 08:00:17 +02:00
Robert Svensson
0d7711f787
Fix UniFi client tracker host_name missing () 2023-04-11 11:56:55 +02:00
Robert Svensson
a0b6da33ab
Strict typing of UniFi integration ()
* 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 ()
* 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 () 2023-03-24 10:06:09 +01:00
Robert Svensson
288a4203ab
Make client tracker use common UniFi entity class ()
* 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 () 2023-02-02 18:35:24 +01:00
Robert Svensson
7729a5cf8a
Bump aiounifi to v44 ()
fixes undefined
2023-01-22 19:34:48 +01:00
Robert Svensson
a75bad3a83
Move add Device tracker entities to UniFi controller () 2023-01-03 20:59:28 +01:00
Robert Svensson
60de2a82c7
Make device tracker use common UniFi entity class () 2022-12-30 22:27:45 +01:00
Robert Svensson
de5c7b0414
Rework UniFi device tracker to utilizing entity description ()
* 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 () 2022-10-28 17:40:37 +02:00
Robert Svensson
d0ed4b1ff2
Replace constants with enums in UniFi ()
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 () 2022-10-17 21:11:58 +02:00
Robert Svensson
bfd12730f2
Bump aiounifi to v35 ()
* 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 () 2022-09-12 20:50:44 -04:00
Marc Mueller
c9ddb10024
Use device_tracker SourceType enum [s-z] () 2022-07-31 14:01:18 +02:00
epenet
a27d483009
Remove unifi from mypy ignore list ()
* 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 ()
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 ()
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 () 2022-04-28 21:36:52 +03:00
Robert Svensson
e387e6d332
Add logging to UniFi device tracker for help debugging client status ()
* 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 () 2022-02-23 09:26:46 -10:00
Robert Svensson
a15bdbbc4a
UniFi events aren't reliable for device tracker usage, use last_seen instead () 2022-01-24 15:11:33 +01:00
Paulus Schoutsen
2b4bb49eb7
Make device tracker entities work better ()
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 ()
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 ()
* 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 ()
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 () 2021-10-26 22:04:16 +02:00
Robert Svensson
b8cf6513d9
Address late review of unifi ()
* 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 () 2021-07-27 12:35:16 +02:00
Robert Svensson
63616a9e36
Use config_entry.on_unload rather than local listener implementation in UniFi () 2021-04-20 08:50:42 -10:00
Franck Nijhof
8d5ce53098
Merge of nested IF-IF cases - S-W () 2021-03-27 10:54:59 +01:00
Erik Montnemery
1fc8e32d86
Update integrations t-z to override extra_state_attributes() () 2021-03-11 20:16:26 +01:00
Robert Svensson
83a75b02ea
Code quality improvements to UniFi integration ()
* 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 ()
* 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 () 2021-01-20 16:58:02 -06:00
J. Nick Koston
41e7d960ee
Use dispatcher for unifi heartbeat tracking ()
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-01-17 03:10:52 +01:00
J. Nick Koston
5e01b828af
Discover devices from device_trackers with router sources ()
* Discover devices from device_trackers with router sources

* Update homeassistant/components/dhcp/__init__.py

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

* fix stop being called on the wrong context

* clean

* move it to base

* cleanup was too agressive

* Update homeassistant/components/dhcp/__init__.py

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

* coverage

* revert legacy changes

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-01-16 01:01:37 +01:00
J. Nick Koston
b450d4c135
Improve unifi performance with many devices ()
With 250 clients, there were about 18000 timers updated every
minute. To avoid this, we check which entities should be set
to not_home only once every second.
2021-01-10 20:12:21 +01:00
Philip Allgaier
dde6305549
Cleanup unused loggers (components N-Z + tests) () 2020-10-16 21:24:08 -05:00
springstan
513f03eb1f
Return attribute dict directly without temporary variable v2 () 2020-10-06 16:55:16 +02:00
J. Nick Koston
f352c51990
Improve unifi device tracker performance ()
* Improve unifi device tracker performance

The unifi websocket sends an update every second
which generates a significant amount of state
changed updates.

Avoid creating callback functions when they
are not going to be used.

* make _no_heartbeat/_make_disconnected instance methods

* remove extra empty line

* revert is_wired change

* remove extra line
2020-07-02 17:46:37 -05:00
Robert Svensson
3a83f4bdbe
Support guest events in UniFi device tracker () 2020-06-22 21:50:34 +02:00
Robert Svensson
a3865fb383
UniFi - Increase time to mark UniFi devices as away () 2020-06-02 10:35:27 +02:00
Robert Svensson
648df6d984
UniFi - Fix disabled entities being enabled after a restart ()
* Async remove call removed too much, resulting in disabled entities coming back after a restart

* Calling super().async_remove is no longer needed, changed to self.async_remove

* Yes, they should be sets...
2020-05-19 23:57:41 +02:00
Robert Svensson
c71b6c8a71
UniFi - Update device registry after device has been upgraded ()
* Update device registry if received event saying device has been updated

* Make sure event was the last updated
2020-05-10 17:14:45 +02:00
Robert Svensson
b62c7abc5d
UniFi - Additional consolidation for cleanliness sake ()
* Some additional consolidation for cleanliness sake

* Remove unnecessary mac property
2020-05-09 00:34:18 +02:00
Robert Svensson
c8deae6445
UniFi - Make clients proper push based ()
* Improve client tracker to be more comprehensible and streamlined
Improve block switches
Improve tests

* Small clean up

* Add descriptions on ssid test

* Improve test

* Make polling default off, only POE clients left to verify

* Minor improvements

* On removal cancel scheduled updates

* POE works without polling now

* Combine else and if to an elif
2020-05-08 22:19:27 +02:00
Robert Svensson
53f64bae09
UniFi - Make devices proper push based ()
* Make devices proper push based

* Improve tests

* Bump dependency to v21
Update fix from  to use library
2020-05-07 09:58:04 +02:00