From 0c5c35c68fa942e04f15d8da8b48d02bd02587c2 Mon Sep 17 00:00:00 2001 From: jsetton Date: Tue, 29 Aug 2023 13:54:33 -0400 Subject: [PATCH] Add alexa button + gesture + unit assets to catalog Signed-off-by: jsetton --- docs/USAGE.md | 68 +++++- lambda/alexa/smarthome/catalog.js | 348 ++++++++++++++++++++++++++++++ 2 files changed, 411 insertions(+), 5 deletions(-) diff --git a/docs/USAGE.md b/docs/USAGE.md index 1d4b35b6..9ddad91f 100644 --- a/docs/USAGE.md +++ b/docs/USAGE.md @@ -2005,10 +2005,37 @@ ToggleController | [`ToggleState`](#togglestate), [`FanOscillate`](#fanoscillate ### Alexa Asset Catalog -List of Alexa asset catalog from the [Alexa Skill API](https://developer.amazon.com/docs/device-apis/resources-and-assets.html#global-alexa-catalog) documentation: +List of Alexa asset identifiers from the [Alexa Skill API](https://developer.amazon.com/docs/device-apis/resources-and-assets.html#global-alexa-catalog) documentation: Asset Identifier | Supported Friendly Names -----------------|------------------------- +`@Button.OffButton` | Off Button +`@Button.OnButton` | On Button +`@Button.BrightenButton` | Brighten Button +`@Button.DimButton` | Dim Button +`@Button.MainButton` | Main Button +`@Button.TopButton` | Top Button +`@Button.BottomButton` | Bottom Button +`@Button.CenterButton` | Center Button +`@Button.MiddleButton` | Middle Button +`@Button.UpButton` | Up Button +`@Button.DownButton` | Down Button +`@Button.LeftButton` | Left Button +`@Button.RightButton` | Right Button +`@Button.FirstButton` | First Button +`@Button.SecondButton` | Second Button +`@Button.ThirdButton` | Third Button +`@Button.FourthButton` | Fourth Button +`@Button.FifthButton` | Fifth Button +`@Button.SixthButton` | Sixth Button +`@Button.SeventhButton` | Seventh Button +`@Button.EighthButton` | Eighth Button +`@Button.DoublePress` | Double Press +`@Button.DoublePush` | Double Push +`@Button.LongPress` | Long Press +`@Button.LongPush` | Long Push +`@Button.SinglePress` | Single Press +`@Button.SinglePush` | Single Push `@DeviceName.AirPurifier` | Air Purifier
Air Cleaner
Clean Air Machine `@DeviceName.Camera` | Camera `@DeviceName.Fan` | Fan
Blower @@ -2017,6 +2044,14 @@ Asset Identifier | Supported Friendly Names `@DeviceName.Shower` | Shower `@DeviceName.SpaceHeater` | Space Heater
Portable Heater `@DeviceName.Washer` | Washer
Washing Machine +`@Gesture.DoubleClick` | Double Click +`@Gesture.DoubleTap` | Double Tap +`@Gesture.SingleClick` | Single Click +`@Gesture.SwipeDown` | Swipe Down +`@Gesture.SwipeLeft` | Swipe Left +`@Gesture.SwipeRight` | Swipe Right +`@Gesture.SwipeUp` | Swipe Up +`@Gesture.Tap` | Tap `@Setting.2GGuestWiFi` | 2.4G Guest Wi-Fi
2.4G Guest Network
Guest Network 2.4G
2G Guest Wi-Fi `@Setting.5GGuestWiFi` | 5G Guest Wi-Fi
5G Guest Network
Guest Network 5G
5G Guest Wi-Fi `@Setting.Auto` | Auto
Automatic
Automatic Mode
Auto Mode @@ -2036,6 +2071,29 @@ Asset Identifier | Supported Friendly Names `@Setting.WaterTemperature` | Water Temperature
Water Temp
Water Heat `@Shower.HandHeld` | Handheld Shower
Shower Wand
Hand Shower `@Shower.RainHead` | Rain Head
Overhead Shower
Rain Shower
Rain Spout
Rain Faucet +`@Unit.Angle.Degrees` | Degrees
Degree +`@Unit.Angle.Radians` | Radians
Radian +`@Unit.Distance.Feet` | Feet
Foot +`@Unit.Distance.Inches` | Inches
Inch +`@Unit.Distance.Kilometers` | Kilometers
Kilometer +`@Unit.Distance.Meters` | Meters
Meter +`@Unit.Distance.Miles` | Miles
Mile +`@Unit.Distance.Yards` | Yards
Yard +`@Unit.Mass.Grams` | Grams
Gram +`@Unit.Mass.Kilograms` | Kilograms
Kilogram +`@Unit.Percent` | Percent +`@Unit.Temperature.Celsius` | Celsius
Degrees Celsius
Centigrade
Degrees Centigrade +`@Unit.Temperature.Degrees` | Degrees
Degree +`@Unit.Temperature.Fahrenheit` | Fahrenheit
Degrees Fahrenheit +`@Unit.Temperature.Kelvin` | Kelvin
Degrees Kelvin +`@Unit.Volume.CubicFeet` | Cubic Feet
Cubic Foot +`@Unit.Volume.CubicMeters` | Cubic Meters
Cubic Meter
Meters Cubed +`@Unit.Volume.Gallons` | Gallons
Gallon +`@Unit.Volume.Liters` | Liters
Liter +`@Unit.Volume.Pints` | Pints
Pint +`@Unit.Volume.Quarts` | Quarts
Quart +`@Unit.Weight.Ounces` | Ounces
Ounce +`@Unit.Weight.Pounds` | Pounds
Pound `@Value.Close` | Close `@Value.Delicate` | Delicates
Delicate `@Value.High` | High @@ -2048,7 +2106,7 @@ Asset Identifier | Supported Friendly Names ### Custom Asset Catalog -List of custom asset catalog defined by the skill: +List of custom asset identifiers defined by the skill: Asset Identifier | Supported Friendly Names -----------------|------------------------- @@ -2086,7 +2144,7 @@ Asset Identifier | Supported Friendly Names ### Alexa Semantic Catalog -List of Alexa semantic catalog from the [Alexa Skill API](https://developer.amazon.com/docs/alexa-voice-service/generic-controllers.html#semantics-syntax) documentation: +List of Alexa semantic identifiers from the [Alexa Skill API](https://developer.amazon.com/docs/alexa-voice-service/generic-controllers.html#semantics-syntax) documentation: Semantic Type | Identifiers --------------|------------ @@ -2095,7 +2153,7 @@ States | `Closed`
`Open` ### Custom Semantic Catalog -List of custom semantic catalog defined by skill: +List of custom semantic identifiers defined by skill: Semantic Type | Identifiers --------------|------------ @@ -2104,7 +2162,7 @@ States | ## Unit of Measurement Catalog -List of Alexa unit of measurement catalog from the [Alexa Skill API](https://developer.amazon.com/docs/device-apis/alexa-property-schemas.html#units-of-measure) documentation: +List of Alexa unit of measurement identifiers from the [Alexa Skill API](https://developer.amazon.com/docs/device-apis/alexa-property-schemas.html#units-of-measure) documentation: Unit Identifier | ----------------| diff --git a/lambda/alexa/smarthome/catalog.js b/lambda/alexa/smarthome/catalog.js index d1d78b0d..bac1bec0 100644 --- a/lambda/alexa/smarthome/catalog.js +++ b/lambda/alexa/smarthome/catalog.js @@ -20,6 +20,168 @@ const require = createRequire(import.meta.url); * https://developer.amazon.com/docs/device-apis/resources-and-assets.html#global-alexa-catalog */ class AlexaGlobalCatalog { + /** + * Defines button off button asset + * @type {String} + */ + static BUTTON_OFF_BUTTON = '@Button.OffButton'; + + /** + * Defines button on button asset + * @type {String} + */ + static BUTTON_ON_BUTTON = '@Button.OnButton'; + + /** + * Defines button brigthen button asset + * @type {String} + */ + static BUTTON_BRIGHTEN_BUTTON = '@Button.BrightenButton'; + + /** + * Defines button dim button asset + * @type {String} + */ + static BUTTON_DIM_BUTTON = '@Button.DimButton'; + + /** + * Defines button main button asset + * @type {String} + */ + static BUTTON_MAIN_BUTTON = '@Button.MainButton'; + + /** + * Defines button top button asset + * @type {String} + */ + static BUTTON_TOP_BUTTON = '@Button.TopButton'; + + /** + * Defines button bottom button asset + * @type {String} + */ + static BUTTON_BOTTOM_BOTTON = '@Button.BottomButton'; + + /** + * Defines button center button asset + * @type {String} + */ + static BUTTON_CENTER_BUTTON = 'Button.CenterButton'; + + /** + * Defines button middle button asset + * @type {String} + */ + static BUTTON_MIDDLE_BUTTON = '@Button.MiddleButton'; + + /** + * Defines button up button asset + * @type {String} + */ + static BUTTON_UP_BOTTON = '@Button.UpButton'; + + /** + * Defines button down button asset + * @type {String} + */ + static BUTTON_DOWN_BUTTON = '@Button.DownButton'; + + /** + * Defines button left button asset + * @type {String} + */ + static BUTTON_LEFT_BUTTON = '@Button.LeftButton'; + + /** + * Defines button right button asset + * @type {String} + */ + static BUTTON_RIGHT_BUTTON = '@Button.RightButton'; + + /** + * Defines button first button asset + * @type {String} + */ + static BUTTON_FIRST_BUTTON = '@Button.FirstButton'; + + /** + * Defines button second button asset + * @type {String} + */ + static BUTTON_SECOND_BUTTON = '@Button.SecondButton'; + + /** + * Defines button third button asset + * @type {String} + */ + static BUTTON_THIRD_BUTTON = '@Button.ThirdButton'; + + /** + * Defines button fourth button asset + * @type {String} + */ + static BUTTON_FOURTH_BUTTON = '@Button.FourthButton'; + + /** + * Defines button fifth button asset + * @type {String} + */ + static BUTTON_FIFTH_BUTTON = '@Button.FifthButton'; + + /** + * Defines button sixth button asset + * @type {String} + */ + static BUTTON_SIXTH_BUTTON = '@Button.SixthButton'; + + /** + * Defines button seventh button asset + * @type {String} + */ + static BUTTON_SEVENTH_BUTTON = '@Button.SeventhButton'; + + /** + * Defines button eighth button asset + * @type {String} + */ + static BUTTON_EIGHTH_BUTTON = '@Button.EighthButton'; + + /** + * Defines button double press asset + * @type {String} + */ + static BUTTON_DOUBLE_PRESS = '@Button.DoublePress'; + + /** + * Defines button double push asset + * @type {String} + */ + static BUTTON_DOUBLE_PUSH = '@Button.DoublePush'; + + /** + * Defines button long press asset + * @type {String} + */ + static BUTTON_LONG_PRESS = '@Button.LongPress'; + + /** + * Defines button long push asset + * @type {String} + */ + static BUTTON_LONG_PUSH = '@Button.LongPush'; + + /** + * Defines button single press asset + * @type {String} + */ + static BUTTON_SINGLE_PRESS = '@Button.SinglePress'; + + /** + * Defines button single push asset + * @type {String} + */ + static BUTTON_SINGLE_PUSH = '@Button.SinglePush'; + /** * Defines device name air purifier asset * @type {String} @@ -68,6 +230,54 @@ class AlexaGlobalCatalog { */ static DEVICE_NAME_WASHER = '@DeviceName.Washer'; + /** + * Defines gesture double click asset + * @type {String} + */ + static GESTURE_DOUBLE_CLICK = '@Gesture.DoubleClick'; + + /** + * Defines gesture double tap asset + * @type {String} + */ + static GESTURE_DOUBLE_TAP = '@Gesture.DoubleTap'; + + /** + * Defines gesture single click asset + * @type {String} + */ + static GESTURE_SINGLE_CLICK = '@Gesture.SingleClick'; + + /** + * Defines gesture swipe down asset + * @type {String} + */ + static GESTURE_SWIPE_DOWN = '@Gesture.SwipeDown'; + + /** + * Defines gesture swipe left asset + * @type {String} + */ + static GESTURE_SWIPE_LEFT = '@Gesture.SwipeLeft'; + + /** + * Defines gesture swipe right asset + * @type {String} + */ + static GESTURE_SWIPE_RIGHT = '@Gesture.SwipeRight'; + + /** + * Defines gesture swipe up asset + * @type {String} + */ + static GESTURE_SWIPE_UP = '@Gesture.SwipeUp'; + + /** + * Defines gesture tap asset + * @type {String} + */ + static GESTURE_TAP = '@Gesture.Tap'; + /** * Defines setting 2g guest wifi asset * @type {String} @@ -182,6 +392,144 @@ class AlexaGlobalCatalog { */ static SHOWER_RAIN_HEAD = '@Shower.RainHead'; + /** + * Defines unit angle degrees asset + * @type {String} + */ + static UNIT_ANGLE_DEGREES = '@Unit.Angle.Degrees'; + + /** + * Defines unit angle radians asset + * @type {String} + */ + static UNIT_ANGLE_RADIANS = '@Unit.Angle.Radians'; + + /** + * Defines unit distance feet asset + * @type {String} + */ + static UNIT_DISTANCE_FEET = '@Unit.Distance.Feet'; + + /** + * Defines unit distance inches asset + * @type {String} + */ + static UNIT_DISTANCE_INCHES = '@Unit.Distance.Inches'; + + /** + * Defines unit distance kilometers asset + * @type {String} + */ + static UNIT_DISTANCE_KILOMETERS = '@Unit.Distance.Kilometers'; + + /** + * Defines unit distance meters asset + * @type {String} + */ + static UNIT_DISTANCE_METERS = '@Unit.Distance.Meters'; + + /** + * Defines unit distance miles asset + * @type {String} + */ + static UNIT_DISTANCE_MILES = '@Unit.Distance.Miles'; + + /** + * Defines unit distance yards asset + * @type {String} + */ + static UNIT_DISTANCE_YARDS = '@Unit.Distance.Yards'; + + /** + * Defines unit mass grams asset + * @type {String} + */ + static UNIT_MASS_GRAMS = '@Unit.Mass.Grams'; + + /** + * Defines unit mass kilogram asset + * @type {String} + */ + static UNIT_MASS_KILOGRAMS = '@Unit.Mass.Kilograms'; + + /** + * Defines unit percent asset + * @type {String} + */ + static UNIT_PERCENT = '@Unit.Percent'; + + /** + * Defines unit temperature celsius asset + * @type {String} + */ + static UNIT_TEMPERATURE_CELSIUS = '@Unit.Temperature.Celsius'; + + /** + * Defines unit temperature degrees asset + * @type {String} + */ + static UNIT_TEMPERATURE_DEGREES = '@Unit.Temperature.Degrees'; + + /** + * Defines unit temperature fahrenheit asset + * @type {String} + */ + static UNIT_TEMPERATURE_FAHRENHEIT = '@Unit.Temperature.Fahrenheit'; + + /** + * Defines unit temperature kelvin asset + * @type {String} + */ + static UNIT_TEMPERATURE_KELVIN = '@Unit.Temperature.Kelvin'; + + /** + * Defines unit volume cubic feet asset + * @type {String} + */ + static UNIT_VOLUME_CUBIC_FEET = '@Unit.Volume.CubicFeet'; + + /** + * Defines unit volume cubic meters asset + * @type {String} + */ + static UNIT_VOLUME_CUBIC_METERS = '@Unit.Volume.CubicMeters'; + + /** + * Defines unit volume gallons asset + * @type {String} + */ + static UNIT_VOLUME_GALLONS = '@Unit.Volume.Gallons'; + + /** + * Defines unit volume liters asset + * @type {String} + */ + static UNIT_VOLUME_LITERS = '@Unit.Volume.Liters'; + + /** + * Defines unit volume pints asset + * @type {String} + */ + static UNIT_VOLUME_PINTS = '@Unit.Volume.Pints'; + + /** + * Defines unit volume quarts asset + * @type {String} + */ + static UNIT_VOLUME_QUARTS = '@Unit.Volume.Quarts'; + + /** + * Defines unit weight ounces asset + * @type {String} + */ + static UNIT_WEIGHT_OUNCES = '@Unit.Weight.Ounces'; + + /** + * Defines unit weight pounds asset + * @type {String} + */ + static UNIT_WEIGHT_POUNDS = '@Unit.Weight.Pounds'; + /** * Defines value close asset * @type {String}