Skip to content

Commit fed171a

Browse files
authored
0.27.0 (#751)
* Fix some sensors shown when they should not for nodes, ap and mb (#740) * Add `device_internet_access` service for parental control rules (#743) * Update supported devices list (#745) * Fix issue with clients data mix (#746) * Add `remove_trackers` service (#747) * Add `block_internet` switches (#748) * Add `block_internet` global switch (#749) * Reload integration on more parameters change (#750) * Bump asusrouter to `1.6.0` * Bump version to `0.27.0` * Bump asusrouter to `1.6.1`
1 parent 625ea82 commit fed171a

File tree

22 files changed

+1012
-88
lines changed

22 files changed

+1012
-88
lines changed

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -86,37 +86,37 @@ AsusRouter supports virtually every AsusWRT-powered device.
8686
|[GT-AXE11000](https://asusrouter.vaskivskyi.com/devices/GT-AXE11000.html)|💛 Expected to work||<a href="https://amzn.to/3Gotj9R" rel="nofollow sponsored" target="_blank">find it</a>|
8787
|[GT-AXE16000](https://asusrouter.vaskivskyi.com/devices/GT-AXE16000.html)|💚 Confirmed|Stock:<li>`388.21617`</li>|<a href="https://amzn.to/3vObLyZ" rel="nofollow sponsored" target="_blank">find it</a>|
8888
|[RT-AXE7800](https://asusrouter.vaskivskyi.com/devices/RT-AXE7800.html)|💚 Confirmed|Stock:<li>`388_22068`</li>|<a href="https://amzn.to/3jUr2LU" rel="nofollow sponsored" target="_blank">find it</a>|
89-
|[ZenWiFi ET8](https://asusrouter.vaskivskyi.com/devices/ZenWiFiET8.html)|💛 Expected to work||<a href="https://amzn.to/3Iks0La" rel="nofollow sponsored" target="_blank">find it</a>|
90-
|[ZenWiFi Pro ET12](https://asusrouter.vaskivskyi.com/devices/ZenWiFiProET12.html)|💛 Expected to work||<a href="https://amzn.to/3GTz68P" rel="nofollow sponsored" target="_blank">find it</a>|
89+
|[ZenWiFi ET8](https://asusrouter.vaskivskyi.com/devices/ZenWiFiET8.html)|💚 Confirmed|Stock:<li>`388.23759`</li>|<a href="https://amzn.to/3Iks0La" rel="nofollow sponsored" target="_blank">find it</a>|
90+
|[ZenWiFi Pro ET12](https://asusrouter.vaskivskyi.com/devices/ZenWiFiProET12.html)|💚 Confirmed|Stock:<li>`388.23013`</li>|<a href="https://amzn.to/3GTz68P" rel="nofollow sponsored" target="_blank">find it</a>|
9191

9292
### WiFi 6 | 802.11ax
9393
|Model|Status|Tested firmware|Find it on Amazon[^amazon]|
9494
|---|---|---|---|
9595
|[DSL-AX82U](https://asusrouter.vaskivskyi.com/devices/DSL-AX82U.html)|💚 Confirmed|Merlin:<li>`386.07_0-gnuton0_beta2`</li>|<a href="https://amzn.to/3G87vyR" rel="nofollow sponsored" target="_blank">find it</a>|
96-
|[GT-AX11000](https://asusrouter.vaskivskyi.com/devices/GT-AX11000.html)|💚 Confirmed|Merlin:<li>`386.7_2`</li><li>`388.1_0`</li>|<a href="https://amzn.to/3WDzOMT" rel="nofollow sponsored" target="_blank">find it</a>|
97-
|[GT-AX11000 Pro](https://asusrouter.vaskivskyi.com/devices/GT-AX11000Pro.html)|💛 Expected to work||<a href="https://amzn.to/3VUNbHl" rel="nofollow sponsored" target="_blank">find it</a>|
96+
|[GT-AX11000](https://asusrouter.vaskivskyi.com/devices/GT-AX11000.html)|💚 Confirmed|Merlin:<li>`386.7_2`</li><li>`388.1_0`</li><li>`388.4_0`</li>|<a href="https://amzn.to/3WDzOMT" rel="nofollow sponsored" target="_blank">find it</a>|
97+
|[GT-AX11000 Pro](https://asusrouter.vaskivskyi.com/devices/GT-AX11000Pro.html)|💚 Confirmed|Stock:<li>`388.24198`</li>|<a href="https://amzn.to/3VUNbHl" rel="nofollow sponsored" target="_blank">find it</a>|
9898
|[GT-AX6000](https://asusrouter.vaskivskyi.com/devices/GT-AX6000.html)|💛 Expected to work||<a href="https://amzn.to/3GrKHKG" rel="nofollow sponsored" target="_blank">find it</a>|
9999
|[GT6](https://asusrouter.vaskivskyi.com/devices/GT6.html)|💛 Expected to work||<a href="https://amzn.to/3GmPCfR" rel="nofollow sponsored" target="_blank">find it</a>|
100100
|[RT-AX52](https://asusrouter.vaskivskyi.com/devices/RT-AX52.html)|💛 Expected to work||<a href="https://amzn.to/40Ph3sO" rel="nofollow sponsored" target="_blank">find it</a>|
101101
|[RT-AX53U](https://asusrouter.vaskivskyi.com/devices/RT-AX53U.html)|💚 Confirmed|Stock:<li>`386.69061`</li>|<a href="https://amzn.to/49jEgqO" rel="nofollow sponsored" target="_blank">find it</a>|
102-
|[RT-AX55](https://asusrouter.vaskivskyi.com/devices/RT-AX55.html)|💚 Confirmed|Stock:<li>`386.50410`</li>|<a href="https://amzn.to/3Z2ath5" rel="nofollow sponsored" target="_blank">find it</a>|
103-
|[RT-AX56U](https://asusrouter.vaskivskyi.com/devices/RT-AX56U.html)|💚 Confirmed|Merlin:<li>`386.7_2`</li>|<a href="https://amzn.to/3vrIeuz" rel="nofollow sponsored" target="_blank">find it</a>|
102+
|[RT-AX55](https://asusrouter.vaskivskyi.com/devices/RT-AX55.html)|💚 Confirmed|Stock:<li>`386.50410`</li><li>`386.52041`</li>|<a href="https://amzn.to/3Z2ath5" rel="nofollow sponsored" target="_blank">find it</a>|
103+
|[RT-AX56U](https://asusrouter.vaskivskyi.com/devices/RT-AX56U.html)|💚 Confirmed|Merlin:<li>`386.7_2`</li><li>`388.1_0`</li><li>`388.2_2`</li>|<a href="https://amzn.to/3vrIeuz" rel="nofollow sponsored" target="_blank">find it</a>|
104104
|[RT-AX57](https://asusrouter.vaskivskyi.com/devices/RT-AX57.html)|💛 Expected to work||<a href="https://amzn.to/3IWnZNx" rel="nofollow sponsored" target="_blank">find it</a>|
105105
|[RT-AX57 Go](https://asusrouter.vaskivskyi.com/devices/RT-AX57Go.html)|💛 Expected to work||<a href="https://amzn.to/47kE9db" rel="nofollow sponsored" target="_blank">find it</a>|
106-
|[RT-AX58U](https://asusrouter.vaskivskyi.com/devices/RT-AX58U.html)|💚 Confirmed|Stock:<li>`386.49674`</li><li>`388.22237`</li>Merlin:<li>`386.7_2`</li><li>`388.1_0`</li>|<a href="https://amzn.to/3jHri0L" rel="nofollow sponsored" target="_blank">find it</a>|
106+
|[RT-AX58U](https://asusrouter.vaskivskyi.com/devices/RT-AX58U.html)|💚 Confirmed|Stock:<li>`386.49674`</li><li>`388.22237`</li>Merlin:<li>`386.7_2`</li><li>`388.1_0`</li><li>`388.4_0`</li>|<a href="https://amzn.to/3jHri0L" rel="nofollow sponsored" target="_blank">find it</a>|
107107
|[RT-AX59U](https://asusrouter.vaskivskyi.com/devices/RT-AX59U.html)|💛 Expected to work||<a href="https://amzn.to/3CVCVYO" rel="nofollow sponsored" target="_blank">find it</a>|
108108
|[RT-AX68U](https://asusrouter.vaskivskyi.com/devices/RT-AX68U.html)|💚 Confirmed|Stock:<li>`388.21732`</li>|<a href="https://amzn.to/3WzRwk5" rel="nofollow sponsored" target="_blank">find it</a>|
109109
|[RT-AX82U](https://asusrouter.vaskivskyi.com/devices/RT-AX82U.html)|💚 Confirmed|Stock:<li>`386.48664`</li><li>`386.49674`</li>|<a href="https://amzn.to/3Gv2Bxi" rel="nofollow sponsored" target="_blank">find it</a>|
110110
|[RT-AX86S](https://asusrouter.vaskivskyi.com/devices/RT-AX86S.html)|💚 Confirmed|Stock:<li>`386.46061`</li><li>`386.48260`</li><li>`386.49447`</li><li>`388.22525`</li>Merlin:<li>`386.7_2`</li>|<a href="https://amzn.to/3GuKac5" rel="nofollow sponsored" target="_blank">find it</a>|
111-
|[RT-AX86U](https://asusrouter.vaskivskyi.com/devices/RT-AX86U.html)|💚 Confirmed|Stock:<li>`386.46061`</li><li>`386.48260`</li><li>`386.49447`</li><li>`388.22525`</li>Merlin:<li>`386.7_2`</li>|<a href="https://amzn.to/3WCBcPO" rel="nofollow sponsored" target="_blank">find it</a>|
111+
|[RT-AX86U](https://asusrouter.vaskivskyi.com/devices/RT-AX86U.html)|💚 Confirmed|Stock:<li>`386.46061`</li><li>`386.48260`</li><li>`386.49447`</li><li>`388.22525`</li>Merlin:<li>`386.7_2`</li><li>`388.4_0`</li>|<a href="https://amzn.to/3WCBcPO" rel="nofollow sponsored" target="_blank">find it</a>|
112112
|[RT-AX86U Pro](https://asusrouter.vaskivskyi.com/devices/RT-AX86UPro.html)|💚 Confirmed|Stock:<li>`388.23565`</li>|<a href="https://amzn.to/3ZDM41T" rel="nofollow sponsored" target="_blank">find it</a>|
113113
|[RT-AX88U](https://asusrouter.vaskivskyi.com/devices/RT-AX88U.html)|💚 Confirmed|Stock:<li>`386.45934`</li><li>`386.48631`</li><li>`388.24198`</li>Merlin:<li>`386.5_2`</li><li>`386.8_0`</li><li>`388.1_0`</li><li>`388.2_0`</li><li>`388.4_0`</li>|<a href="https://amzn.to/3i2VfYu" rel="nofollow sponsored" target="_blank">find it</a>|
114-
|[RT-AX88U Pro](https://asusrouter.vaskivskyi.com/devices/RT-AX88UPro.html)|💛 Expected to work||<a href="https://amzn.to/3QNDpFZ" rel="nofollow sponsored" target="_blank">find it</a>|
114+
|[RT-AX88U Pro](https://asusrouter.vaskivskyi.com/devices/RT-AX88UPro.html)|💚 Confirmed|Merlin:<li>`388.4_0`</li>|<a href="https://amzn.to/3QNDpFZ" rel="nofollow sponsored" target="_blank">find it</a>|
115115
|[RT-AX89X](https://asusrouter.vaskivskyi.com/devices/RT-AX89X.html)|💚 Confirmed||<a href="https://amzn.to/3i55b3S" rel="nofollow sponsored" target="_blank">find it</a>|
116116
|[RT-AX92U](https://asusrouter.vaskivskyi.com/devices/RT-AX92U.html)|💚 Confirmed|Stock:<li>`386.46061`</li>|<a href="https://amzn.to/3jJJgzt" rel="nofollow sponsored" target="_blank">find it</a>|
117117
|[TUF-AX3000 V2](https://asusrouter.vaskivskyi.com/devices/TUF-AX3000V2.html)|💚 Confirmed|Stock:<li>`388.23785`</li>|<a href="https://amzn.to/3QzzD4C" rel="nofollow sponsored" target="_blank">find it</a>|
118118
|[TUF-AX4200](https://asusrouter.vaskivskyi.com/devices/TUF-AX4200.html)|💛 Expected to work||<a href="https://amzn.to/3kexPjC" rel="nofollow sponsored" target="_blank">find it</a>|
119-
|[TUF-AX5400](https://asusrouter.vaskivskyi.com/devices/TUF-AX5400.html)|💚 Confirmed|Stock:<li>`386.50224`</li><li>`388.21224`</li><li>`388.22525`</li>|<a href="https://amzn.to/3hXgzyQ" rel="nofollow sponsored" target="_blank">find it</a>|
119+
|[TUF-AX5400](https://asusrouter.vaskivskyi.com/devices/TUF-AX5400.html)|💚 Confirmed|Stock:<li>`386.50224`</li><li>`388.21224`</li><li>`388.22525`</li><li>`388.23285`</li>Merlin:<li>`388.4_0`</li>|<a href="https://amzn.to/3hXgzyQ" rel="nofollow sponsored" target="_blank">find it</a>|
120120
|[TUF-AX6000](https://asusrouter.vaskivskyi.com/devices/TUF-AX6000.html)|💚 Confirmed|Stock:<li>`388.32432`</li>|<a href="https://amzn.to/3CXqxaG" rel="nofollow sponsored" target="_blank">find it</a>|
121121
|[ZenWiFi AX (XT8)](https://asusrouter.vaskivskyi.com/devices/ZenWiFiAX(XT8).html)|💚 Confirmed|Stock:<li>`386.48706`</li><li>`388.23285`</li>Merlin:<li>`386.7_2-gnuton1`</li>|<a href="https://amzn.to/3GuvY2L" rel="nofollow sponsored" target="_blank">find it</a>|
122122
|[ZenWiFi AX Hybrid (XP4)](https://asusrouter.vaskivskyi.com/devices/ZenWiFiAXHybrid(XP4).html)|💛 Expected to work||<a href="https://amzn.to/3Itxnbb" rel="nofollow sponsored" target="_blank">find it</a>|
@@ -132,7 +132,7 @@ AsusRouter supports virtually every AsusWRT-powered device.
132132
### WiFi 5 | 802.11ac
133133
|Model|Status|Tested firmware|Find it on Amazon[^amazon]|
134134
|---|---|---|---|
135-
|[4G-AC55U](https://asusrouter.vaskivskyi.com/devices/4G-AC55U.html)|💚 Confirmed||<a href="https://amzn.to/3jIWQDu" rel="nofollow sponsored" target="_blank">find it</a>|
135+
|[4G-AC55U](https://asusrouter.vaskivskyi.com/devices/4G-AC55U.html)|💚 Confirmed|Stock:<li>`380.8102`</li>|<a href="https://amzn.to/3jIWQDu" rel="nofollow sponsored" target="_blank">find it</a>|
136136
|[DSL-AC68U](https://asusrouter.vaskivskyi.com/devices/DSL-AC68U.html)|💚 Confirmed|Stock:<li>`386.47534`</li><li>`386.50117`</li>Merlin:<li>`386.4-gnuton2`</li><li>`386.7_2-gnuton1`</li>|<a href="https://amzn.to/3Z5k32H" rel="nofollow sponsored" target="_blank">find it</a>|
137137
|[RT-AC51U](https://asusrouter.vaskivskyi.com/devices/RT-AC51U.html)|💚 Confirmed|Stock:<li>`380.8591`</li>|<a href="https://amzn.to/3WMy2sq" rel="nofollow sponsored" target="_blank">find it</a>|
138138
|[RT-AC52U B1](https://asusrouter.vaskivskyi.com/devices/RT-AC52UB1.html)|💚 Confirmed||<a href="https://amzn.to/3QcrCkk" rel="nofollow sponsored" target="_blank">find it</a>|
@@ -145,7 +145,7 @@ AsusRouter supports virtually every AsusWRT-powered device.
145145
|[RT-AC85P](https://asusrouter.vaskivskyi.com/devices/RT-AC85P.html)|💚 Confirmed|Stock:<li>`382.52516`</li>|<a href="https://amzn.to/3kMiDdU" rel="nofollow sponsored" target="_blank">find it</a>|
146146
|[RT-AC86U](https://asusrouter.vaskivskyi.com/devices/RT-AC86U.html)|💚 Confirmed|Stock:<li>`386.48260`</li><li>`386.49709`</li>Merlin:<li>`386.7_0`</li><li>`386.7_2`</li><li>`386.9_0`</li>|<a href="https://amzn.to/3CbRarK" rel="nofollow sponsored" target="_blank">find it</a>|
147147
|[RT-AC87U](https://asusrouter.vaskivskyi.com/devices/RT-AC87U.html)|💚 Confirmed|Merlin:<li>`384.13_10`</li>|<a href="https://amzn.to/3i4sUkE" rel="nofollow sponsored" target="_blank">find it</a>|
148-
|[RT-AC88U](https://asusrouter.vaskivskyi.com/devices/RT-AC88U.html)|💚 Confirmed|Stock:<li>`386.48260`</li>Merlin:<li>`386.5_0`</li><li>`386.7_beta1`</li>|<a href="https://amzn.to/3FYRYBy" rel="nofollow sponsored" target="_blank">find it</a>|
148+
|[RT-AC88U](https://asusrouter.vaskivskyi.com/devices/RT-AC88U.html)|💚 Confirmed|Stock:<li>`386.48260`</li>Merlin:<li>`386.5_0`</li><li>`386.7_beta1`</li><li>`386.12_2`</li>|<a href="https://amzn.to/3FYRYBy" rel="nofollow sponsored" target="_blank">find it</a>|
149149
|[RT-ACRH17](https://asusrouter.vaskivskyi.com/devices/RT-ACRH17.html)|💚 Confirmed|Stock:<li>`382.52517`</li>|<a href="https://amzn.to/3i6dWL0" rel="nofollow sponsored" target="_blank">find it</a>|
150150
|[ZenWiFi AC Mini(CD6)](https://asusrouter.vaskivskyi.com/devices/ZenWiFiACMini(CD6).html)|💛 Expected to work||<a href="https://amzn.to/3RU7vrL" rel="nofollow sponsored" target="_blank">find it</a>|
151151

custom_components/asusrouter/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from homeassistant.config_entries import ConfigEntry
88
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
99
from homeassistant.core import HomeAssistant
10+
from homeassistant.helpers.device_registry import DeviceEntry
1011

1112
from .const import ASUSROUTER, DOMAIN, PLATFORMS, STOP_LISTENER
1213
from .router import ARDevice
@@ -84,6 +85,7 @@ async def update_listener(
8485
# Example migration function
8586
async def async_migrate_entry(hass, config_entry: ConfigEntry):
8687
"""Migrate old entry."""
88+
8789
_LOGGER.debug("Migrating from version %s", config_entry.version)
8890

8991
if config_entry.version == 4:
@@ -96,3 +98,15 @@ async def async_migrate_entry(hass, config_entry: ConfigEntry):
9698
_LOGGER.debug("Migration to version %s successful", config_entry.version)
9799

98100
return True
101+
102+
103+
async def async_remove_config_entry_device(
104+
hass: HomeAssistant, config_entry: ConfigEntry, device_entry: DeviceEntry
105+
) -> bool:
106+
"""Remove a device."""
107+
108+
# This would actually work and should not provide any issues
109+
110+
_LOGGER.debug("Removing device")
111+
112+
return True

custom_components/asusrouter/bridge.py

Lines changed: 90 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
convert_to_ha_state_bool,
2020
)
2121
from asusrouter.modules.identity import AsusDevice
22+
from asusrouter.modules.parental_control import ParentalControlRule, PCRuleType
2223
from homeassistant.const import (
2324
CONF_HOST,
2425
CONF_PASSWORD,
@@ -27,6 +28,7 @@
2728
CONF_USERNAME,
2829
)
2930
from homeassistant.core import HomeAssistant
31+
from homeassistant.helpers import entity_registry as er
3032
from homeassistant.helpers.aiohttp_client import async_create_clientsession
3133
from homeassistant.helpers.update_coordinator import UpdateFailed
3234

@@ -415,16 +417,19 @@ def _process_data_modern(raw: dict[str, Any]) -> dict[str, Any]:
415417
def _process_data_parental_control(raw: dict[str, Any]) -> dict[str, Any]:
416418
"""Process `parental control` data."""
417419

418-
data: dict[str, Any] = {}
419-
data[STATE] = convert_to_ha_state_bool(raw.get(STATE))
420-
devices = []
420+
rules_list = []
421421
rules = raw.get("rules")
422422
if rules is not None:
423423
for rule in raw["rules"]:
424424
device = dataclasses.asdict(raw["rules"][rule])
425425
device.pop("timemap")
426-
devices.append(device)
427-
data[LIST] = devices.copy()
426+
device["type"] = device["type"].name.lower()
427+
rules_list.append(device)
428+
429+
data = convert_to_ha_data(raw)
430+
data["list"] = rules_list.copy()
431+
data["block_all"] = convert_to_ha_state_bool(raw.get("block_all"))
432+
428433
return data
429434

430435
@staticmethod
@@ -572,3 +577,83 @@ def _process_sensors_ovpn_server(raw: dict[str, Any]) -> list[str]:
572577
return convert_to_ha_sensors(raw, AsusData.OPENVPN_SERVER)
573578

574579
# <- PROCESS SENSORS LIST
580+
581+
# --------------------
582+
# Services -->
583+
# --------------------
584+
585+
def _pc_device2rule(
586+
self, device: dict[str, Any], rule_type: PCRuleType
587+
) -> Optional[ParentalControlRule]:
588+
"""Convert device to parental control rule."""
589+
590+
mac = device.get("mac", None)
591+
592+
if mac is None:
593+
return None
594+
595+
return ParentalControlRule(
596+
mac=mac.upper(),
597+
name=device.get("name", None),
598+
type=rule_type,
599+
)
600+
601+
async def async_pc_rule(self, **kwargs: Any) -> bool:
602+
"""Change parental control rule(s)."""
603+
604+
# Get the passed data
605+
raw = kwargs.get("raw", None)
606+
607+
# Abort if no data is passed
608+
if raw is None:
609+
return False
610+
611+
# Get the state to set
612+
state = raw.get("state", None)
613+
match state:
614+
case a if a in ("disable", "allow"):
615+
rule_type = PCRuleType.DISABLE
616+
case "block":
617+
rule_type = PCRuleType.BLOCK
618+
case "remove":
619+
rule_type = PCRuleType.REMOVE
620+
case _:
621+
_LOGGER.warning("Unknown parental control state: %s", state)
622+
return False
623+
624+
# Get the targets to set
625+
devices = raw.get("devices", [])
626+
entities = raw.get("entities", [])
627+
628+
# Prepare the rules list
629+
rules_to_set = []
630+
631+
# Process entities if any
632+
if len(entities) > 0:
633+
entity_reg = er.async_get(self.hass)
634+
for entity in entities:
635+
reg_value = entity_reg.async_get(entity)
636+
if not isinstance(reg_value, er.RegistryEntry):
637+
continue
638+
capabilities: dict[str, Any] = helpers.as_dict(reg_value.capabilities)
639+
devices.append(capabilities)
640+
641+
# Convert devices to rules
642+
for device in devices:
643+
rule = self._pc_device2rule(device, rule_type)
644+
if rule is not None:
645+
rules_to_set.append(rule)
646+
647+
# Set the rules
648+
for rule in rules_to_set:
649+
result = await self.api.async_set_state(rule)
650+
if result is True:
651+
_LOGGER.debug("Parental control rule set: %s", rule)
652+
else:
653+
_LOGGER.warning("Cannot set parental control rule: %s", rule)
654+
655+
return True
656+
657+
# --------------------
658+
# <-- Services
659+
# --------------------

custom_components/asusrouter/client.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,6 @@
2525
class ARClient:
2626
"""AsussRouter Client class."""
2727

28-
# To be recieved from the device
29-
# Client description
30-
description: Optional[AsusClientDescription] = None
31-
# Connection description - AsusClientConnection / AsusClientConnectionWlan
32-
connection: Optional[AsusClientConnection] = None
33-
34-
# To be generated for other parts of the integration
35-
_identity: Optional[dict[str, Any]] = None
36-
_extra_state_attributes: dict[str, Any] = {}
37-
38-
# Connection state
39-
_state: ConnectionState = ConnectionState.UNKNOWN
40-
41-
# Device last active
42-
_last_activity: Optional[datetime] = None
43-
4428
def __init__(
4529
self,
4630
mac: str,
@@ -51,6 +35,22 @@ def __init__(
5135
self._mac = mac
5236
self._name = name
5337

38+
# To be recieved from the device
39+
# Client description
40+
self.description: Optional[AsusClientDescription] = None
41+
# Connection description - AsusClientConnection / AsusClientConnectionWlan
42+
self.connection: Optional[AsusClientConnection] = None
43+
44+
# To be generated for other parts of the integration
45+
self._identity: Optional[dict[str, Any]] = None
46+
self._extra_state_attributes: dict[str, Any] = {}
47+
48+
# Connection state
49+
self._state: ConnectionState = ConnectionState.UNKNOWN
50+
51+
# Device last active
52+
self._last_activity: Optional[datetime] = None
53+
5454
@callback
5555
def update(
5656
self,

custom_components/asusrouter/config_flow.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@
3333
BASE,
3434
CONF_CACHE_TIME,
3535
CONF_CONSIDER_HOME,
36+
CONF_CREATE_DEVICES,
3637
CONF_DEFAULT_CACHE_TIME,
3738
CONF_DEFAULT_CONSIDER_HOME,
39+
CONF_DEFAULT_CREATE_DEVICES,
3840
CONF_DEFAULT_EVENT,
3941
CONF_DEFAULT_FORCE_CLIENTS,
4042
CONF_DEFAULT_FORCE_CLIENTS_WAITTIME,
@@ -406,6 +408,18 @@ def _create_form_connected_devices(
406408
}
407409
)
408410

411+
if mode in (ACCESS_POINT, MEDIA_BRIDGE, ROUTER):
412+
schema.update(
413+
{
414+
vol.Required(
415+
CONF_CREATE_DEVICES,
416+
default=user_input.get(
417+
CONF_CREATE_DEVICES, CONF_DEFAULT_CREATE_DEVICES
418+
),
419+
): cv.boolean,
420+
}
421+
)
422+
409423
return vol.Schema(schema)
410424

411425

0 commit comments

Comments
 (0)