Merge UniFi device tracker to config entry (#24367)
* Move device tracker to use config entry * Remove monitored conditions attributes based on ADR0003 * Add support for import of device tracker config to be backwards compatible * Remove unnecessary configuration options from device tracker * Add component configuration support
This commit is contained in:
1 parent
3480e6229a
commit
01b890f426
11 files changed
+493
-449
No files matched your search
@@ -1,5 +1,4 @@
|
||||
"""Support for devices connected to UniFi POE."""
|
||||
from datetime import timedelta
|
||||
import logging
|
||||
|
||||
from homeassistant.components import unifi
|
||||
@@ -11,8 +10,6 @@ from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||
|
||||
from .const import CONF_CONTROLLER, CONF_SITE_ID, CONTROLLER_ID
|
||||
|
||||
SCAN_INTERVAL = timedelta(seconds=15)
|
||||
|
||||
LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -32,6 +29,10 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
||||
site=config_entry.data[CONF_CONTROLLER][CONF_SITE_ID],
|
||||
)
|
||||
controller = hass.data[unifi.DOMAIN][controller_id]
|
||||
|
||||
if controller.site_role != 'admin':
|
||||
return
|
||||
|
||||
switches = {}
|
||||
|
||||
@callback
|
||||
|
||||
Reference in new issue
Block a user