Closed Tinigriffy closed 8 months ago
How about always converting the x['mac']
to a list and then doing mac in string_to_list(x['mac'])
?
That way an entry with multiple macs can be matched.
I did it this way because I did not understood what the structure could return and how the lamba will behave :). I was wondering if it should not be reported as bug to openwrt. From my perspective, I would expect that the api always returns a list. So I took the simplest approach to fix the issue for me :) But I totally agree this is not the most robust way to handle this case. May be something like str(x['mac']).upper().find(mac) could work in all cases.
... May be something like str(x['mac']).upper().find(mac) could work in all cases.
I tried this new approach on the new HA version 2024.2.0 and it seems to work
i think we need a new version number so that it can be included in forthcoming ha releases ... ?
i think we need a new version number so that it can be included in forthcoming ha releases ... ?
Yes, I've just fixed the test case that caused the CI failure and released version 1.1.17. Feel free to try it out and provide feedback.
Fix for Luci device tracker: AttributeError: 'list' object has no attribute 'upper' #60 It seems that openwrt can now send a list or a string and this is not handled. Fix it.