#Testing issues

1 messages ยท Page 1 of 1 (latest)

tall spoke
#

Please paste both the response definition and the failing test

lusty summitBOT
#

Please use a code share site to share code or logs, for example:

Please don't use Pastebin, since it can randomly add spaces to the main view. Please also don't share text as images since it makes it harder for people to help you. Remember that others may have colour blindness, impaired vision, etc.

small sequoia
tall spoke
#

Have you created a file under the responses dir? What does it look like?

small sequoia
#

No. I didn't do that for my other intents. I am guessing that is the problem then... I probably didn't change the response from those intial intents that I added to. Let me look at that.

tall spoke
#

Afaik you have not added new intents. You've added sentences for existing intents

#

New intents require their own responses

small sequoia
#

I haven't done the PR yet. I have a bunch in a branch. Thanks that was what I didn't know. I will add those in and I assume then the test is just making sure the response file works as planned

tall spoke
#

Pretty much. You define key-value response pairs, declare the key to be used in the sentences and check that the expected value comes back in the test

small sequoia
#

I have it all working but I am wondering if I can be clever with mute and use the same intent for mute and unmute. It seems to be working except I am having trouble with the response. Looking at others on GH I should be able to use a template but I am trying to check the value of a slot but it isn't working?

#

Sentence
language: en intents: HassMediaMute: data: - sentences: - "({is_volume_muted:state};<name>)" requires_context: domain: media_player

#

Common:
is_volume_muted: values: - in: "mute" out: "true" - in: "unmute" out: "false"

#

Response
language: en responses: intents: HassMediaMute: default: | {% if state == "true" %} "Muted" {% else %} "Unmuted" {% endif %}

tall spoke
#

you can totally do that, but it may not work in all languages

#

it looks hacky tbh

small sequoia
#

So just use two intents? (Custom intents work so different and I am used to them!)

tall spoke
#

you're probably better off doing 2 intents, as there are for turn on and turn off

small sequoia
#

OK I will do that and then will be done

tall spoke
#

erm... apart from the actual intents in core you mean ๐Ÿ˜…

small sequoia
#

Yes well my bit is done ๐Ÿ™‚

tall spoke
#

you don't have to build those, too, but the sentences are useless without them ๐Ÿ˜„

#

as long as you're aware and ok with that, it's all good

small sequoia
#

Yep no probs. I had done the sentences for Music Assistant so it was logical to bring them across.

tall spoke
#

this might help MA and other custom integrations

small sequoia
#

Good thoughts. See what "they" say!

small sequoia
#

Phew PR submitted! There was a git battle but I won!

small sequoia
tall spoke
#

True, but unlike Mike, we don't have the privilege of being in permanent discussions with other engineers at Nabu Casa. So my suggestion is that you create very small PRs, one for each intent

#

and I know I'm asking a lot after you've submitted that big PR, but it would be best to do the same for https://github.com/home-assistant/intents/pull/2063
in terms of new intents, it's also Mike that needs to approve the contributions. I can only say that a new sentence is suitable or not for an existing intent

small sequoia
small sequoia