added utility to make macs loggable
This commit is contained in:
1 parent
e0c7ada147
commit
43be1e1dbe
10 files changed
+57
-42
No files matched your search
@@ -12,7 +12,7 @@ from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity import DeviceInfo
|
||||
from homeassistant.exceptions import ConfigEntryNotReady
|
||||
|
||||
from .const import CONF_PERSISTANT_CONN, CONF_POLLING_INTERVAL, DATA_COORDINATOR, DOMAIN, MANUFACTURER, CONF_USE_CONTROLS, DATA_POLLING_RUNNING
|
||||
from .const import CONF_PERSISTENT_CONN, CONF_POLLING_INTERVAL, DATA_COORDINATOR, DOMAIN, MANUFACTURER, CONF_USE_CONTROLS, DATA_POLLING_RUNNING
|
||||
from .coordinator import PollingCoordinator
|
||||
|
||||
PLATFORMS: [Platform] = [Platform.BINARY_SENSOR, Platform.SENSOR]
|
||||
@@ -26,12 +26,12 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
device_name = entry.data.get(CONF_NAME)
|
||||
use_controls = entry.data.get(CONF_USE_CONTROLS)
|
||||
polling_interval = entry.data.get(CONF_POLLING_INTERVAL, 20)
|
||||
persistant_conn = entry.data.get(CONF_PERSISTANT_CONN, False)
|
||||
persistent_conn = entry.data.get(CONF_PERSISTENT_CONN, False)
|
||||
|
||||
# Prevent persistant connection and controls at same time
|
||||
if use_controls is True and persistant_conn is True:
|
||||
if use_controls is True and persistent_conn is True:
|
||||
_LOGGER.warning("Enabling controls and persistant connection at the same time is currently not supported. Disabled persistant connection")
|
||||
persistant_conn = False
|
||||
persistent_conn = False
|
||||
|
||||
if address is None:
|
||||
return False
|
||||
@@ -45,7 +45,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
hass.data[DOMAIN][entry.entry_id].setdefault(DATA_POLLING_RUNNING, False)
|
||||
|
||||
# Create coordinator for polling
|
||||
coordinator = PollingCoordinator(hass, address, device_name, polling_interval, persistant_conn)
|
||||
coordinator = PollingCoordinator(hass, address, device_name, polling_interval, persistent_conn)
|
||||
await coordinator.async_config_entry_first_refresh()
|
||||
hass.data[DOMAIN][entry.entry_id].setdefault(DATA_COORDINATOR, coordinator)
|
||||
|
||||
|
||||
Reference in new issue
Block a user