tomaae / homeassistant-mikrotik_router

Mikrotik router integration for Home Assistant
Apache License 2.0
309 stars 53 forks source link

Added logging of the Filter ID #205

Closed SamJongenelen closed 2 years ago

SamJongenelen commented 2 years ago

Proposed change

When having a lot of filter rules, the auto-generated names of the filter rules aren't easy to find in the Winbox UI. The follow log was displayed:

Mikrotik x.x.x.x duplicate Filter rule accept,any:any, entity will be unavailable. Mikrotik x.x.x.x duplicate Filter rule drop,any:any, entity will be unavailable.

I had to download the API JSON to find out the name was exactly that ("accept;any:any"). I thought it would be helpful if the (duplicate) ID would be logged as well.

Type of change

Additional information

Checklist

SamJongenelen commented 2 years ago

I wasn't able test NAT or other collections (as I do not use it my json collection was empty). I'm guessing there will be an .id property there too, so we can add them there as well

tomaae commented 2 years ago

yes, id is in all of them, but it is dynamic. thats why we cannot use it as uid for HA. You can see right above where it is included in api_parse. do you want to append it to this PR?

SamJongenelen commented 2 years ago

Sorry i dont understand the question :) I only need the id to determine which filter rule it was. If i reorder the id will change right? Thats fine by me

tomaae commented 2 years ago

ah okey, I thought you wanted to add the same to other places.