@forslund Thanks! I did make the change to data = r.json()
last night after doing a little more research on google. And you are right, there is really no need to dump to a file at that point. All that is really needed is to pass that information to AvailableModulesWithIdentifier.json
which works with no issue.
I did dump the AvailableModulesWithIdentifier.json
in the def initialize(self):
into the skill/Magic-Mirror-Voice-Control-skill/ folder and it caused something that I didn’t expect. The skill was continually being loaded by mycroft. I assume that when a change is made to the skill, mycroft reloads it. Because I dump the file in the def initialize(self):
it would save the file every time the skill is loaded. I think this created a loop.
When I don’t specify a path to write the file:
with open ('AvailableModulesWithIdentifier.json', 'w') as f: json.dump(AvailableData, f, indent = 2)
It puts the file in the Mycroft-core folder, which is not what I want to do.
So my next thought is “do I really need to write the file?” And again, this may just be my inexperience, but I ran into an issue with creating a variable in the def initialize(self):
url = 'http://localhost:8080/remote'
that the intents said was not defined. So I added the variable to each intent. My thinking with the AvailableModulesWithIdentifier.json
was that if I write the file, it can be called by any intent at any time.
The good news is that the skill works mostly. There are a couple of intents I need to work on. Specifically the intents that use the word form of numbers like the PagesIntent and the AdjustBrightnessIntent.
With the PagesIntent for example when I type “go to page three” in the cli, it doesn’t recognize the keywords and activate the intent, instead it goes to the fallback.
With the AdjustBrightnessIntent the same thing happens when I type “set brightness to one hundred”, but when I type “set brightness to 100” the intent is recognized and works perfectly. The reason I have included the word form of the numbers in the appropriate .voc file is that occasionally mycroft recognizes the utterance “set brightness to 100” as “set brightness to one hundred” and I wanted to be thorough.
I know I have probably worn you out with all my questions. I do appreciate all your help.
I will continue to research these answers on my own, but if you have any advice, I would gladly take it.
Thanks a million for all of your advice!