tomaae / homeassistant-mikrotik_router

Mikrotik router integration for Home Assistant
Apache License 2.0
302 stars 51 forks source link

Duplicate Filter rule check are not correct #331

Closed palex closed 10 months ago

palex commented 10 months ago

Describe the issue

If some firewall rules uses only EXTRA options there are deleted as a duplicate rules because not all fields are used as an id.

How to reproduce the issue

Create more rules uses only EXTRA options in mikrotik (for example SRC MAC)

Expected behavior

Add all rules as a switch

Software versions

I patch this issue with adding .id in val_proc combination in coordinator.py about line 1145.

tomaae commented 10 months ago

this is normal, we cannot use all fields when building unique ID. if you have these edge cases and you need to control it from ha, add in a variable from unique id list. there are always some that will not affect how the rule works. .id in filters is dynamic (in all firewall related lists), so it cannot be used.