Building A Custom Alexa Skill – Part 5 – Refactoring what isn’t even in production yet

Building a Custom Alexa Skill - Part 4

Whelp . . . my progress has taken 3 steps forward and 2 back. One thing I have learned (and being an old software dev, I should have known this), that granularity is king.

I originally had one:

HouseLightIntent

Once I got into it, the complexities of supporting “On/Off, brightness, color” in a single endpoint got “messy”.

As such, I have broken out my Intents to be:

HouseLightsOnOffIntent
HouseLightsBrightnessIntent
HouseLightsColorIntent

With URLS that look like this:

const houseLightsOnOffURL = 'http://<mydomain>:1880/endpoint/lightsOnOff';
const houseLightsBrightnessURL = 'http:// <mydomain>:1880/endpoint/lightsbrightness';
const houseLightsColorURL = 'http:// <mydomain>:1880/endpoint/lightscolor';

This has led to NodeRed Flows that look like this:

Inbound Requests:

Processing:


As you can see, this is a lot “cleaner”.

Keep in minds kids . . . granularity is king :wink: