Closed synesthesiam closed 1 month ago
tests/en/homeassistant_HassStartTimer.yaml (4)
`18-27`: **Added support for a timer with fractional minutes:** The addition of a test case for "5 and a half minutes" is a good implementation of the PR's objective to handle more natural language expressions for timers. This test ensures that the intent correctly captures 5 minutes and 30 seconds as separate components, which aligns with the new functionality. --- `29-37`: **Added support for a timer with half a minute duration:** This test case for setting a timer for "half a minute" correctly captures 30 seconds in the slots, which is a straightforward and effective way to handle fractional minute inputs. This aligns well with the PR's objective and enhances the system's usability. --- `39-48`: **Added support for a timer with fractional hours:** The test for "1 and a half hours" which converts to 1 hour and 30 minutes in the slots is another excellent addition. This test case ensures that the system can handle fractional hours effectively, which is crucial for the natural language processing enhancements described in the PR. --- `50-58`: **Added support for a timer with half an hour duration:** The inclusion of a test case for "half an hour" which translates to 30 minutes in the slots is consistent with the PR's enhancements. This test ensures that the system can interpret and act on more colloquial time expressions, improving user interaction.sentences/en/_common.yaml (2)
`352-355`: **New entity addition for handling 'half' as a time unit:** The introduction of the `timer_half` entity is an essential addition for supporting expressions like "half an hour" or "half a minute." This entity helps in translating these colloquial terms into a numerical representation (30 seconds or minutes), which is crucial for the timer functionality. --- `393-394`: **Updated timer duration entities to support new formats:** The updates to `timer_duration_minutes` and `timer_duration_hours` are well-implemented. They now support a variety of formats including those with fractional parts, which is key to achieving the PR's goal of enhancing natural language understanding for timer settings. This will significantly improve the user's experience by allowing more flexible voice commands.
The extra list seems a bit excessive. I've tackled this particular use case a long time ago with a much simplified version https://github.com/tetele/custom_sentences/blob/main/config/custom_sentences/en/delay_action.yaml
Adds support for sentences like "start a timer for 1 and a half hours" and "start a timer for 3 and a half minutes"
Summary by CodeRabbit
New Features
Tests