Commit graph

60 commits

Author SHA1 Message Date
Paulus Schoutsen
442597928e
Store: copy pending data () 2021-11-18 15:56:22 -08: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
ca6b53c16d
Remove UniFi config entry reference from device when removing last entity of said device () 2021-09-27 12:04:29 +02:00
Paulus Schoutsen
ee2c950716
Merge system options into pref properties ()
* Make system options future proof

* Update tests

* Add types
2021-06-01 22:34:31 +02:00
Franck Nijhof
c68b259bd3
Cleanup of unused connection_class logic ()
Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-04-29 23:12:58 +02:00
Erik Montnemery
b3fecb1c95
Update tests t-z to use async_get() instead of async_get_registry() () 2021-03-09 14:25:03 +01:00
Robert Svensson
48f1a55a28
Improve common structure in UniFi device tracker tests () 2021-03-07 13:20:04 +01:00
Robert Svensson
793929f2ea
Increase test coverage of UniFi integration ()
* 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
J. Nick Koston
c9df42b69a
Add support for pre-filtering events to the event bus () 2021-02-14 09:42:55 -10:00
Robert Svensson
ae2c7e4c74
Improve UniFi tests () 2021-02-05 16:31:47 +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
Franck Nijhof
1c2ebdf307
Upgrade black to 20.8b1 () 2020-08-27 13:56:20 +02:00
Robert Svensson
a3865fb383
UniFi - Increase time to mark UniFi devices as away () 2020-06-02 10:35:27 +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
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
Robert Svensson
c5ce95ff06
UniFi - Improve signalling and handling of adding new entities ()
* Change signalling and handling of adding devices

* Bump aiounifi to v19
Use the proper variable for roamradio
2020-05-04 19:29:49 +02:00
Paulus Schoutsen
ec47216388
Use built-in test helpers on 3.8 () 2020-04-30 13:29:50 -07:00
Robert Svensson
c3689d7416
UniFi - Store controller in config_entry.entry_id ()
* Store controller in config_entry.entry_id

* Clean up imports
2020-04-23 16:48:24 +02:00
Robert Svensson
465eeab553
UniFi - Allow tracking of clients connected to third party APs ()
* Allow disable wired bug work around

* Move small improvements from closed PR 

* Fix failing test

* Add new test

* Some extra logging

* Harmonize log outputs

* Add config flow string

* Fix Balloobs comments
2020-04-17 08:39:01 +02:00
Robert Svensson
374fe47809
UniFi - Support automatic removal of clients () 2020-04-16 15:08:53 -07:00
Paulus Schoutsen
5123baba3f
Fix zone config ()
* Fix zone config

* Add zone as dependency again to device tracker

* Fix tests
2020-03-18 18:14:25 -07:00
Paulus Schoutsen
abd1909e2b
Make zone dependency of device tracker an after dep ()
* Make zone dependency of device tracker an after dep

* Fix test
2020-03-17 06:59:39 -04:00
Robert Svensson
fa63dc1e25
UniFi - Improve expected SSID filter behavior ()
* Improve expected ssid filter behavior

* Fix tests
2020-03-16 12:10:45 +01:00
Robert Svensson
374a8157e7
Remove manual configuration support () 2020-03-12 11:56:50 +01:00
Jens Nistler
ecd076c5e4
Mark clients away if they have never been seen. () 2020-02-27 11:50:34 -08:00
Robert Svensson
4cac0443e2
UniFi - Change handling of updated options ()
* Change handling of updated options

* Add tests
2020-02-12 16:15:08 -08:00
Robert Svensson
958a867c11
UniFi integration move to push messaging ()
* Rewrite UniFi integration to use push messaging

* Add signalling for new clients/devices

* Update list of known wireless clients when we get events of them connecting

* Reconnection logic for websocket

* Fix failing tests

* Bump requirement to v12

* Add new tests

* Update homeassistant/components/unifi/controller.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
2020-01-31 20:23:25 +01:00
Christian Clauss
df7d2b3aeb
Fix typos found by codespell ()
* Fix typos found by codespell

* Fix typos found by codespell

* codespell: Furture  ==> Future

* Update test_config_flow.py

* Update __init__.py

* Spellcheck: successfull  ==> successful

* Codespell: unsuccesful  ==> unsuccessful

* Codespell: cant  ==> can't

* Codespell: firware ==> firmware

* Codespell: mimick  ==> mimic
2020-01-31 08:33:00 -08:00
Paulus Schoutsen
9aa02e35a7
Entity Component to no longer generate automatic groups () 2020-01-07 17:30:53 +01:00
Robert Svensson
2b26af89df Improve tests based on Martins feedback from Axis improve tests () 2020-01-03 12:23:17 -06:00
Robert Svensson
41d2d1f309 Handle wired bug on restart () 2019-12-30 12:40:52 -06:00
Robert Svensson
99328bd4c1
UniFi - honor detection time when UniFi wire bug happens () 2019-12-10 20:05:18 +01:00
Bas Nijholt
2da3848f89 Sort imports according to PEP8 for unifi () 2019-12-09 12:19:33 +01:00
Robert Svensson
6565c17828
UniFi - Improve controller tests ()
* Improve controller tests and harmonize setup_unifi_integration to one
* Store listeners to dispatchers to be used during reset
2019-10-07 21:55:35 +02:00
Robert Svensson
a8567a746b
UniFi - Improve switch tests ()
* Continue rewriting tests for UniFi
2019-10-05 16:16:08 +02:00
Robert Svensson
565302ed34 Improve device tracker tests () 2019-10-03 13:23:25 -07:00
Robert Svensson
09c5b9feb3
UniFi - Try to handle when UniFi erroneously marks offline client as wired ()
* Add controls to catch when client goes offline and UniFi bug marks client as wired
* Device trackers shouldn't jump between going away and home
* POE control shouldn't add normally wireless clients as POE control switches
2019-10-02 21:43:14 +02:00
Robert Svensson
e2d7a01d65 Remove last of device tracker scanner () 2019-09-30 21:19:51 -07:00
Robert Svensson
0221d136de Remove support of UniFi device tracker configuration import () 2019-09-11 13:35:30 -06:00
Robert Svensson
b5426761f4
UniFi - Simplify getting controller from config entry ()
* Simplify getting controller from config entry

* Lint ignore no longer needed

* Fix tests
2019-09-01 17:57:25 +02:00
Robert Svensson
d9ef92f6d2
UniFi - use entity registry disabled_by to control available entities ()
* Move ignoring logic to entity registry enabled default

* Handle config to option import better

* Properly enable and disable entity registry entries on changes from config entry options

* Fix balloobs comments

* Fix some tests

* Fix tests

* Simplify updating disable on entities

* Simplify device tracker update function

* Local entity disabled replaced on rebase

* Only alter entities with changed options

* Proper tracking of changed options

* Back to straightforward updating of disabled
2019-08-31 22:04:04 +02:00
Robert Svensson
588eac82c7
UniFi config entry options ()
Introduce config entry options for Unifi integration
Allow configuration.yaml options to be imported to new options
2019-08-21 22:22:42 +02:00
Robert Svensson
a2589f56e1 Add system options to config entries ()
* Add system options to config entries

* For feedback

* Follow most of balloobs comments

* Fix balloobs comments

* Improvements

* Fix second round of Balloobs comments

* Fix third round

* Add system options to mock config entry

* Fix integration tests

* Fix the last failing tests

* Fix disabled string

* Fix failing disabled_by tests

* New tests

* Config entry WS API tests

* Fix comments
2019-08-17 21:34:11 -07:00
Robert Svensson
ab7db5fbd0
UniFi - Use state to know if device is online () 2019-08-11 22:40:44 +02:00
Robert Svensson
c76531a366 Fix last seen not available on certain devices () 2019-08-06 14:55:36 -07:00