Problems developing skills


#1

hello everybody i’m developing a skill that allows my device to answer room locations in my house for visitors for example :
Where is the toilette ? or where is the garage ? or some questions like that
but i’m having problems with using it because after saying the wake word and asking the question mycroft is giving me random answers rather than the answers that i want so would please help me ?
linke to the skill : https://github.com/Ghaithbhs/Rooms-loacation-skill
thank you


#2

You have some typos in there, which might cause some problems:

Filename " bathroom.loction.dialog" should better read “bathroom.location.dialog”

And you check for “Bedroom” (elif message.data["Room"] == "Bedroom":) while in Room.voc it is spelled lowercase “bedroom”…


#3

@Dominik thanks for the headsup, i corrected those but still when i ask mycroft “where is the bedroom” i get “the definition of bedroom is a : …” i didn’t understand the problem :confused:


#4

Hey, I dropped this in the chat but thought I’d add it here in case you didn’t see it.

I think it might have just been code formatting. When I downloaded the code from your repo there were both spaces and tabs being used causing some indentation problems. Replacing those returns the dialog for both bedroom and bathroom correctly for me.

I pushed my changes up to a new fork so you can compare:
https://github.com/krisgesling/Rooms-loacation-skill/commit/0204f7f53491f1e6bc3a6449cad02a5e541c5166

Python is very particular about formatting, its one of the things I have to catch myself on coming from mostly Javascript. Indentation levels for example, aren’t just to make the code easier to read, Python uses these different levels to interpret the group or ‘suite’ that the code belongs to. There’s a nice brief description of this here: