Closed jlpouffier closed 4 months ago
tests/fr/homeassistant_HassUnpauseTimer.yaml (1)
`22-22`: The inclusion of both "min" and "minutes" ensures compatibility with varied user inputs. Ensure that both forms are correctly recognized and handled by the intent processing logic.Verification successful
--- The inclusion of both "min" and "minutes" ensures compatibility with varied user inputs. The intent processing logic correctly handles both forms of input for the duration slot.Scripts executed
The following scripts were executed for the analysis: --- Script: ```shell #!/bin/bash # Description: Verify that both "min" and "minutes" are correctly handled. # Test: Search for function handling in the intent processing code. rg --type yaml 'HassUnpauseTimer' --context 10 ``` Length of output: 20881tests/fr/homeassistant_HassCancelTimer.yaml (1)
`26-26`: Standardizing on "min" for minutes aligns with the PR's objectives and enhances consistency. Ensure that the abbreviation is consistently used across all related functionalities.tests/fr/homeassistant_HassDecreaseTimer.yaml (1)
`7-7`: Including both "min" and "minute" ensures compatibility with varied user inputs. Ensure that both forms are correctly recognized and handled by the intent processing logic. Also applies to: 19-19, 30-30Verification successful
--- The intent processing logic for `HassDecreaseTimer` correctly handles both "min" and "minute". - `tests/fr/homeassistant_HassDecreaseTimer.yaml` includes test cases for both "min" and "minute".Scripts executed
The following scripts were executed for the analysis: --- Script: ```shell #!/bin/bash # Description: Verify that both "min" and "minute" are correctly handled. # Test: Search for function handling in the intent processing code. rg --type yaml 'HassDecreaseTimer' --context 10 ``` Length of output: 26330tests/fr/homeassistant_HassIncreaseTimer.yaml (1)
`6-6`: Including both "min" and "minute" ensures compatibility with varied user inputs. Ensure that both forms are correctly recognized and handled by the intent processing logic. Also applies to: 19-19, 30-31, 42-42tests/fr/homeassistant_HassPauseTimer.yaml (1)
`29-31`: Updated phrases for consistency in timer duration representation.tests/fr/homeassistant_HassTimerStatus.yaml (1)
`29-29`: Updated phrase for consistency in timer duration representation.tests/fr/homeassistant_HassStartTimer.yaml (1)
`6-8`: Standardized the representation of time units and enhanced clarity in timer names for better STT recognition. Also applies to: 17-24, 26-37, 49-52, 62-70, 77-101, 111-137sentences/fr/_common.yaml (2)
`312-314`: Updated error messages to be more specific about timer issues. --- Line range hint `638-737`: Added comprehensive timer configurations for handling both numerical and literal values in French, enhancing the system's ability to understand and process timer-related commands in natural language.
Context
Timers in French were completely broken (mostly because I went way to fast on my first PR)
Issues
The standard STT engine of HA Cloud yields very complex results regarding time. It was challenging to fix.
Here are a few examples:
1
is almost always literal.Minuteur une minute
vsMinuteur 2 minutes
. This prohibited users from setting 1-minute timers.Minuteur 2 min
Minuteur 2 sec
Minuteur 2 h
Minuteur 02h16.
(Notice the lack of the "minute" key and the lack of spacing.)Solution
A painful set of expansion rules:
For seconds, minutes, and hours, we now have: 1/ A numerical range
2/ A literal list
We then merge them for both duration and start, ie:
We use these intermediate expansion rules to define the final duration and start., ie:
There are a small of smaller nuances such as the units that are mandatory for the first key of the tuple (h,m,s) but optional for the rest (To accommodate for the
02h16
), ie:The tests have been edited to reflect all this
madnesscomplexitySummary by CodeRabbit
New Features
Bug Fixes
Tests