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

Timer wrongly recognise area when we use more then one name variation #2393

Open
witold-gren opened this issue Sep 23, 2024 · 1 comment
Open

Comments

@witold-gren
Copy link
Contributor

witold-gren commented Sep 23, 2024

I have very simple _fixtures.yaml configuration:

language: pl
areas:
  - name: "Kuchni[a]"
    id: kitchen_id
    floor: "Parter"
...
timers:
  - area: "kitchen_id"
    start_minutes: 5
    total_seconds_left: 190
    rounded_hours_left: 0
    rounded_minutes_left: 3
    rounded_seconds_left: 0

When I run pytest for below test case configuration:
sentences:

language: pl
intents:
  HassTimerStatus:
    data:
      - sentences:
          - "<area>[ jaki| jaki jest] <timer_state>[ mojego| moich][ <timer_start>] <timer>[ {timer_name:name}]"
          - "[jaki |jaki jest ]<area> <timer_state>[ mojego| moich][ <timer_start>] <timer>[ {timer_name:name}]"
          - "[jaki |jaki jest ]<timer_state> <area>[ mojego| moich][ <timer_start>] <timer>[ {timer_name:name}]"
          - "[jaki |jaki jest ]<timer_state>[ mojego| moich][ <timer_start>] <timer>[ {timer_name:name}] <area>"
          - "[jaki |jaki jest ]<timer_state>[ mojego| moich][ <timer_start>] (<timer_plural>|<timer>)[ {timer_name:name}]"
          - "ile czasu [po]zostało na [moich |moim ][<timer_start> ](<timer_plural>|<timer>)[ {timer_name:name}] <area>"
          - "ile czasu [po]zostało na [moich |moim ][<timer_start> ](<timer_plural>|<timer>)[ {timer_name:name}]"

test:

  - sentences:
      - "stan minutnika w kuchni"
      - "status minutnika w kuchni"
      - "podsumowanie minutnika w kuchni"
      - "jaki stan minutnika w kuchni"
      - "jaki jest stan minutnika w kuchni"
      - "jaki jest w kuchni stan mojego minutnika"
      - "w kuchni jaki jest stan minutnika"
      - "stan mojego minutnika w kuchni"
      - "ile czasu pozostało na minutniku w kuchni"
    intent:
      name: HassTimerStatus
      slots:
        area: "Kuchni"
    response: |
      Pozostały 3 minuty do zakończenia.

I see that all te time pytest can not discover timer on this area. When I print {{ slots }} in my response I see:
{'area': 'kuchni', 'timers': [], 'date': datetime.date(2013, 9, 17), 'time': datetime.time(1, 2)}

Also when I check main params in top of run the test:

language = 'pl'
intent_schemas = {'HassCancelTimer': {'description': 'Cancels a timer', 'domain': 'intent', 'slots': {'area': {'description': 'Area of ...inutes', 'required': False}, 'name': {'description': 'Name attached to the timer', 'required': False}, ...}, ...}, ...}
slot_lists = {'area': TextSlotList(name=None, values=[TextSlotValue(text_in=TextChunk(text='kuchnia', original_text='kuchnia'), val...nk(text='odkurzacz', original_text='odkurzacz'), value_out='Odkurzacz', context={'domain': 'vacuum'}, metadata=None)])}
states = [State(entity_id='light.bedroom_lamp', name='Lampę nocną', hass_state='off', attributes={'device_class': 'light'}, are...s={'device_class': 'blind'}, area_id='living_room_id', human_state=None, aliases={'Roletę salonu'}, _domain=None), ...]
areas = [AreaEntry(id='kitchen_id', name='Kuchnia', aliases={'Kuchni'}), AreaEntry(id='living_room_id', name='Salonie', aliase...ame='Łazienka', aliases={'Łazience'}), AreaEntry(id='balcony_id', name='Balkonie', aliases={'Balkonu', 'Balkon'}), ...]
timers = [Timer(is_active=False, start_hours=1, start_minutes=None, start_seconds=None, rounded_hours_left=0, rounded_minutes_l...ded_hours_left=0, rounded_minutes_left=3, rounded_seconds_left=0, name=None, area='kuchni[a]', total_seconds_left=190)]
language_sentences = Intents(language='pl', intents={'HassClimateGetTemperature': Intent(name='HassClimateGetTemperature', data=[IntentData...Sprawdź', 'Sprawdź mi', 'Sprawdź proszę', 'Zerknij', 'Zerknij czy'], settings=IntentsSettings(ignore_whitespace=False))
language_responses = {'HassCancelTimer': {'default': 'Anulowano minutnik'}, 'HassClimateGetTemperature': {'default': "{% set temperature = ...etTemperature': {'default': 'Ustawiono temperaturę'}, 'HassDecreaseTimer': {'default': 'Zaktualizowano minutnik'}

I observed that my timer use area call area='kuchni[a]'. This is incorrect because I can not use this name in my test templates.

@witold-gren
Copy link
Contributor Author

The similar issue exist when we have response from HassTimerStatus.yaml. We can use one params {{ next_timer.area }} to return area name. But when we use some variations of name for our area like: name: "Kuchni[a]" the this variable return configuration string, not correct area name. In my case:

language: pl
tests:
  - sentences:
      - "stan minutnika"
      - "status minutnika"
      - "podsumowanie minutnika"
      - "jaki stan minutnika"
      - "jaki jest stan minutnika"
      - "stan moich minutników"
      - "jaki jest stan moich minutników"
      - "ile czasu pozostało na moich minutnikach"
    intent:
      name: HassTimerStatus
    response: |
      2 uruchomione minutniki. 1 wstrzymany minutnik. Pozostały 3 minuty na 5 minutowym minutniku w kuchni[a].

I see the answer:
2 uruchomione minutniki. 1 wstrzymany minutnik. Pozostały 3 minuty na 5 minutowym minutniku w kuchni[a].
but it should be:
2 uruchomione minutniki. 1 wstrzymany minutnik. Pozostały 3 minuty na 5 minutowym minutniku w kuchni.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant