mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-08-09 12:24:43 +02:00
Changed mangle name to be more user friendly #75
This commit is contained in:
parent
88c79bcada
commit
ec1788ad3a
2 changed files with 20 additions and 11 deletions
|
@ -850,7 +850,7 @@ class MikrotikControllerData:
|
|||
],
|
||||
val_proc=[
|
||||
[
|
||||
{"name": "name"},
|
||||
{"name": "uniq-id"},
|
||||
{"action": "combine"},
|
||||
{"key": "chain"},
|
||||
{"text": ","},
|
||||
|
@ -865,7 +865,16 @@ class MikrotikControllerData:
|
|||
{"key": "dst-address"},
|
||||
{"text": ":"},
|
||||
{"key": "dst-port"},
|
||||
]
|
||||
],
|
||||
[
|
||||
{"name": "name"},
|
||||
{"action": "combine"},
|
||||
{"key": "action"},
|
||||
{"text": ","},
|
||||
{"key": "protocol"},
|
||||
{"text": ":"},
|
||||
{"key": "dst-port"},
|
||||
],
|
||||
],
|
||||
skip=[
|
||||
{"name": "dynamic", "value": True},
|
||||
|
@ -877,7 +886,7 @@ class MikrotikControllerData:
|
|||
mangle_uniq = {}
|
||||
mangle_del = {}
|
||||
for uid in self.data["mangle"]:
|
||||
tmp_name = self.data["mangle"][uid]["name"]
|
||||
tmp_name = self.data["mangle"][uid]["uniq-id"]
|
||||
if tmp_name not in mangle_uniq:
|
||||
mangle_uniq[tmp_name] = uid
|
||||
else:
|
||||
|
@ -885,8 +894,8 @@ class MikrotikControllerData:
|
|||
mangle_del[mangle_uniq[tmp_name]] = 1
|
||||
|
||||
for uid in mangle_del:
|
||||
if self.data["mangle"][uid]["name"] not in self.mangle_removed:
|
||||
self.mangle_removed[self.data["mangle"][uid]["name"]] = 1
|
||||
if self.data["mangle"][uid]["uniq-id"] not in self.mangle_removed:
|
||||
self.mangle_removed[self.data["mangle"][uid]["uniq-id"]] = 1
|
||||
_LOGGER.error(
|
||||
"Mikrotik %s duplicate Mangle rule %s, entity will be unavailable.",
|
||||
self.host,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue