Open dontinelli opened 1 year ago
This was a bug in hassil, and has been fixed now in 1.0.4. Thanks!
I just tried it out and it seems that in my codespace the error persists. I updated with script/setup
and in terminal it is confirmed that hassil has version 1.0.4. Are there other dependencies that need to be processed first?
Another version of hassil has been merged. Can you please check again with this @dontinelli ?
I checked with hassil version in codespace (1.0.5) and still have the same problem.
An other problem I ran over is related to states (not sure if this is in the same context or a total different problem). In the test sentences I can use the localized states (e.g. "offe" for "open") to check on the state. In the test response this throws an error. If I use the English state, though, test passes. It seems to be the same as reported in #1070. So it seems that not only in the conversion of the entity name but also the state for the response something is not working yet.
You will need to translate the state names for your test fixtures, like this:
entities:
- name: "..."
state:
- in: "offe"
- out: "open"
I responded in https://github.com/home-assistant/intents/issues/1070 just now that in HA the state names will be automatically translated using the existing strings.json
files.
You will need to translate the state names for your test fixtures, like this:
entities: - name: "..." state: - in: "offe" - out: "open"
I responded in #1070 just now that in HA the state names will be automatically translated using the existing
strings.json
files.
Ok, so the definition in fixtures is needed on top of the definitions in common.yaml, correct?
Just tried it out:
entities:
- name: "Deck(e|i|ä)-Venti[lator]"
id: fan.ceiling
area: living_room
state:
- in: "an"
- out: "on"
I got the following error:
Language: de-CH
[ERROR] tests/de-CH/_fixtures.yaml: invalid format: expected str for dictionary value @ data['entities'][0]['state']. Got [{'in': 'an'}, {'out': 'on'}]
Update on the above:
I saw in the NL-files that one could/should use a capitalize-filter in the response-yaml: {{ slots.name | capitalize }}
With this, I can use capital letters at the beginning of the word and the test passes. However, capital letter in the middle of a word such as "Decke-Ventilator". "Decke-ventilator" would be recognized, "Decke-Ventilator" is not.
Also the localized states in the response do not yet work for me (cf. error above). Is this a bug or did I try to define it the wrong way?
While testing around I noticed that entity names are apparently used in lower case only. At least in the following use case I got the following error:
test/light_HassTurnOn.yaml:
-fixtures.yaml
responses/HassTurnOn.yaml
When I change the response in the test-file to "Ha ds Liecht schlafzimmer-lampe igschalte.", I don't get this error. I'm not sure where in the code the name is set to lower case, but in my view this only makes sense for testing but not for the response. I further assume that also the response in the console would the be lower case, which definitively would be wrong.