Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added binary_sensor_HassGetState and needed values in _common.yaml. #2827

Closed
wants to merge 6 commits into from

Conversation

slungs
Copy link
Contributor

@slungs slungs commented Jan 4, 2025

NB! Having trouble with some tests failing for area, but I'm not sure whats wrong. I figured I make a PR to get some guidance. Please check and request changes

Copy link
Contributor Author

@slungs slungs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@larsdunemark please check commit message first. Maybe bit of a bit more than I could chew, but worth a shot.

Copy link
Contributor

@larsdunemark larsdunemark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job! I think there is some parts that we need to revert and maybe rethink.

sentences/sv/_common.yaml Outdated Show resolved Hide resolved
sentences/sv/_common.yaml Outdated Show resolved Hide resolved
@home-assistant home-assistant bot marked this pull request as draft January 4, 2025 16:37
@home-assistant
Copy link

home-assistant bot commented Jan 4, 2025

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

device_class: battery

- sentences:
- "är alla batteri[er] {bs_battery_states:state} [<i_på> <area>q]"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"är alla batterierna normala i köket" <- Guess we could extract (batteri|enhet)[er] to an expansion_rules and add all different versions.

sentences/sv/binary_sensor_HassGetState.yaml Outdated Show resolved Hide resolved
@slungs
Copy link
Contributor Author

slungs commented Jan 4, 2025

@larsdunemark I'll check your latest comments. I have big trouble to get one specific test to pass:

Code:

  values:
    - in: "låg[t|a]"
      out: "on"
    - in: "normal[t]"
      out: "off"

The test:

tests:
  # Battery
  - sentences:
      - "är telefon-batteriet lågt?"
    intent:
      name: HassGetState
      slots:
        domain: "binary_sensor"
        device_class: "battery"
        name: "Telefon"
        state: "on"
    response: "Nej, normalt"

Output:

FAILED tests/test_language_sentences.py::test_binary_sensor_HassGetState[sv] - AssertionError: Recognition failed for 'är telefon-batteriet lågt?'
assert None is not None

Can you see why this would fail?

@larsdunemark
Copy link
Contributor

@larsdunemark I'll check your latest comments. I have big trouble to get one specific test to pass:

Code:

  values:
    - in: "låg[t|a]"
      out: "on"
    - in: "normal[t]"
      out: "off"

The test:

tests:
  # Battery
  - sentences:
      - "är telefon-batteriet lågt?"
    intent:
      name: HassGetState
      slots:
        domain: "binary_sensor"
        device_class: "battery"
        name: "Telefon"
        state: "on"
    response: "Nej, normalt"

Output:

FAILED tests/test_language_sentences.py::test_binary_sensor_HassGetState[sv] - AssertionError: Recognition failed for 'är telefon-batteriet lågt?'
assert None is not None

Can you see why this would fail?

I don't think there is any sentences that would combind {entity}-batteriet.

@slungs
Copy link
Contributor Author

slungs commented Jan 4, 2025

@larsdunemark I'll check your latest comments. I have big trouble to get one specific test to pass:
Code:

  values:
    - in: "låg[t|a]"
      out: "on"
    - in: "normal[t]"
      out: "off"

The test:

tests:
  # Battery
  - sentences:
      - "är telefon-batteriet lågt?"
    intent:
      name: HassGetState
      slots:
        domain: "binary_sensor"
        device_class: "battery"
        name: "Telefon"
        state: "on"
    response: "Nej, normalt"

Output:

FAILED tests/test_language_sentences.py::test_binary_sensor_HassGetState[sv] - AssertionError: Recognition failed for 'är telefon-batteriet lågt?'
assert None is not None

Can you see why this would fail?

I don't think there is any sentences that would combind {entity}-batteriet.

This is the sentence I'm testing with now, if that is what you are referring to:

          - "är <name>-[batteri[et]] {bs_battery_states:state} [<i_på> <area>]"

I can't seem any logical reason for the test to fail here. I started a discussion on Discord if you would like to jump in: https://discord.com/channels/330944238910963714/1325154473219325972

@slungs
Copy link
Contributor Author

slungs commented Jan 6, 2025

@larsdunemark I'll close this PR and make smaller chunks instead.

@slungs slungs closed this Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants