home-assistant / intents

Intents to be used with Home Assistant
https://developers.home-assistant.io/docs/voice/overview/
Creative Commons Attribution 4.0 International
444 stars 503 forks source link

[RU]Fixed climate intents #2240

Closed mitrokun closed 2 months ago

mitrokun commented 2 months ago

The request domain is limited. Response has been adapted to the new format. Related edits have been made to the test block.

Не удалось пройти тесты, для получения значений установленных температур от area, поэтому исключил эти фразы на данный момент. Они закомментированы в HassClimateGetTemperature. Потратил несколько часов на эксперименты, формально всё соответствует записи в других языках, но распознаваться не хочет. Не хватает квалификации в чтении логов.

Два теста, которые надо пройти, если кто-то решится разобраться в чем проблема. Они должны получать данные от climate.thermostat из fixtures. В первом случае, как первое устройство данного класса, во втором - через ассоциацию с локацией.

  - sentences:
      - "Какая температура?"
    intent:
      name: HassClimateGetTemperature
    response: "22 градуса"

  - sentences:
      - "Какая температура в зале"
    intent:
      name: HassClimateGetTemperature
      slots:
        area:
          - "Зале"
    response: "22 градуса"

upd. Похоже, HassClimateGetTemperature ещё не поддреживается

Summary by CodeRabbit

coderabbitai[bot] commented 2 months ago
Walkthrough ## Walkthrough The primary changes involve modifying how temperature data is retrieved for the `HassClimateGetTemperature` response by extracting it from an attribute instead of a state. Similarly, sentence patterns and entity names in various related configurations and test files have been updated for clarity and consistency in handling home automation commands. ## Changes | Files | Change Summaries | |----------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `responses/ru/HassClimateGetTemperature.yaml` | Updated temperature retrieval from `state.state` to `current_temperature` attribute in `HassClimateGetTemperature` response. | | `sentences/ru/climate_HassClimateGetTemperature.yaml` | Refined sentence patterns for querying current or set temperatures, focusing on variations in wording and context requirements for the `HassClimateGetTemperature` intent. | | `sentences/ru/climate_HassClimateSetTemperature.yaml` | Adjusted sentence patterns for setting temperatures, rearranging elements like temperature, area, and set action for the `HassClimateSetTemperature` intent. | | `tests/ru/_fixtures.yaml` | Renamed and reorganized home automation device entities, updating names, areas, states, and attributes for thermostats and locks to enhance clarity and consistency. | | `tests/ru/climate_HassClimateSetTemperature.yaml` | Adjusted temperature setting commands in Russian, specifying temperatures in Celsius and Fahrenheit, handling word endings, and targeting specific areas like bedrooms and kitchens in the `HassClimateSetTemperature`. |

Recent review details **Configuration used: CodeRabbit UI** **Review profile: ASSERTIVE**
Commits Files that changed from the base of the PR and between cae5125b6293bc12b12a9a71c9dbff09d71ce4c3 and efe89b7988b2fe79e7ca53e30f70a6a6f6b7c941.
Files selected for processing (6) * responses/ru/HassClimateGetTemperature.yaml (1 hunks) * sentences/ru/climate_HassClimateGetTemperature.yaml (1 hunks) * sentences/ru/climate_HassClimateSetTemperature.yaml (1 hunks) * tests/ru/_fixtures.yaml (1 hunks) * tests/ru/climate_HassClimateGetTemperature.yaml (1 hunks) * tests/ru/climate_HassClimateSetTemperature.yaml (1 hunks)
Additional comments not posted (16)
sentences/ru/climate_HassClimateSetTemperature.yaml (3)
`6-6`: **Approved sentence pattern.** This sentence pattern allows for flexible placement of temperature and area, which should improve the natural language understanding of the intent. --- `7-7`: **Approved sentence pattern.** Similar to the previous one, this pattern also supports flexible word order, enhancing usability. --- `8-8`: **Approved sentence pattern.** This pattern continues to support flexible word order, which is beneficial for understanding varied user inputs.
sentences/ru/climate_HassClimateGetTemperature.yaml (4)
`6-6`: **Approved sentence pattern.** This pattern correctly captures the intent structure for querying current or set temperatures. --- `7-7`: **Approved sentence pattern.** This pattern is well-formed and aligns with the intent's purpose, ensuring clarity in user queries. --- `8-9`: **Commented-out sentence patterns.** These patterns are currently inactive. If there's a plan to enable them in the future, thorough testing and verification should be conducted to ensure they function as expected. --- `11-11`: **Correct domain specification.** The domain is appropriately set to "climate", which is essential for the accurate processing of the intent.
tests/ru/climate_HassClimateGetTemperature.yaml (2)
`4-5`: **Approved test case and response.** This test case correctly assesses the basic functionality of the intent and the response is appropriately set to "22 градуса". Also applies to: 10-10, 12-12 --- `14-14`: **Approved test case and response.** This test case effectively tests the intent with a specific context ("Термостат в спальне") and the response is correctly set to "15 градусов". Also applies to: 19-19, 21-21
responses/ru/HassClimateGetTemperature.yaml (1)
`7-8`: **Approved response logic.** The use of `current_temperature` for accuracy and the detailed conditions for selecting the correct word ending based on Russian grammar are well-implemented.
tests/ru/climate_HassClimateSetTemperature.yaml (5)
`10-10`: **Clarify the temperature unit in the test case.** The sentence "сделай температуру 30 градусов цельсия" is clear about the temperature unit. This is good practice for ensuring clarity and preventing misinterpretation. --- `27-27`: **Good response consistency.** The response "Температура установлена на 50 градусов" is consistent and clear, providing direct feedback that the temperature setting action has been completed. --- `38-38`: **Consistency in temperature responses.** The response "Температура установлена на 25 градусов" matches the intent and is consistent with other responses in this file, which is good for user experience. --- `49-49`: **Clear response for temperature setting.** The response "Температура установлена на 24 градуса" is clear and consistent, aligning well with the intent and slots provided. --- `58-58`: **Check consistency for area-specific temperature settings.** The response "Температура установлена на 20 градусов" is clear, but ensure that area-specific settings like "в кухне" are consistently handled across the test cases.
tests/ru/_fixtures.yaml (1)
`126-126`: **Check consistency of the new entity in the living room.** The addition of "Игровой уголок" in the living room is noted. Ensure this new entity is consistently used and documented in relevant scenarios.
Verification successful --- **The new entity "Игровой уголок" is consistently used in the test cases.** - `tests/ru/_fixtures.yaml`: The entity is defined. - `tests/ru/homeassistant_HassGetState.yaml`: The entity is referenced in responses.
Scripts executed The following scripts were executed for the analysis: --- Script: ```shell #!/bin/bash # Description: Verify the use of the new entity "Игровой уголок" across test cases. # Test: Check for references to "Игровой уголок". Expect: Consistent usage. rg --type yaml -c 'Игровой уголок' tests/ru/ ``` Length of output: 115 --- --- Script: ```shell #!/bin/bash # Display the content of the files mentioning "Игровой уголок" rg --type yaml 'Игровой уголок' tests/ru/_fixtures.yaml rg --type yaml 'Игровой уголок' tests/ru/homeassistant_HassGetState.yaml ``` Length of output: 323
--- Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Share - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)
Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit .` - `Generate unit testing code for this file.` - `Open a follow-up GitHub issue for this discussion.` - Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples: - `@coderabbitai generate unit testing code for this file.` - `@coderabbitai modularize this function.` - PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples: - `@coderabbitai generate interesting stats about this repository and render them as a table.` - `@coderabbitai show all the console.log statements in this repository.` - `@coderabbitai read src/utils.ts and generate unit testing code.` - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.` - `@coderabbitai help me debug CodeRabbit configuration file.` Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. ### CodeRabbit Commands (invoked as PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai full review` to do a full review from scratch and review all the files again. - `@coderabbitai summary` to regenerate the summary of the PR. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository. - `@coderabbitai help` to get help. Additionally, you can add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### CodeRabbit Configration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information. - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json` ### Documentation and Community - Visit our [Documentation](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit. - Join our [Discord Community](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.