UNPKG

magichome-platform

Version:

discover, control, and receive status for magichome devices

721 lines (720 loc) 24.5 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.fireworks = exports.hell = exports.colorTest = exports.cctRgbTest = exports.cctColorWave = exports.cctWave = exports.colorWave = exports.hellStruck = exports.thunderStruck = exports.rainbow = exports.raining = void 0; const animationUtils_1 = require("./animationUtils"); exports.raining = { name: "raining", priority: 9, syncSequenceTimings: false, syncSequenceColor: false, lightOffsetDurationMS: 0, animationSequences: [ { targetColor: { red: 0, green: [0, 2], blue: [0, 5], warmWhite: 0, coldWhite: 0, }, transitionDurationMS: 1000, durationAtTargetMS: 100, interpolationType: animationUtils_1.InterpolationType.EASE_IN_SINE, skipChance: 0, }, ] }; exports.rainbow = { name: "rainbow", priority: 9, syncSequenceTimings: false, syncSequenceColor: true, lightOffsetDurationMS: 0, animationSequences: [ { targetColor: { red: 255, green: 0, blue: 0, warmWhite: 0, coldWhite: 0, }, transitionDurationMS: 5000, durationAtTargetMS: 100, interpolationType: animationUtils_1.InterpolationType.EASE_IN, skipChance: 0, }, { targetColor: { red: 255, green: 255, blue: 0, warmWhite: 0, coldWhite: 0, }, transitionDurationMS: 5000, durationAtTargetMS: 100, interpolationType: animationUtils_1.InterpolationType.EASE_IN, skipChance: 0, }, { targetColor: { red: 0, green: 255, blue: 0, warmWhite: 0, coldWhite: 0, }, transitionDurationMS: 5000, durationAtTargetMS: 100, interpolationType: animationUtils_1.InterpolationType.EASE_IN, skipChance: 0, }, { targetColor: { red: 0, green: 255, blue: 255, warmWhite: 0, coldWhite: 0, }, transitionDurationMS: 5000, durationAtTargetMS: 100, interpolationType: animationUtils_1.InterpolationType.EASE_IN, skipChance: 0, }, { targetColor: { red: 0, green: 0, blue: 255, warmWhite: 0, coldWhite: 0, }, transitionDurationMS: 5000, durationAtTargetMS: 100, interpolationType: animationUtils_1.InterpolationType.EASE_IN, skipChance: 0, }, { targetColor: { red: 255, green: 0, blue: 255, warmWhite: 0, coldWhite: 0, }, transitionDurationMS: 5000, durationAtTargetMS: 100, interpolationType: animationUtils_1.InterpolationType.EASE_IN, skipChance: 0, } ] }; exports.thunderStruck = { name: "thunderStruck", priority: 1, syncSequenceTimings: false, syncSequenceColor: false, lightOffsetDurationMS: 0, animationSequences: [ { targetColor: { red: 0, green: 0, blue: 0, warmWhite: 0, coldWhite: 0, }, transitionDurationMS: 0, durationAtTargetMS: [2000, 60000], interpolationType: animationUtils_1.InterpolationType.LINEAR, skipChance: 0, }, { startColor: { red: 0, green: 0, blue: 0, warmWhite: 0, coldWhite: 255, }, targetColor: { red: 0, green: 0, blue: 0, warmWhite: 0, coldWhite: 255, }, transitionDurationMS: 0, durationAtTargetMS: 300, interpolationType: animationUtils_1.InterpolationType.LINEAR, skipChance: 0, }, { targetColor: { red: 0, green: 0, blue: 0, warmWhite: 0, coldWhite: 0, }, transitionDurationMS: [300, 450], durationAtTargetMS: [100, 150], interpolationType: animationUtils_1.InterpolationType.LINEAR, skipChance: 0, }, { startColor: { red: 0, green: 0, blue: 0, warmWhite: 0, coldWhite: 0, }, targetColor: { red: 0, green: 0, blue: 0, warmWhite: 0, coldWhite: 255, }, transitionDurationMS: 50, durationAtTargetMS: 500, interpolationType: animationUtils_1.InterpolationType.LINEAR, skipChance: 60, } ] }; // export const thunderStruck: IAnimationLoop = { // 'name': 'ThunderStruck', // 'pattern': [ // { // 'colorStart': { // RGB: { red: 0, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 0 }, // }, // 'colorTarget': { // RGB: { red: 0, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 255 }, // }, // 'transitionTimeMS': 50, // 'durationAtTargetMS': 50, // 'chancePercent': 50, // }, // { // 'colorStart': { // RGB: { red: 0, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 0 }, // }, // 'colorTarget': { // RGB: { red: 0, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 0 }, // }, // 'transitionTimeMS': 50, // 'durationAtTargetMS': 100, // 'chancePercent': 100, // }, // { // 'colorStart': { // RGB: { red: 0, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 0 }, // }, // 'colorTarget': { // RGB: { red: 0, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 255 }, // }, // 'transitionTimeMS': 50, // 'durationAtTargetMS': 50, // 'chancePercent': 100, // }, // { // 'colorStart': { // RGB: { red: 0, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 0 }, // }, // 'colorTarget': { // RGB: { red: 0, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 0 }, // }, // 'transitionTimeMS': 500, // 'durationAtTargetMS': [5000, 10000], // 'chancePercent': 100, // }, // ], // 'accessoryOffsetMS': 0, // }; exports.hellStruck = { 'name': 'HellStruck', 'pattern': [ { 'colorStart': { RGB: { red: 10, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'colorTarget': { RGB: { red: 10, green: 0, blue: 0 }, CCT: { warmWhite: 255, coldWhite: 0 }, }, 'transitionTimeMS': 50, 'durationAtTargetMS': 100, 'chancePercent': 50, }, { 'colorStart': { RGB: { red: 10, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'colorTarget': { RGB: { red: 10, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'transitionTimeMS': 50, 'durationAtTargetMS': 100, 'chancePercent': 100, }, { 'colorStart': { RGB: { red: 10, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'colorTarget': { RGB: { red: 10, green: 0, blue: 0 }, CCT: { warmWhite: 255, coldWhite: 0 }, }, 'transitionTimeMS': 1, 'durationAtTargetMS': 100, 'chancePercent': 100, }, { 'colorStart': { RGB: { red: 10, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'colorTarget': { RGB: { red: 10, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'transitionTimeMS': 500, 'durationAtTargetMS': [1000, 3000], 'chancePercent': 100, }, ], 'accessoryOffsetMS': 0, }; exports.colorWave = { 'name': 'colorWave', 'pattern': [ { 'colorStart': { RGB: { red: 255, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'colorTarget': { RGB: { red: 127, green: 127, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'transitionTimeMS': 1000, 'durationAtTargetMS': 0, 'chancePercent': 100, }, { 'colorStart': { RGB: { red: 0, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'colorTarget': { RGB: { red: 0, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 255 }, }, 'transitionTimeMS': 200, 'durationAtTargetMS': 300, 'chancePercent': 20, }, { 'colorStart': { RGB: { red: 127, green: 127, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'colorTarget': { RGB: { red: 0, green: 255, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'transitionTimeMS': 1000, 'durationAtTargetMS': 0, 'chancePercent': 100, }, { 'colorStart': { RGB: { red: 0, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'colorTarget': { RGB: { red: 0, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 255 }, }, 'transitionTimeMS': 200, 'durationAtTargetMS': 300, 'chancePercent': 20, }, { 'colorStart': { RGB: { red: 0, green: 255, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'colorTarget': { RGB: { red: 0, green: 127, blue: 127 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'transitionTimeMS': 1000, 'durationAtTargetMS': 0, 'chancePercent': 100, }, { 'colorStart': { RGB: { red: 0, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'colorTarget': { RGB: { red: 0, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 255 }, }, 'transitionTimeMS': 200, 'durationAtTargetMS': 300, 'chancePercent': 20, }, { 'colorStart': { RGB: { red: 0, green: 127, blue: 127 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'colorTarget': { RGB: { red: 0, green: 0, blue: 255 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'transitionTimeMS': 1000, 'durationAtTargetMS': 0, 'chancePercent': 100, }, { 'colorStart': { RGB: { red: 0, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'colorTarget': { RGB: { red: 0, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 255 }, }, 'transitionTimeMS': 200, 'durationAtTargetMS': 300, 'chancePercent': 20, }, { 'colorStart': { RGB: { red: 0, green: 0, blue: 255 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'colorTarget': { RGB: { red: 127, green: 0, blue: 127 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'transitionTimeMS': 1000, 'durationAtTargetMS': 0, 'chancePercent': 100, }, { 'colorStart': { RGB: { red: 0, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'colorTarget': { RGB: { red: 0, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 255 }, }, 'transitionTimeMS': 200, 'durationAtTargetMS': 300, 'chancePercent': 20, }, { 'colorStart': { RGB: { red: 127, green: 0, blue: 127 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'colorTarget': { RGB: { red: 255, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'transitionTimeMS': 1000, 'durationAtTargetMS': 0, 'chancePercent': 100, }, { 'colorStart': { RGB: { red: 0, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'colorTarget': { RGB: { red: 0, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 255 }, }, 'transitionTimeMS': 200, 'durationAtTargetMS': 300, 'chancePercent': 20, }, ], 'accessoryOffsetMS': 1000, }; exports.cctWave = { 'name': 'cctWave', 'pattern': [ { 'colorTarget': { RGB: { red: 0, green: 0, blue: 0 }, CCT: { warmWhite: 255, coldWhite: 0 }, }, 'transitionTimeMS': 1000, 'durationAtTargetMS': 0, 'chancePercent': 100, }, { 'colorTarget': { RGB: { red: 0, green: 0, blue: 0 }, CCT: { warmWhite: 255, coldWhite: 255 }, }, 'transitionTimeMS': 1000, 'durationAtTargetMS': 0, 'chancePercent': 100, }, { 'colorTarget': { RGB: { red: 0, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 255 }, }, 'transitionTimeMS': 1000, 'durationAtTargetMS': 0, 'chancePercent': 100, }, { 'colorTarget': { RGB: { red: 0, green: 0, blue: 0 }, CCT: { warmWhite: 255, coldWhite: 255 }, }, 'transitionTimeMS': 1000, 'durationAtTargetMS': 0, 'chancePercent': 100, }, ], 'accessoryOffsetMS': 0, }; exports.cctColorWave = { 'name': 'cctColorWave', 'pattern': [ { 'colorTarget': { RGB: { red: 255, green: 0, blue: 0 }, CCT: { warmWhite: 255, coldWhite: 0 }, }, 'transitionTimeMS': 1000, 'durationAtTargetMS': 200, 'chancePercent': 100, }, { 'colorTarget': { RGB: { red: 127, green: 127, blue: 0 }, CCT: { warmWhite: 255, coldWhite: 0 }, }, 'transitionTimeMS': 1000, 'durationAtTargetMS': 200, 'chancePercent': 100, }, { 'colorTarget': { RGB: { red: 0, green: 255, blue: 0 }, CCT: { warmWhite: 255, coldWhite: 0 }, }, 'transitionTimeMS': 1000, 'durationAtTargetMS': 200, 'chancePercent': 100, }, { 'colorTarget': { RGB: { red: 0, green: 127, blue: 127 }, CCT: { warmWhite: 255, coldWhite: 0 }, }, 'transitionTimeMS': 1000, 'durationAtTargetMS': 200, 'chancePercent': 100, }, { 'colorTarget': { RGB: { red: 0, green: 0, blue: 255 }, CCT: { warmWhite: 255, coldWhite: 0 }, }, 'transitionTimeMS': 1000, 'durationAtTargetMS': 200, 'chancePercent': 100, }, { 'colorTarget': { RGB: { red: 127, green: 0, blue: 127 }, CCT: { warmWhite: 255, coldWhite: 0 }, }, 'transitionTimeMS': 1000, 'durationAtTargetMS': 200, 'chancePercent': 100, }, ], 'accessoryOffsetMS': 0, }; exports.cctRgbTest = { 'name': 'cctRgbTest', 'pattern': [ { 'colorStart': { RGB: { red: 255, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'colorTarget': { RGB: { red: 255, green: 0, blue: 0 }, CCT: { warmWhite: 255, coldWhite: 0 }, }, 'transitionTimeMS': 3000, 'durationAtTargetMS': 500, 'chancePercent': 100, }, { 'colorStart': { RGB: { red: 255, green: 0, blue: 0 }, CCT: { warmWhite: 255, coldWhite: 0 }, }, 'colorTarget': { RGB: { red: 255, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'transitionTimeMS': 3000, 'durationAtTargetMS': 500, 'chancePercent': 100, }, { 'colorStart': { RGB: { red: 255, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'colorTarget': { RGB: { red: 255, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 255 }, }, 'transitionTimeMS': 3000, 'durationAtTargetMS': 500, 'chancePercent': 100, }, { 'colorStart': { RGB: { red: 255, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 255 }, }, 'colorTarget': { RGB: { red: 255, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'transitionTimeMS': 3000, 'durationAtTargetMS': 500, 'chancePercent': 100, }, { 'colorStart': { RGB: { red: 255, green: 0, blue: 0 }, CCT: { warmWhite: 255, coldWhite: 0 }, }, 'colorTarget': { RGB: { red: 255, green: 0, blue: 0 }, CCT: { warmWhite: 255, coldWhite: 0 }, }, 'transitionTimeMS': 0, 'durationAtTargetMS': 3000, 'chancePercent': 100, }, { 'colorStart': { RGB: { red: 255, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 255 }, }, 'colorTarget': { RGB: { red: 255, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 255 }, }, 'transitionTimeMS': 0, 'durationAtTargetMS': 3000, 'chancePercent': 100, }, { 'colorStart': { RGB: { red: 255, green: 0, blue: 0 }, CCT: { warmWhite: 255, coldWhite: 0 }, }, 'colorTarget': { RGB: { red: 255, green: 0, blue: 0 }, CCT: { warmWhite: 255, coldWhite: 0 }, }, 'transitionTimeMS': 0, 'durationAtTargetMS': 3000, 'chancePercent': 100, }, { 'colorStart': { RGB: { red: 255, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 255 }, }, 'colorTarget': { RGB: { red: 255, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 255 }, }, 'transitionTimeMS': 0, 'durationAtTargetMS': 3000, 'chancePercent': 100, }, ], 'accessoryOffsetMS': 0, }; exports.colorTest = { 'name': 'colorTest', 'pattern': [ { 'colorStart': { RGB: { red: 0, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'colorTarget': { RGB: { red: 255, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'transitionTimeMS': 3000, 'durationAtTargetMS': 3000, 'chancePercent': 100, }, { 'colorStart': { RGB: { red: 0, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'colorTarget': { RGB: { red: 0, green: 255, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'transitionTimeMS': 3000, 'durationAtTargetMS': 3000, 'chancePercent': 100, }, { 'colorStart': { RGB: { red: 0, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'colorTarget': { RGB: { red: 0, green: 0, blue: 255 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'transitionTimeMS': 3000, 'durationAtTargetMS': 3000, 'chancePercent': 100, }, ], 'accessoryOffsetMS': 6000, }; exports.hell = { 'name': 'hell', 'pattern': [ { 'colorTarget': { RGB: { red: [100, 255], green: [0, 25], blue: 0 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'transitionTimeMS': [200, 300], 'durationAtTargetMS': [0, 2000], 'chancePercent': 100, }, { 'colorStart': { RGB: { red: 255, green: 255, blue: 255 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'colorTarget': { RGB: { red: [100, 255], green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'transitionTimeMS': 200, 'durationAtTargetMS': [100, 150], 'chancePercent': 10, }, ], 'accessoryOffsetMS': 0, }; exports.fireworks = { 'name': 'fireworks', 'pattern': [ { 'colorStart': { RGB: { red: 0, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'colorTarget': { RGB: { red: [100, 255], green: [25, 50], blue: 0 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'transitionTimeMS': 200, 'durationAtTargetMS': [100, 150], 'chancePercent': 100, }, { 'colorTarget': { RGB: { red: [150, 200], green: [150, 200], blue: 0 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'transitionTimeMS': 200, 'durationAtTargetMS': [100, 150], 'chancePercent': 100, }, { 'colorTarget': { RGB: { red: 0, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 255 }, }, 'transitionTimeMS': 200, 'durationAtTargetMS': [500, 2000], 'chancePercent': 100, }, { 'colorStart': { RGB: { red: 0, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'colorTarget': { RGB: { red: 0, green: 0, blue: 0 }, CCT: { warmWhite: 0, coldWhite: 0 }, }, 'transitionTimeMS': 750, 'durationAtTargetMS': [1000, 2000], 'chancePercent': 100, }, ], 'accessoryOffsetMS': 0, };