Closed swoga closed 1 month ago
Awesome! I'll get back to you during the weekend, you can start by adding a test that covers this situation
added a test! do you happen to have a payload for Axis OS < 11.11 so we can test for regression?
added a test! do you happen to have a payload for Axis OS < 11.11 so we can test for regression?
I'll try to fix one tomorrow, is it a property changed you want? what should the configuration be?
I'll try to fix one tomorrow, is it a property changed you want? what should the configuration be?
After further thinking, I don't think we need a payload to test for backwards compatibility after this fix, this should have already been done by other test payloads (like VMD4_ANY_CHANGE
).
I have corrected the formatting objected to by the workflow and pushed the branch.
rewrote filter to generator expression: https://github.com/python/mypy/issues/12682#issuecomment-1856012357
- item = next(filter(lambda x: x.get("@Name", "") == prefer, item), item[0])
+ item = next(
+ (item for item in item if item.get("@Name", "") == prefer), item[0]
+ )
I will try to get back to you by tomorrow night
Just a note in case it becomes relevant later, this issue resolved itself on my Axis cameras before the version with this fix was rolled out.
I have changed a few other (seemingly unrelated) settings on the cameras and also restarted them a few times.
Suddenly the SimpleItems are again in a sequence (active
in first place) where they can be correctly evaluated by the previous logic.
If it happened once it can happen again. So its good to keep. Thanks for the update
fixes: https://github.com/home-assistant/core/issues/123617
Starting with Axis OS 11.11, several SimpleItem entries are sent, which means that the existing method of determining the value fails.
I have extended
extract_name_value
to prefer a certain SimpleItemactive
if it exists. I have tried to keep it as downward compatible as possible, but I can only test with Axis OS 11.11.109 and ObjectAnalytics.payload example: