Commit Graph

157 Commits (1a4cac95a13bb3faf658ffc795642c58c5e31d63)

Author SHA1 Message Date
Robert Svensson f56f391f81
Remove legacy constant from UniFi (#84947) 2023-01-01 20:03:14 +01:00
Robert Svensson 60de2a82c7
Make device tracker use common UniFi entity class (#84786) 2022-12-30 22:27:45 +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 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
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 af6338343e
Remove (2021) backwards supporting functionality from UniFi (#81981) 2022-11-16 12:49:10 +01:00
Robert Svensson 23bed25e52
Remove old UniFi POE client implementation (#81749)
Remove all references to POE client implementation
2022-11-08 07:48:54 +01:00
Robert Svensson 3444d2af1a
UniFi switch entity description (#81680)
* Consolidate switch entities to one class

* Move turn on/off into UnifiSwitchEntity

* Add event subscription
Remove storing entity for everything but legacy poe switch

* Only one entity class

* Improve generics naming

* Rename loader to description

* Improve control_fn naming

* Move wrongfully placed method that should only react to dpi apps being emptied

* Improve different methods

* Minor renaming and sorting

* Mark callbacks properly
2022-11-08 07:38:31 +01:00
Robert Svensson 115a1ceea0
Rewrite UniFi block client switch (#80969)
* Refactor UniFi block client switch entities

* Use new switch loader

* Rename lambdas

* Use is_on rather than _attr_is_on when applicable
2022-10-25 22:36:51 +02:00
Robert Svensson 03bf37e12c
Refactor UniFi DPI switch entities (#80761)
* Refactor UniFi DPI switch entities

* Remove dpi presence from items_added
2022-10-23 22:42:24 +02:00
Robert Svensson 0444dd71a6
Refactor UniFi outlet switches (#80738)
* Rewrite UniFi outlet switches

* Bump aiounifi to v41

* Remove devices from items_added input
2022-10-23 20:28:45 +02: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 04cdcad7f8
Expose UniFi PoE ports as individual switches (#80566)
* Add simple PoE control switches

* Add basic tests

* Complete testing

* Dont use port.up as part of available

* Bump aiounifi to v40
2022-10-19 19:54:40 +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
Erik Montnemery 3d723bddf8
Use mock_restore_cache in tests (#77298) 2022-08-25 09:28:53 +02:00
Jelte Zeilstra 5e10716dd8
Do not access hass.data in unifi test (#75348)
* Do not access hass.data in test

* Process review feedback
2022-07-23 12:42:43 +02:00
Robert Svensson 3144d179e0
Make UniFi utilise forward_entry_setups (#74835) 2022-07-18 10:39:38 -05:00
Jelte Zeilstra 514e826fed
Add install UniFi device update feature (#75302)
* Add install UniFi device update feature

* Add tests for install UniFi device update feature

* Fix type error

* Process review feedback

* Process review feedback
2022-07-16 20:39:11 +02:00
Franck Nijhof 7cd68381f1
Search/replace RESULT_TYPE_* by FlowResultType enum (#74642) 2022-07-07 19:57:36 +03:00
J. Nick Koston 1dd9e705f2
Switch dispatcher to use async_run_hass_job (#74514)
* Switch dispatcher to use async_run_hass_job

- Since we already wrap all the callbacks in catch_log_exception
  we can use async_run_hass_job here

- The overhead of wrapping the call in a call_soon, queuing it
  and running it later usually exceeds the overhead of running
  the job itself

* fix size change during iteration

* fix out of order send

* fix missing mocking in unifi test

* Fix Legrand Home+ Control updating entities before the coordinator update had finished

* stray debug
2022-07-07 10:39:05 -05:00
epenet f33151ff8b
Adjust config-flow type hints in unifi (#72411)
* Adjust config-flow type hints in unifi

* Use mapping

* Use mapping

* Fix tests

* Fix tests

* Revert "Use mapping"

This reverts commit 126fedc848.
2022-05-24 21:42:11 +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
Franck Nijhof c3d19f3827
Clean up accessing device_registry helpers via hass (#72031) 2022-05-17 12:22:15 -07: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 63e3095062
Abort UniFi Network options flow if integration is not setup (#71128) 2022-05-01 21:00:38 +02:00
Robert Svensson 46c2bd0eb0
Tweak UniFi client tracker (#67129) 2022-02-23 09:26:46 -10:00
Robert Svensson 69ac59ce73
Redact host address in UniFi diagnostics (#65379) 2022-02-01 09:52:56 -08:00
Paulus Schoutsen b05b4c4b38
Simplify unifi cleanup logic (#65345) 2022-02-01 07:22:12 +01:00
Robert Svensson da355438aa
Reconnect client service tried to connect even if device didn't exist (#65082) 2022-01-28 08:33:31 -08:00
Robert Svensson 046f0a706f
Add outlets to UniFi switch platform (#64859)
* Add outlets to UniFi switch platform

* Outlet shouldn't have entity category set
2022-01-25 07:49:02 +01: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
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 Svensson 7e20e555dd
Redact usernames in UniFi diagnostics (#64794) 2022-01-23 23:11:06 +01:00
Robert Svensson 20072140c6
Add diagnostics support to UniFi Network integration (#64640)
* Add diagnostics support to UniFi Network integration

* Remove system info

* Add test data before trying to redact sensitive information

* Redact sensitive information from config_entry.data

* Redact a lot of different parts of the device descriptions
Redact mac addresses in such a way its possible to still view topology
2022-01-23 13:44:43 +01:00
Robert Svensson 86d32b3440
Expose UniFi controller configuration url from discovered entry (#64514) 2022-01-20 09:34:54 +01:00
Robert Svensson bc7624b417
Fix UniFi remove client service if time stamps are not integers (#63998)
* Only calculate total time if first and last seen are ints, else remove client

* Update homeassistant/components/unifi/services.py

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* Update homeassistant/components/unifi/services.py

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2022-01-13 08:15:40 +01:00
Robert Svensson 59cea56e17
Fix reconnect rather than reauth when both HA and UniFi controller restarts at the same time (#63994) 2022-01-12 15:08:04 -08:00
Robert Svensson e37456fb36
Move DPI Group logic to UniFi switch platform (#58761)
* Library has normalized management of DPI apps and groups, move logic to UniFi integration

* Bump dependency to v29

* Use a generator instead of a list - Pylint

* Minor improvements

* Improve doc strings
2022-01-12 17:11:05 +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
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
epenet 9eed18f121
Use SsdpServiceInfo for ssdp tests (part 1) (#60320)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-11-25 14:35:19 +01:00
Paulus Schoutsen 442597928e
Store: copy pending data (#59934) 2021-11-18 15:56:22 -08:00
Robert Svensson f6e38fc4e2
Fix issue where UniFi DPI groups state wasn't being updated (#58502) 2021-10-27 10:35:44 +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 47f6313e5b
Add entity category to UniFi sensors and switches (#58484) 2021-10-26 20:23:20 +02:00
Ville Skyttä cc0c79ac9a
Use http.HTTPStatus in components/[tuv]* (#58325) 2021-10-24 11:27:17 +02:00
Robert Svensson 9c1bee9c16
Add support for device configuration URL to UniFi Controller (#58237) 2021-10-22 20:04:25 +02:00
Robert Svensson ed37d2a794
New service reconnect_client for UniFi integration (#57570)
* Initial proposal of a client reconnect service

* Slim setup and teardown of services

* Minor improvements

* Add tests
2021-10-18 08:06:06 +02:00