[SK] implement cancel & cancelAll timer intents #2846
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
I'm continuing with timer intents implementation for slovak language. Now I implemented cancel and cancelAll intents.
I found a small issue during the implementation with timer intent testing. There is an issue with resolving area aliases when working with timers. Specifically when I tried to cancel all timers in a specific area the area slot was not correctly resolved if area alias was used. The issue is caused in function get_matched_timers where timers are filtered by
timers = [t for t in timers if t.area == areaSlot]
where:so final comparison is something like "kuchy(ňa|ni|ne|ňu|nsk(ý|é))" == "kuchyni" which is obviously always false so no timer is ever canceled. I'm not sure about actual implementation or slot resolving in HA itself as I'm not familiar with the codebase yet, but from what I was able to figure out very similar code is used in HA implementation itself.
Adjusting this code to accomodate aliases would break at least few other language tests as the timer would be correctly found and cancelled so responses would change from 0 cancelled timers to at least one.
I'm not sure how to proceed with this issue or if we will just ignore it.