node-red-contrib-huemagic 4.2.2 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +89 -5
- package/README.md +506 -123
- package/examples/Deutsch/Hue Automation.json +176 -0
- package/examples/Deutsch/Hue Bridge.json +256 -0
- package/examples/Deutsch/Hue Brightness.json +150 -0
- package/examples/Deutsch/Hue Buttons.json +88 -0
- package/examples/Deutsch/Hue Contact.json +150 -0
- package/examples/Deutsch/Hue Group.json +658 -0
- package/examples/Deutsch/Hue Light.json +893 -0
- package/examples/Deutsch/Hue Magic.json +148 -0
- package/examples/Deutsch/Hue Motion.json +150 -0
- package/examples/Deutsch/Hue Rules.json +150 -0
- package/examples/Deutsch/Hue Scene.json +178 -0
- package/examples/Deutsch/Hue Speaker.json +274 -0
- package/examples/Deutsch/Hue Sync Box.json +378 -0
- package/examples/Deutsch/Hue Temperature.json +150 -0
- package/examples/English/Hue Automation.json +176 -0
- package/examples/{Hue Bridge.json → English/Hue Bridge.json } +1 -1
- package/examples/{Hue Brightness.json → English/Hue Brightness.json } +1 -1
- package/examples/{Hue Buttons.json → English/Hue Buttons.json } +1 -1
- package/examples/English/Hue Contact.json +150 -0
- package/examples/{Hue Group.json → English/Hue Group.json } +1 -1
- package/examples/{Hue Light.json → English/Hue Light.json } +1 -1
- package/examples/{Hue Magic.json → English/Hue Magic.json } +1 -1
- package/examples/{Hue Motion.json → English/Hue Motion.json } +1 -1
- package/examples/{Hue Rules.json → English/Hue Rules.json } +1 -1
- package/examples/{Hue Scene.json → English/Hue Scene.json } +1 -1
- package/examples/English/Hue Speaker.json +274 -0
- package/examples/English/Hue Sync Box.json +378 -0
- package/examples/{Hue Temperature.json → English/Hue Temperature.json } +1 -1
- package/examples/Espa/303/261ol/Hue Automation.json" +176 -0
- package/examples/Espa/303/261ol/Hue Bridge.json" +256 -0
- package/examples/Espa/303/261ol/Hue Brightness.json" +150 -0
- package/examples/Espa/303/261ol/Hue Buttons.json" +88 -0
- package/examples/Espa/303/261ol/Hue Contact.json" +150 -0
- package/examples/Espa/303/261ol/Hue Group.json" +658 -0
- package/examples/Espa/303/261ol/Hue Light.json" +893 -0
- package/examples/Espa/303/261ol/Hue Magic.json" +148 -0
- package/examples/Espa/303/261ol/Hue Motion.json" +150 -0
- package/examples/Espa/303/261ol/Hue Rules.json" +150 -0
- package/examples/Espa/303/261ol/Hue Scene.json" +178 -0
- package/examples/Espa/303/261ol/Hue Speaker.json" +274 -0
- package/examples/Espa/303/261ol/Hue Sync Box.json" +378 -0
- package/examples/Espa/303/261ol/Hue Temperature.json" +150 -0
- package/examples/Fran/303/247ais/Hue Automation.json" +176 -0
- package/examples/Fran/303/247ais/Hue Bridge.json" +256 -0
- package/examples/Fran/303/247ais/Hue Brightness.json" +150 -0
- package/examples/Fran/303/247ais/Hue Buttons.json" +88 -0
- package/examples/Fran/303/247ais/Hue Contact.json" +150 -0
- package/examples/Fran/303/247ais/Hue Group.json" +658 -0
- package/examples/Fran/303/247ais/Hue Light.json" +893 -0
- package/examples/Fran/303/247ais/Hue Magic.json" +148 -0
- package/examples/Fran/303/247ais/Hue Motion.json" +150 -0
- package/examples/Fran/303/247ais/Hue Rules.json" +150 -0
- package/examples/Fran/303/247ais/Hue Scene.json" +178 -0
- package/examples/Fran/303/247ais/Hue Speaker.json" +274 -0
- package/examples/Fran/303/247ais/Hue Sync Box.json" +378 -0
- package/examples/Fran/303/247ais/Hue Temperature.json" +150 -0
- package/examples/Italiano/Hue Automation.json +176 -0
- package/examples/Italiano/Hue Bridge.json +256 -0
- package/examples/Italiano/Hue Brightness.json +150 -0
- package/examples/Italiano/Hue Buttons.json +88 -0
- package/examples/Italiano/Hue Contact.json +150 -0
- package/examples/Italiano/Hue Group.json +658 -0
- package/examples/Italiano/Hue Light.json +893 -0
- package/examples/Italiano/Hue Magic.json +148 -0
- package/examples/Italiano/Hue Motion.json +150 -0
- package/examples/Italiano/Hue Rules.json +150 -0
- package/examples/Italiano/Hue Scene.json +178 -0
- package/examples/Italiano/Hue Speaker.json +274 -0
- package/examples/Italiano/Hue Sync Box.json +378 -0
- package/examples/Italiano/Hue Temperature.json +150 -0
- package/examples/Nederlands/Hue Automation.json +176 -0
- package/examples/Nederlands/Hue Bridge.json +256 -0
- package/examples/Nederlands/Hue Brightness.json +150 -0
- package/examples/Nederlands/Hue Buttons.json +88 -0
- package/examples/Nederlands/Hue Contact.json +150 -0
- package/examples/Nederlands/Hue Group.json +658 -0
- package/examples/Nederlands/Hue Light.json +893 -0
- package/examples/Nederlands/Hue Magic.json +148 -0
- package/examples/Nederlands/Hue Motion.json +150 -0
- package/examples/Nederlands/Hue Rules.json +150 -0
- package/examples/Nederlands/Hue Scene.json +178 -0
- package/examples/Nederlands/Hue Speaker.json +274 -0
- package/examples/Nederlands/Hue Sync Box.json +378 -0
- package/examples/Nederlands/Hue Temperature.json +150 -0
- package/examples/Polski/Hue Automation.json +176 -0
- package/examples/Polski/Hue Bridge.json +256 -0
- package/examples/Polski/Hue Brightness.json +150 -0
- package/examples/Polski/Hue Buttons.json +88 -0
- package/examples/Polski/Hue Contact.json +150 -0
- package/examples/Polski/Hue Group.json +658 -0
- package/examples/Polski/Hue Light.json +893 -0
- package/examples/Polski/Hue Magic.json +148 -0
- package/examples/Polski/Hue Motion.json +150 -0
- package/examples/Polski/Hue Rules.json +150 -0
- package/examples/Polski/Hue Scene.json +178 -0
- package/examples/Polski/Hue Speaker.json +274 -0
- package/examples/Polski/Hue Sync Box.json +378 -0
- package/examples/Polski/Hue Temperature.json +150 -0
- package/examples/Portugu/303/252s/Hue Automation.json" +176 -0
- package/examples/Portugu/303/252s/Hue Bridge.json" +256 -0
- package/examples/Portugu/303/252s/Hue Brightness.json" +150 -0
- package/examples/Portugu/303/252s/Hue Buttons.json" +88 -0
- package/examples/Portugu/303/252s/Hue Contact.json" +150 -0
- package/examples/Portugu/303/252s/Hue Group.json" +658 -0
- package/examples/Portugu/303/252s/Hue Light.json" +893 -0
- package/examples/Portugu/303/252s/Hue Magic.json" +148 -0
- package/examples/Portugu/303/252s/Hue Motion.json" +150 -0
- package/examples/Portugu/303/252s/Hue Rules.json" +150 -0
- package/examples/Portugu/303/252s/Hue Scene.json" +178 -0
- package/examples/Portugu/303/252s/Hue Speaker.json" +274 -0
- package/examples/Portugu/303/252s/Hue Sync Box.json" +378 -0
- package/examples/Portugu/303/252s/Hue Temperature.json" +150 -0
- package/examples/T/303/274rk/303/247e/Hue Automation.json" +176 -0
- package/examples/T/303/274rk/303/247e/Hue Bridge.json" +256 -0
- package/examples/T/303/274rk/303/247e/Hue Brightness.json" +150 -0
- package/examples/T/303/274rk/303/247e/Hue Buttons.json" +88 -0
- package/examples/T/303/274rk/303/247e/Hue Contact.json" +150 -0
- package/examples/T/303/274rk/303/247e/Hue Group.json" +658 -0
- package/examples/T/303/274rk/303/247e/Hue Light.json" +893 -0
- package/examples/T/303/274rk/303/247e/Hue Magic.json" +148 -0
- package/examples/T/303/274rk/303/247e/Hue Motion.json" +150 -0
- package/examples/T/303/274rk/303/247e/Hue Rules.json" +150 -0
- package/examples/T/303/274rk/303/247e/Hue Scene.json" +178 -0
- package/examples/T/303/274rk/303/247e/Hue Speaker.json" +274 -0
- package/examples/T/303/274rk/303/247e/Hue Sync Box.json" +378 -0
- package/examples/T/303/274rk/303/247e/Hue Temperature.json" +150 -0
- package/examples//316/225/316/273/316/273/316/267/316/275/316/271/316/272/316/254/Hue Automation.json" +176 -0
- package/examples//316/225/316/273/316/273/316/267/316/275/316/271/316/272/316/254/Hue Bridge.json" +256 -0
- package/examples//316/225/316/273/316/273/316/267/316/275/316/271/316/272/316/254/Hue Brightness.json" +150 -0
- package/examples//316/225/316/273/316/273/316/267/316/275/316/271/316/272/316/254/Hue Buttons.json" +88 -0
- package/examples//316/225/316/273/316/273/316/267/316/275/316/271/316/272/316/254/Hue Contact.json" +150 -0
- package/examples//316/225/316/273/316/273/316/267/316/275/316/271/316/272/316/254/Hue Group.json" +658 -0
- package/examples//316/225/316/273/316/273/316/267/316/275/316/271/316/272/316/254/Hue Light.json" +893 -0
- package/examples//316/225/316/273/316/273/316/267/316/275/316/271/316/272/316/254/Hue Magic.json" +148 -0
- package/examples//316/225/316/273/316/273/316/267/316/275/316/271/316/272/316/254/Hue Motion.json" +150 -0
- package/examples//316/225/316/273/316/273/316/267/316/275/316/271/316/272/316/254/Hue Rules.json" +150 -0
- package/examples//316/225/316/273/316/273/316/267/316/275/316/271/316/272/316/254/Hue Scene.json" +178 -0
- package/examples//316/225/316/273/316/273/316/267/316/275/316/271/316/272/316/254/Hue Speaker.json" +274 -0
- package/examples//316/225/316/273/316/273/316/267/316/275/316/271/316/272/316/254/Hue Sync Box.json" +378 -0
- package/examples//316/225/316/273/316/273/316/267/316/275/316/271/316/272/316/254/Hue Temperature.json" +150 -0
- package/huemagic/assets/huemagic-examples.gif +0 -0
- package/huemagic/hue-automation.html +218 -0
- package/huemagic/hue-automation.js +173 -0
- package/huemagic/hue-bridge-config.html +39 -32
- package/huemagic/hue-bridge-config.js +290 -99
- package/huemagic/hue-bridge.html +8 -8
- package/huemagic/hue-bridge.js +29 -4
- package/huemagic/hue-brightness.html +21 -9
- package/huemagic/hue-brightness.js +20 -10
- package/huemagic/hue-buttons.html +16 -9
- package/huemagic/hue-buttons.js +90 -27
- package/huemagic/hue-contact.html +218 -0
- package/huemagic/hue-contact.js +209 -0
- package/huemagic/hue-group.html +16 -9
- package/huemagic/hue-group.js +141 -179
- package/huemagic/hue-light.html +19 -12
- package/huemagic/hue-light.js +222 -167
- package/huemagic/hue-magic.html +3 -5
- package/huemagic/hue-motion.html +16 -9
- package/huemagic/hue-motion.js +37 -8
- package/huemagic/hue-rules.html +16 -9
- package/huemagic/hue-rules.js +16 -8
- package/huemagic/hue-scene.html +9 -5
- package/huemagic/hue-scene.js +52 -16
- package/huemagic/hue-speaker.html +218 -0
- package/huemagic/hue-speaker.js +257 -0
- package/huemagic/hue-syncbox-config.html +123 -0
- package/huemagic/hue-syncbox-config.js +179 -0
- package/huemagic/hue-syncbox.html +82 -0
- package/huemagic/hue-syncbox.js +274 -0
- package/huemagic/hue-temperature.html +21 -9
- package/huemagic/hue-temperature.js +18 -10
- package/huemagic/icons/hue-automation.png +0 -0
- package/huemagic/icons/hue-automation.svg +3 -0
- package/huemagic/icons/hue-contact.png +0 -0
- package/huemagic/icons/hue-contact.svg +4 -0
- package/huemagic/icons/hue-speaker.png +0 -0
- package/huemagic/icons/hue-speaker.svg +6 -0
- package/huemagic/icons/hue-syncbox.png +0 -0
- package/huemagic/icons/hue-syncbox.svg +7 -0
- package/huemagic/locales/de/hue-automation.html +59 -0
- package/huemagic/locales/de/hue-automation.json +33 -0
- package/huemagic/locales/de/hue-bridge-config.json +23 -12
- package/huemagic/locales/de/hue-bridge.html +7 -4
- package/huemagic/locales/de/hue-bridge.json +9 -10
- package/huemagic/locales/de/hue-brightness.html +9 -6
- package/huemagic/locales/de/hue-brightness.json +13 -9
- package/huemagic/locales/de/hue-buttons.html +5 -4
- package/huemagic/locales/de/hue-buttons.json +22 -8
- package/huemagic/locales/de/hue-contact.html +67 -0
- package/huemagic/locales/de/hue-contact.json +35 -0
- package/huemagic/locales/de/hue-group.html +17 -6
- package/huemagic/locales/de/hue-group.json +16 -9
- package/huemagic/locales/de/hue-light.html +6 -6
- package/huemagic/locales/de/hue-light.json +17 -9
- package/huemagic/locales/de/hue-magic.html +1 -1
- package/huemagic/locales/de/hue-magic.json +6 -8
- package/huemagic/locales/de/hue-motion.html +4 -4
- package/huemagic/locales/de/hue-motion.json +14 -9
- package/huemagic/locales/de/hue-rules.html +2 -2
- package/huemagic/locales/de/hue-rules.json +10 -9
- package/huemagic/locales/de/hue-scene.html +11 -3
- package/huemagic/locales/de/hue-scene.json +9 -9
- package/huemagic/locales/de/hue-speaker.html +80 -0
- package/huemagic/locales/de/hue-speaker.json +38 -0
- package/huemagic/locales/de/hue-syncbox-config.html +19 -0
- package/huemagic/locales/de/hue-syncbox-config.json +25 -0
- package/huemagic/locales/de/hue-syncbox.html +86 -0
- package/huemagic/locales/de/hue-syncbox.json +30 -0
- package/huemagic/locales/de/hue-temperature.html +7 -5
- package/huemagic/locales/de/hue-temperature.json +13 -9
- package/huemagic/locales/el/hue-automation.html +59 -0
- package/huemagic/locales/el/hue-automation.json +33 -0
- package/huemagic/locales/el/hue-bridge-config.html +31 -0
- package/huemagic/locales/el/hue-bridge-config.json +40 -0
- package/huemagic/locales/el/hue-bridge.html +96 -0
- package/huemagic/locales/el/hue-bridge.json +26 -0
- package/huemagic/locales/el/hue-brightness.html +70 -0
- package/huemagic/locales/el/hue-brightness.json +37 -0
- package/huemagic/locales/el/hue-buttons.html +59 -0
- package/huemagic/locales/el/hue-buttons.json +42 -0
- package/huemagic/locales/el/hue-contact.html +67 -0
- package/huemagic/locales/el/hue-contact.json +35 -0
- package/huemagic/locales/el/hue-group.html +87 -0
- package/huemagic/locales/el/hue-group.json +46 -0
- package/huemagic/locales/el/hue-light.html +97 -0
- package/huemagic/locales/el/hue-light.json +44 -0
- package/huemagic/locales/el/hue-magic.html +68 -0
- package/huemagic/locales/el/hue-magic.json +26 -0
- package/huemagic/locales/el/hue-motion.html +64 -0
- package/huemagic/locales/el/hue-motion.json +36 -0
- package/huemagic/locales/el/hue-rules.html +69 -0
- package/huemagic/locales/el/hue-rules.json +30 -0
- package/huemagic/locales/el/hue-scene.html +43 -0
- package/huemagic/locales/el/hue-scene.json +32 -0
- package/huemagic/locales/el/hue-speaker.html +80 -0
- package/huemagic/locales/el/hue-speaker.json +38 -0
- package/huemagic/locales/el/hue-syncbox-config.html +19 -0
- package/huemagic/locales/el/hue-syncbox-config.json +25 -0
- package/huemagic/locales/el/hue-syncbox.html +86 -0
- package/huemagic/locales/el/hue-syncbox.json +30 -0
- package/huemagic/locales/el/hue-temperature.html +69 -0
- package/huemagic/locales/el/hue-temperature.json +33 -0
- package/huemagic/locales/en/hue-automation.html +59 -0
- package/huemagic/locales/en/hue-automation.json +33 -0
- package/huemagic/locales/en/hue-bridge-config.json +40 -0
- package/huemagic/locales/{en-US → en}/hue-bridge.html +5 -2
- package/huemagic/locales/{en-US → en}/hue-bridge.json +8 -9
- package/huemagic/locales/{en-US → en}/hue-brightness.html +6 -3
- package/huemagic/locales/{en-US → en}/hue-brightness.json +11 -9
- package/huemagic/locales/{en-US → en}/hue-buttons.html +4 -3
- package/huemagic/locales/en/hue-buttons.json +42 -0
- package/huemagic/locales/en/hue-contact.html +67 -0
- package/huemagic/locales/en/hue-contact.json +35 -0
- package/huemagic/locales/{en-US → en}/hue-group.html +16 -5
- package/huemagic/locales/{en-US → en}/hue-group.json +15 -10
- package/huemagic/locales/{en-US → en}/hue-light.html +3 -3
- package/huemagic/locales/en/hue-light.json +44 -0
- package/huemagic/locales/{en-US → en}/hue-magic.html +1 -1
- package/huemagic/locales/{en-US → en}/hue-motion.html +2 -2
- package/huemagic/locales/{en-US → en}/hue-motion.json +12 -9
- package/huemagic/locales/{en-US → en}/hue-rules.html +2 -2
- package/huemagic/locales/{en-US → en}/hue-rules.json +10 -9
- package/huemagic/locales/{en-US → en}/hue-scene.html +11 -3
- package/huemagic/locales/{en-US → en}/hue-scene.json +9 -9
- package/huemagic/locales/en/hue-speaker.html +80 -0
- package/huemagic/locales/en/hue-speaker.json +38 -0
- package/huemagic/locales/en/hue-syncbox-config.html +19 -0
- package/huemagic/locales/en/hue-syncbox-config.json +25 -0
- package/huemagic/locales/en/hue-syncbox.html +86 -0
- package/huemagic/locales/en/hue-syncbox.json +30 -0
- package/huemagic/locales/{en-US → en}/hue-temperature.html +4 -2
- package/huemagic/locales/{en-US → en}/hue-temperature.json +11 -9
- package/huemagic/locales/es/hue-automation.html +59 -0
- package/huemagic/locales/es/hue-automation.json +33 -0
- package/huemagic/locales/es/hue-bridge-config.html +31 -0
- package/huemagic/locales/es/hue-bridge-config.json +40 -0
- package/huemagic/locales/es/hue-bridge.html +96 -0
- package/huemagic/locales/es/hue-bridge.json +26 -0
- package/huemagic/locales/es/hue-brightness.html +70 -0
- package/huemagic/locales/es/hue-brightness.json +37 -0
- package/huemagic/locales/es/hue-buttons.html +59 -0
- package/huemagic/locales/es/hue-buttons.json +42 -0
- package/huemagic/locales/es/hue-contact.html +67 -0
- package/huemagic/locales/es/hue-contact.json +35 -0
- package/huemagic/locales/es/hue-group.html +87 -0
- package/huemagic/locales/es/hue-group.json +46 -0
- package/huemagic/locales/es/hue-light.html +97 -0
- package/huemagic/locales/es/hue-light.json +44 -0
- package/huemagic/locales/es/hue-magic.html +68 -0
- package/huemagic/locales/es/hue-magic.json +26 -0
- package/huemagic/locales/es/hue-motion.html +64 -0
- package/huemagic/locales/es/hue-motion.json +36 -0
- package/huemagic/locales/es/hue-rules.html +69 -0
- package/huemagic/locales/es/hue-rules.json +30 -0
- package/huemagic/locales/es/hue-scene.html +43 -0
- package/huemagic/locales/es/hue-scene.json +32 -0
- package/huemagic/locales/es/hue-speaker.html +80 -0
- package/huemagic/locales/es/hue-speaker.json +38 -0
- package/huemagic/locales/es/hue-syncbox-config.html +19 -0
- package/huemagic/locales/es/hue-syncbox-config.json +25 -0
- package/huemagic/locales/es/hue-syncbox.html +86 -0
- package/huemagic/locales/es/hue-syncbox.json +30 -0
- package/huemagic/locales/es/hue-temperature.html +69 -0
- package/huemagic/locales/es/hue-temperature.json +33 -0
- package/huemagic/locales/fr/hue-automation.html +59 -0
- package/huemagic/locales/fr/hue-automation.json +33 -0
- package/huemagic/locales/fr/hue-bridge-config.html +31 -0
- package/huemagic/locales/fr/hue-bridge-config.json +40 -0
- package/huemagic/locales/fr/hue-bridge.html +96 -0
- package/huemagic/locales/fr/hue-bridge.json +26 -0
- package/huemagic/locales/fr/hue-brightness.html +70 -0
- package/huemagic/locales/fr/hue-brightness.json +37 -0
- package/huemagic/locales/fr/hue-buttons.html +59 -0
- package/huemagic/locales/fr/hue-buttons.json +42 -0
- package/huemagic/locales/fr/hue-contact.html +67 -0
- package/huemagic/locales/fr/hue-contact.json +35 -0
- package/huemagic/locales/fr/hue-group.html +87 -0
- package/huemagic/locales/fr/hue-group.json +46 -0
- package/huemagic/locales/fr/hue-light.html +97 -0
- package/huemagic/locales/fr/hue-light.json +44 -0
- package/huemagic/locales/fr/hue-magic.html +68 -0
- package/huemagic/locales/fr/hue-magic.json +26 -0
- package/huemagic/locales/fr/hue-motion.html +64 -0
- package/huemagic/locales/fr/hue-motion.json +36 -0
- package/huemagic/locales/fr/hue-rules.html +69 -0
- package/huemagic/locales/fr/hue-rules.json +30 -0
- package/huemagic/locales/fr/hue-scene.html +43 -0
- package/huemagic/locales/fr/hue-scene.json +32 -0
- package/huemagic/locales/fr/hue-speaker.html +80 -0
- package/huemagic/locales/fr/hue-speaker.json +38 -0
- package/huemagic/locales/fr/hue-syncbox-config.html +19 -0
- package/huemagic/locales/fr/hue-syncbox-config.json +25 -0
- package/huemagic/locales/fr/hue-syncbox.html +86 -0
- package/huemagic/locales/fr/hue-syncbox.json +30 -0
- package/huemagic/locales/fr/hue-temperature.html +69 -0
- package/huemagic/locales/fr/hue-temperature.json +33 -0
- package/huemagic/locales/it/hue-automation.html +59 -0
- package/huemagic/locales/it/hue-automation.json +33 -0
- package/huemagic/locales/it/hue-bridge-config.html +31 -0
- package/huemagic/locales/it/hue-bridge-config.json +40 -0
- package/huemagic/locales/it/hue-bridge.html +96 -0
- package/huemagic/locales/it/hue-bridge.json +26 -0
- package/huemagic/locales/it/hue-brightness.html +70 -0
- package/huemagic/locales/it/hue-brightness.json +37 -0
- package/huemagic/locales/it/hue-buttons.html +59 -0
- package/huemagic/locales/it/hue-buttons.json +42 -0
- package/huemagic/locales/it/hue-contact.html +67 -0
- package/huemagic/locales/it/hue-contact.json +35 -0
- package/huemagic/locales/it/hue-group.html +87 -0
- package/huemagic/locales/it/hue-group.json +46 -0
- package/huemagic/locales/it/hue-light.html +97 -0
- package/huemagic/locales/it/hue-light.json +44 -0
- package/huemagic/locales/it/hue-magic.html +68 -0
- package/huemagic/locales/it/hue-magic.json +26 -0
- package/huemagic/locales/it/hue-motion.html +64 -0
- package/huemagic/locales/it/hue-motion.json +36 -0
- package/huemagic/locales/it/hue-rules.html +69 -0
- package/huemagic/locales/it/hue-rules.json +30 -0
- package/huemagic/locales/it/hue-scene.html +43 -0
- package/huemagic/locales/it/hue-scene.json +32 -0
- package/huemagic/locales/it/hue-speaker.html +80 -0
- package/huemagic/locales/it/hue-speaker.json +38 -0
- package/huemagic/locales/it/hue-syncbox-config.html +19 -0
- package/huemagic/locales/it/hue-syncbox-config.json +25 -0
- package/huemagic/locales/it/hue-syncbox.html +86 -0
- package/huemagic/locales/it/hue-syncbox.json +30 -0
- package/huemagic/locales/it/hue-temperature.html +69 -0
- package/huemagic/locales/it/hue-temperature.json +33 -0
- package/huemagic/locales/nl/hue-automation.html +59 -0
- package/huemagic/locales/nl/hue-automation.json +33 -0
- package/huemagic/locales/nl/hue-bridge-config.html +31 -0
- package/huemagic/locales/nl/hue-bridge-config.json +40 -0
- package/huemagic/locales/nl/hue-bridge.html +96 -0
- package/huemagic/locales/nl/hue-bridge.json +26 -0
- package/huemagic/locales/nl/hue-brightness.html +70 -0
- package/huemagic/locales/nl/hue-brightness.json +37 -0
- package/huemagic/locales/nl/hue-buttons.html +59 -0
- package/huemagic/locales/nl/hue-buttons.json +42 -0
- package/huemagic/locales/nl/hue-contact.html +67 -0
- package/huemagic/locales/nl/hue-contact.json +35 -0
- package/huemagic/locales/nl/hue-group.html +87 -0
- package/huemagic/locales/nl/hue-group.json +46 -0
- package/huemagic/locales/nl/hue-light.html +97 -0
- package/huemagic/locales/nl/hue-light.json +44 -0
- package/huemagic/locales/nl/hue-magic.html +68 -0
- package/huemagic/locales/nl/hue-magic.json +26 -0
- package/huemagic/locales/nl/hue-motion.html +64 -0
- package/huemagic/locales/nl/hue-motion.json +36 -0
- package/huemagic/locales/nl/hue-rules.html +69 -0
- package/huemagic/locales/nl/hue-rules.json +30 -0
- package/huemagic/locales/nl/hue-scene.html +43 -0
- package/huemagic/locales/nl/hue-scene.json +32 -0
- package/huemagic/locales/nl/hue-speaker.html +80 -0
- package/huemagic/locales/nl/hue-speaker.json +38 -0
- package/huemagic/locales/nl/hue-syncbox-config.html +19 -0
- package/huemagic/locales/nl/hue-syncbox-config.json +25 -0
- package/huemagic/locales/nl/hue-syncbox.html +86 -0
- package/huemagic/locales/nl/hue-syncbox.json +30 -0
- package/huemagic/locales/nl/hue-temperature.html +69 -0
- package/huemagic/locales/nl/hue-temperature.json +33 -0
- package/huemagic/locales/pl/hue-automation.html +59 -0
- package/huemagic/locales/pl/hue-automation.json +33 -0
- package/huemagic/locales/pl/hue-bridge-config.html +31 -0
- package/huemagic/locales/pl/hue-bridge-config.json +40 -0
- package/huemagic/locales/pl/hue-bridge.html +96 -0
- package/huemagic/locales/pl/hue-bridge.json +26 -0
- package/huemagic/locales/pl/hue-brightness.html +70 -0
- package/huemagic/locales/pl/hue-brightness.json +37 -0
- package/huemagic/locales/pl/hue-buttons.html +59 -0
- package/huemagic/locales/pl/hue-buttons.json +42 -0
- package/huemagic/locales/pl/hue-contact.html +67 -0
- package/huemagic/locales/pl/hue-contact.json +35 -0
- package/huemagic/locales/pl/hue-group.html +87 -0
- package/huemagic/locales/pl/hue-group.json +46 -0
- package/huemagic/locales/pl/hue-light.html +97 -0
- package/huemagic/locales/pl/hue-light.json +44 -0
- package/huemagic/locales/pl/hue-magic.html +68 -0
- package/huemagic/locales/pl/hue-magic.json +26 -0
- package/huemagic/locales/pl/hue-motion.html +64 -0
- package/huemagic/locales/pl/hue-motion.json +36 -0
- package/huemagic/locales/pl/hue-rules.html +69 -0
- package/huemagic/locales/pl/hue-rules.json +30 -0
- package/huemagic/locales/pl/hue-scene.html +43 -0
- package/huemagic/locales/pl/hue-scene.json +32 -0
- package/huemagic/locales/pl/hue-speaker.html +80 -0
- package/huemagic/locales/pl/hue-speaker.json +38 -0
- package/huemagic/locales/pl/hue-syncbox-config.html +19 -0
- package/huemagic/locales/pl/hue-syncbox-config.json +25 -0
- package/huemagic/locales/pl/hue-syncbox.html +86 -0
- package/huemagic/locales/pl/hue-syncbox.json +30 -0
- package/huemagic/locales/pl/hue-temperature.html +69 -0
- package/huemagic/locales/pl/hue-temperature.json +33 -0
- package/huemagic/locales/pt/hue-automation.html +59 -0
- package/huemagic/locales/pt/hue-automation.json +33 -0
- package/huemagic/locales/pt/hue-bridge-config.html +31 -0
- package/huemagic/locales/pt/hue-bridge-config.json +40 -0
- package/huemagic/locales/pt/hue-bridge.html +96 -0
- package/huemagic/locales/pt/hue-bridge.json +26 -0
- package/huemagic/locales/pt/hue-brightness.html +70 -0
- package/huemagic/locales/pt/hue-brightness.json +37 -0
- package/huemagic/locales/pt/hue-buttons.html +59 -0
- package/huemagic/locales/pt/hue-buttons.json +42 -0
- package/huemagic/locales/pt/hue-contact.html +67 -0
- package/huemagic/locales/pt/hue-contact.json +35 -0
- package/huemagic/locales/pt/hue-group.html +87 -0
- package/huemagic/locales/pt/hue-group.json +46 -0
- package/huemagic/locales/pt/hue-light.html +97 -0
- package/huemagic/locales/pt/hue-light.json +44 -0
- package/huemagic/locales/pt/hue-magic.html +68 -0
- package/huemagic/locales/pt/hue-magic.json +26 -0
- package/huemagic/locales/pt/hue-motion.html +64 -0
- package/huemagic/locales/pt/hue-motion.json +36 -0
- package/huemagic/locales/pt/hue-rules.html +69 -0
- package/huemagic/locales/pt/hue-rules.json +30 -0
- package/huemagic/locales/pt/hue-scene.html +43 -0
- package/huemagic/locales/pt/hue-scene.json +32 -0
- package/huemagic/locales/pt/hue-speaker.html +80 -0
- package/huemagic/locales/pt/hue-speaker.json +38 -0
- package/huemagic/locales/pt/hue-syncbox-config.html +19 -0
- package/huemagic/locales/pt/hue-syncbox-config.json +25 -0
- package/huemagic/locales/pt/hue-syncbox.html +86 -0
- package/huemagic/locales/pt/hue-syncbox.json +30 -0
- package/huemagic/locales/pt/hue-temperature.html +69 -0
- package/huemagic/locales/pt/hue-temperature.json +33 -0
- package/huemagic/locales/tr/hue-automation.html +59 -0
- package/huemagic/locales/tr/hue-automation.json +33 -0
- package/huemagic/locales/tr/hue-bridge-config.html +31 -0
- package/huemagic/locales/tr/hue-bridge-config.json +40 -0
- package/huemagic/locales/tr/hue-bridge.html +96 -0
- package/huemagic/locales/tr/hue-bridge.json +26 -0
- package/huemagic/locales/tr/hue-brightness.html +70 -0
- package/huemagic/locales/tr/hue-brightness.json +37 -0
- package/huemagic/locales/tr/hue-buttons.html +59 -0
- package/huemagic/locales/tr/hue-buttons.json +42 -0
- package/huemagic/locales/tr/hue-contact.html +67 -0
- package/huemagic/locales/tr/hue-contact.json +35 -0
- package/huemagic/locales/tr/hue-group.html +87 -0
- package/huemagic/locales/tr/hue-group.json +46 -0
- package/huemagic/locales/tr/hue-light.html +97 -0
- package/huemagic/locales/tr/hue-light.json +44 -0
- package/huemagic/locales/tr/hue-magic.html +68 -0
- package/huemagic/locales/tr/hue-magic.json +26 -0
- package/huemagic/locales/tr/hue-motion.html +64 -0
- package/huemagic/locales/tr/hue-motion.json +36 -0
- package/huemagic/locales/tr/hue-rules.html +69 -0
- package/huemagic/locales/tr/hue-rules.json +30 -0
- package/huemagic/locales/tr/hue-scene.html +43 -0
- package/huemagic/locales/tr/hue-scene.json +32 -0
- package/huemagic/locales/tr/hue-speaker.html +80 -0
- package/huemagic/locales/tr/hue-speaker.json +38 -0
- package/huemagic/locales/tr/hue-syncbox-config.html +19 -0
- package/huemagic/locales/tr/hue-syncbox-config.json +25 -0
- package/huemagic/locales/tr/hue-syncbox.html +86 -0
- package/huemagic/locales/tr/hue-syncbox.json +30 -0
- package/huemagic/locales/tr/hue-temperature.html +69 -0
- package/huemagic/locales/tr/hue-temperature.json +33 -0
- package/huemagic/utils/api.js +158 -54
- package/huemagic/utils/color.js +20 -2
- package/huemagic/utils/merge.js +3 -2
- package/huemagic/utils/messages.js +506 -120
- package/huemagic/utils/sse.js +51 -0
- package/huemagic/utils/syncbox.js +84 -0
- package/package.json +19 -11
- package/.github/FUNDING.yml +0 -2
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -30
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
- package/.github/workflows/npm.yml +0 -18
- package/huemagic/locales/en-US/hue-bridge-config.json +0 -29
- package/huemagic/locales/en-US/hue-buttons.json +0 -34
- package/huemagic/locales/en-US/hue-light.json +0 -38
- /package/huemagic/locales/{en-US → en}/hue-bridge-config.html +0 -0
- /package/huemagic/locales/{en-US → en}/hue-magic.json +0 -0
package/huemagic/hue-group.js
CHANGED
|
@@ -47,7 +47,7 @@ module.exports = function(RED)
|
|
|
47
47
|
|
|
48
48
|
//
|
|
49
49
|
// SUBSCRIBE TO UPDATES FROM THE BRIDGE
|
|
50
|
-
bridge.subscribe("group", config.groupid, function(info)
|
|
50
|
+
this.unsubscribe = bridge.subscribe("group", config.groupid, function(info)
|
|
51
51
|
{
|
|
52
52
|
let currentState = bridge.get("group", info.id, { colornames: config.colornamer ? true : false });
|
|
53
53
|
|
|
@@ -63,18 +63,22 @@ module.exports = function(RED)
|
|
|
63
63
|
scope.applyCommands({}, null, null);
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
if(currentState.payload.on
|
|
66
|
+
if(currentState.payload.on !== true)
|
|
67
67
|
{
|
|
68
|
-
scope.status({fill: "
|
|
68
|
+
scope.status({fill: "grey", shape: "dot", text: "hue-group.node.all-off"});
|
|
69
|
+
}
|
|
70
|
+
else if(currentState.payload.brightness !== false)
|
|
71
|
+
{
|
|
72
|
+
scope.status({fill: "yellow", shape: "dot", text: RED._("hue-group.node.turned-on") + RED._("hue-group.node.brightness", { percent: Math.round(currentState.payload.brightness) })});
|
|
69
73
|
}
|
|
70
74
|
else
|
|
71
75
|
{
|
|
72
|
-
scope.status({fill: "
|
|
76
|
+
scope.status({fill: "yellow", shape: "dot", text: "hue-group.node.turned-on"});
|
|
73
77
|
}
|
|
74
78
|
}
|
|
75
79
|
|
|
76
80
|
// SEND MESSAGE
|
|
77
|
-
if(!config.skipevents && (config.initevents || info.suppressMessage == false))
|
|
81
|
+
if(!config.skipevents && (config.initevents || info.suppressMessage == false) && (!config.onlycommands || scope.lastCommand !== null))
|
|
78
82
|
{
|
|
79
83
|
// SET LAST COMMAND
|
|
80
84
|
if(scope.lastCommand !== null)
|
|
@@ -96,7 +100,7 @@ module.exports = function(RED)
|
|
|
96
100
|
this.on('input', function(msg, send, done) { scope.applyCommands(msg, send, done); });
|
|
97
101
|
|
|
98
102
|
//
|
|
99
|
-
// APPLY COMMANDS (
|
|
103
|
+
// APPLY COMMANDS (CLIP/v2, only the colorloop effect still needs the legacy API)
|
|
100
104
|
this.applyCommands = async function(msg, send = null, done = null)
|
|
101
105
|
{
|
|
102
106
|
// SET SEND
|
|
@@ -108,19 +112,19 @@ module.exports = function(RED)
|
|
|
108
112
|
// CREATE PATCH
|
|
109
113
|
let patchObject = {};
|
|
110
114
|
|
|
111
|
-
// DEFINE
|
|
115
|
+
// DEFINE GROUP ID
|
|
112
116
|
const tempGroupID = (!config.groupid && typeof msg.topic != 'undefined' && bridge.validResourceID.test(msg.topic) === true) ? msg.topic : config.groupid;
|
|
113
|
-
|
|
114
|
-
if(!currentState)
|
|
117
|
+
if(!tempGroupID)
|
|
115
118
|
{
|
|
116
|
-
scope.error("
|
|
119
|
+
scope.error(RED._("hue-group.node.error-no-id"), msg);
|
|
117
120
|
return false;
|
|
118
121
|
}
|
|
119
122
|
|
|
120
|
-
//
|
|
121
|
-
|
|
123
|
+
// GET CURRENT STATE
|
|
124
|
+
let currentState = bridge.get("group", tempGroupID, { colornames: config.colornamer ? true : false });
|
|
125
|
+
if(!currentState)
|
|
122
126
|
{
|
|
123
|
-
scope.error(RED._("hue-group.node.error-
|
|
127
|
+
scope.error(RED._("hue-group.node.error-not-available"), msg);
|
|
124
128
|
return false;
|
|
125
129
|
}
|
|
126
130
|
|
|
@@ -150,9 +154,15 @@ module.exports = function(RED)
|
|
|
150
154
|
return true;
|
|
151
155
|
}
|
|
152
156
|
|
|
153
|
-
// COLORLOOP EFFECT
|
|
157
|
+
// COLORLOOP EFFECT (CLIP/v2 HAS NO EQUIVALENT, SO THIS STAYS ON THE LEGACY API)
|
|
154
158
|
if(typeof msg.payload != 'undefined' && typeof msg.payload.colorloop != 'undefined' && msg.payload.colorloop > 0)
|
|
155
159
|
{
|
|
160
|
+
if(!currentState.info.idV1)
|
|
161
|
+
{
|
|
162
|
+
scope.error(RED._("hue-group.node.error-no-colorloop"), msg);
|
|
163
|
+
return false;
|
|
164
|
+
}
|
|
165
|
+
|
|
156
166
|
patchObject = {
|
|
157
167
|
"on": true,
|
|
158
168
|
"effect": "colorloop",
|
|
@@ -161,11 +171,11 @@ module.exports = function(RED)
|
|
|
161
171
|
|
|
162
172
|
// PATCH!
|
|
163
173
|
async.retry({
|
|
164
|
-
times:
|
|
174
|
+
times: 5,
|
|
165
175
|
errorFilter: function(err) {
|
|
166
|
-
return (err.status == 503);
|
|
176
|
+
return (err.status == 503 || err.status == 429);
|
|
167
177
|
},
|
|
168
|
-
interval: function(retryCount) { return retryCount
|
|
178
|
+
interval: function(retryCount) { return 750*retryCount; }
|
|
169
179
|
},
|
|
170
180
|
function(callback, results)
|
|
171
181
|
{
|
|
@@ -202,31 +212,14 @@ module.exports = function(RED)
|
|
|
202
212
|
// ALERT EFFECT
|
|
203
213
|
if(typeof msg.payload != 'undefined' && typeof msg.payload.alert != 'undefined' && msg.payload.alert > 0)
|
|
204
214
|
{
|
|
205
|
-
//
|
|
206
|
-
|
|
215
|
+
// THE BRIDGE BLINKS AND RESTORES THE PREVIOUS STATE ON ITS OWN
|
|
216
|
+
let duration = Math.round(parseFloat(msg.payload.alert)) * 1000;
|
|
217
|
+
duration = (duration > 65534000) ? 65534000 : duration;
|
|
207
218
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
{
|
|
211
|
-
patchObject["on"] = true;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
// SET BRIGHTNESS
|
|
215
|
-
if(!msg.payload.brightness && currentState.payload.brightness != 100)
|
|
216
|
-
{
|
|
217
|
-
patchObject["bri"] = 254;
|
|
218
|
-
}
|
|
219
|
-
else if(msg.payload.brightness)
|
|
220
|
-
{
|
|
221
|
-
patchObject["bri"] = Math.round((254/100)*msg.payload.brightness);
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
// SET TRANSITION
|
|
225
|
-
patchObject["transitiontime"] = 0;
|
|
226
|
-
|
|
227
|
-
// CAN CHANGE COLOR?
|
|
228
|
-
let XYAlertColor = {};
|
|
219
|
+
let signaling = { signal: "on_off", duration: duration };
|
|
220
|
+
let XYAlertColor = false;
|
|
229
221
|
|
|
222
|
+
// BLINK IN A SPECIFIC COLOR?
|
|
230
223
|
if(typeof msg.payload.rgb != 'undefined')
|
|
231
224
|
{
|
|
232
225
|
XYAlertColor = colorUtils.rgbToXy(msg.payload.rgb[0], msg.payload.rgb[1], msg.payload.rgb[2] );
|
|
@@ -238,79 +231,38 @@ module.exports = function(RED)
|
|
|
238
231
|
}
|
|
239
232
|
else if(typeof msg.payload.color != 'undefined')
|
|
240
233
|
{
|
|
241
|
-
|
|
234
|
+
const colorHex = new RegExp("random|any|whatever").test(msg.payload.color) ? colorUtils.randomHexColor() : colorUtils.colornames(msg.payload.color);
|
|
235
|
+
if(colorHex)
|
|
242
236
|
{
|
|
243
|
-
|
|
244
|
-
let rgbFromHex = colorUtils.hexRgb(rgbFromHex);
|
|
237
|
+
let rgbFromHex = colorUtils.hexRgb(colorHex);
|
|
245
238
|
XYAlertColor = colorUtils.rgbToXy(rgbFromHex[0], rgbFromHex[1], rgbFromHex[2] );
|
|
246
239
|
}
|
|
247
|
-
else
|
|
248
|
-
{
|
|
249
|
-
var colorHex = colorUtils.colornames(msg.payload.color);
|
|
250
|
-
if(colorHex)
|
|
251
|
-
{
|
|
252
|
-
let rgbFromHex = colorUtils.hexRgb(colorHex);
|
|
253
|
-
XYAlertColor = colorUtils.rgbToXy(rgbFromHex[0], rgbFromHex[1], rgbFromHex[2] );
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
240
|
}
|
|
257
|
-
|
|
241
|
+
|
|
242
|
+
if(XYAlertColor)
|
|
258
243
|
{
|
|
259
|
-
|
|
244
|
+
signaling = { signal: "on_off_color", duration: duration, colors: [{ xy: XYAlertColor }] };
|
|
260
245
|
}
|
|
261
246
|
|
|
262
|
-
patchObject["xy"] = [XYAlertColor.x, XYAlertColor.y];
|
|
263
|
-
|
|
264
|
-
// SET ALERT EFFECT
|
|
265
|
-
patchObject["alert"] = "lselect";
|
|
266
|
-
|
|
267
247
|
// PATCH!
|
|
268
248
|
async.retry({
|
|
269
|
-
times:
|
|
249
|
+
times: 5,
|
|
270
250
|
errorFilter: function(err) {
|
|
271
|
-
return (err.status == 503);
|
|
251
|
+
return (err.status == 503 || err.status == 429);
|
|
272
252
|
},
|
|
273
|
-
interval: function(retryCount) { return retryCount
|
|
253
|
+
interval: function(retryCount) { return 750*retryCount; }
|
|
274
254
|
},
|
|
275
255
|
function(callback, results)
|
|
276
256
|
{
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
.then(function(status)
|
|
257
|
+
bridge.patch("grouped_light", tempGroupID, { signaling: signaling })
|
|
258
|
+
.catch(function(errors)
|
|
280
259
|
{
|
|
281
|
-
|
|
282
|
-
{
|
|
283
|
-
|
|
284
|
-
var tempPreviousStatePatch = {};
|
|
285
|
-
|
|
286
|
-
tempPreviousStatePatch.dimming = { brightness: tempPreviousState.payload.brightness };
|
|
287
|
-
if(tempPreviousState.payload.xyColor)
|
|
288
|
-
{
|
|
289
|
-
tempPreviousStatePatch.xy = [tempPreviousState.payload.xyColor.x, tempPreviousState.payload.xyColor.y];
|
|
290
|
-
}
|
|
291
|
-
else if(tempPreviousState.payload.colorTemp)
|
|
292
|
-
{
|
|
293
|
-
tempPreviousStatePatch.ct = tempPreviousState.payload.colorTemp;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
bridge.patch("group", currentState.info.idV1 + "/action", tempPreviousStatePatch, 1)
|
|
297
|
-
.then(function(status)
|
|
298
|
-
{
|
|
299
|
-
return bridge.patch("group", currentState.info.idV1 + "/action", { on: false }, 1);
|
|
300
|
-
})
|
|
301
|
-
.then(function(status) {
|
|
302
|
-
if(tempPreviousState.payload.on === true)
|
|
303
|
-
{
|
|
304
|
-
bridge.patch("group", currentState.info.idV1, { on: true }, 1);
|
|
305
|
-
}
|
|
306
|
-
});
|
|
307
|
-
}, parseInt(msg.payload.alert) * 1000);
|
|
308
|
-
|
|
309
|
-
callback(null, true);
|
|
260
|
+
// OLDER BRIDGES ONLY KNOW THE (15 SECONDS LONG) BREATHE EFFECT
|
|
261
|
+
if(errors.status !== 400) { throw errors; }
|
|
262
|
+
return bridge.patch("grouped_light", tempGroupID, { alert: { action: "breathe" } });
|
|
310
263
|
})
|
|
311
|
-
.
|
|
312
|
-
|
|
313
|
-
});
|
|
264
|
+
.then(function() { callback(null, true); })
|
|
265
|
+
.catch(function(errors) { callback(errors, null); });
|
|
314
266
|
},
|
|
315
267
|
function(errors, success)
|
|
316
268
|
{
|
|
@@ -335,52 +287,48 @@ module.exports = function(RED)
|
|
|
335
287
|
else if(typeof msg.animation != 'undefined' && msg.animation.status == false && msg.animation.restore == true)
|
|
336
288
|
{
|
|
337
289
|
const tempPreviousState = scope.context().get('groupPreviousState');
|
|
338
|
-
|
|
290
|
+
if(!tempPreviousState)
|
|
291
|
+
{
|
|
292
|
+
if(done) { done(); }
|
|
293
|
+
return false;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// RESTORE IN ONE SINGLE PATCH ON THE GROUP, OTHERWISE THE LIGHTS FLICKER
|
|
297
|
+
var tempPreviousStatePatch = { on: { on: tempPreviousState.payload.on } };
|
|
298
|
+
|
|
299
|
+
if(typeof tempPreviousState.payload.brightness != 'undefined' && tempPreviousState.payload.brightness !== false)
|
|
300
|
+
{
|
|
301
|
+
tempPreviousStatePatch.dimming = { brightness: tempPreviousState.payload.brightness };
|
|
302
|
+
}
|
|
339
303
|
|
|
340
|
-
tempPreviousStatePatch.dimming = { brightness: tempPreviousState.payload.brightness };
|
|
341
304
|
if(tempPreviousState.payload.xyColor)
|
|
342
305
|
{
|
|
343
|
-
tempPreviousStatePatch.
|
|
306
|
+
tempPreviousStatePatch.color = { xy: tempPreviousState.payload.xyColor };
|
|
344
307
|
}
|
|
345
308
|
else if(tempPreviousState.payload.colorTemp)
|
|
346
309
|
{
|
|
347
|
-
tempPreviousStatePatch.
|
|
310
|
+
tempPreviousStatePatch.color_temperature = { mirek: tempPreviousState.payload.colorTemp };
|
|
348
311
|
}
|
|
349
312
|
|
|
350
313
|
// PATCH!
|
|
351
314
|
async.retry({
|
|
352
|
-
times:
|
|
315
|
+
times: 5,
|
|
353
316
|
errorFilter: function(err) {
|
|
354
|
-
return (err.status == 503);
|
|
317
|
+
return (err.status == 503 || err.status == 429);
|
|
355
318
|
},
|
|
356
|
-
interval: function(retryCount) { return retryCount
|
|
319
|
+
interval: function(retryCount) { return 750*retryCount; }
|
|
357
320
|
},
|
|
358
321
|
function(callback, results)
|
|
359
322
|
{
|
|
360
|
-
bridge.patch("
|
|
361
|
-
then(function(
|
|
362
|
-
{
|
|
363
|
-
if(tempPreviousState.payload.on === false)
|
|
364
|
-
{
|
|
365
|
-
bridge.patch("light", currentState.info.lightIds[l], { on: { on: false } })
|
|
366
|
-
.then(function() { callback(null, true); });
|
|
367
|
-
}
|
|
368
|
-
else
|
|
369
|
-
{
|
|
370
|
-
bridge.patch("light", currentState.info.lightIds[l], { on: { on: false } })
|
|
371
|
-
.then(function(status) {
|
|
372
|
-
callback(null, true);
|
|
373
|
-
return bridge.patch("light", currentState.info.lightIds[l], { on: { on: true } });
|
|
374
|
-
});
|
|
375
|
-
}
|
|
376
|
-
})
|
|
323
|
+
bridge.patch("grouped_light", tempGroupID, tempPreviousStatePatch)
|
|
324
|
+
.then(function() { callback(null, true); })
|
|
377
325
|
.catch(function(errors) { callback(errors, null); });
|
|
378
326
|
},
|
|
379
327
|
function(errors, success)
|
|
380
328
|
{
|
|
381
329
|
if(errors)
|
|
382
330
|
{
|
|
383
|
-
scope.error(errors);
|
|
331
|
+
scope.error(errors, msg);
|
|
384
332
|
}
|
|
385
333
|
else if(done)
|
|
386
334
|
{
|
|
@@ -391,28 +339,22 @@ module.exports = function(RED)
|
|
|
391
339
|
// EXTENDED COMMANDS
|
|
392
340
|
else
|
|
393
341
|
{
|
|
394
|
-
// SET LIGHT STATE SIMPLE MODE
|
|
342
|
+
// SET LIGHT STATE SIMPLE MODE (ALWAYS SENT, THE CACHED STATE MAY BE OUTDATED)
|
|
395
343
|
if(msg.payload === true||msg.payload === false)
|
|
396
344
|
{
|
|
397
|
-
|
|
398
|
-
{
|
|
399
|
-
patchObject["on"] = msg.payload;
|
|
400
|
-
}
|
|
345
|
+
patchObject["on"] = { on: msg.payload };
|
|
401
346
|
}
|
|
402
347
|
|
|
403
348
|
// SET LIGHT STATE
|
|
404
349
|
if(typeof msg.payload != 'undefined' && typeof msg.payload.on != 'undefined' && (msg.payload.on === true || msg.payload.on === false))
|
|
405
350
|
{
|
|
406
|
-
|
|
407
|
-
{
|
|
408
|
-
patchObject["on"] = msg.payload.on;
|
|
409
|
-
}
|
|
351
|
+
patchObject["on"] = { on: msg.payload.on };
|
|
410
352
|
}
|
|
411
353
|
|
|
412
354
|
// TOGGLE ON / OFF
|
|
413
355
|
if(typeof msg.payload != 'undefined' && typeof msg.payload.toggle != 'undefined')
|
|
414
356
|
{
|
|
415
|
-
patchObject["on"] = !currentState.payload.on;
|
|
357
|
+
patchObject["on"] = { on: !currentState.payload.on };
|
|
416
358
|
}
|
|
417
359
|
|
|
418
360
|
// SET BRIGHTNESS
|
|
@@ -427,22 +369,22 @@ module.exports = function(RED)
|
|
|
427
369
|
autoBrightness = (autoBrightness < 20) ? 20 : autoBrightness;
|
|
428
370
|
|
|
429
371
|
// SET CALCULATED BRIGHTNESS
|
|
430
|
-
patchObject["
|
|
372
|
+
patchObject["dimming"] = { brightness: autoBrightness };
|
|
431
373
|
}
|
|
432
374
|
else
|
|
433
375
|
{
|
|
434
376
|
if(msg.payload.brightness > 100 || msg.payload.brightness < 0)
|
|
435
377
|
{
|
|
436
|
-
scope.error("
|
|
378
|
+
scope.error(RED._("hue-group.node.error-invalid-brightness"), msg);
|
|
437
379
|
return false;
|
|
438
380
|
}
|
|
439
381
|
else if(msg.payload.brightness == 0)
|
|
440
382
|
{
|
|
441
|
-
patchObject["on"] = false;
|
|
383
|
+
patchObject["on"] = { on: false };
|
|
442
384
|
}
|
|
443
385
|
else
|
|
444
386
|
{
|
|
445
|
-
patchObject["
|
|
387
|
+
patchObject["dimming"] = { brightness: msg.payload.brightness };
|
|
446
388
|
}
|
|
447
389
|
}
|
|
448
390
|
}
|
|
@@ -450,63 +392,72 @@ module.exports = function(RED)
|
|
|
450
392
|
{
|
|
451
393
|
if(msg.payload.brightnessLevel > 254 || msg.payload.brightnessLevel < 0)
|
|
452
394
|
{
|
|
453
|
-
scope.error("
|
|
395
|
+
scope.error(RED._("hue-group.node.error-invalid-brightness-level"), msg);
|
|
454
396
|
return false;
|
|
455
397
|
}
|
|
456
|
-
else if(msg.payload.
|
|
398
|
+
else if(msg.payload.brightnessLevel == 0)
|
|
457
399
|
{
|
|
458
|
-
patchObject["on"] = false;
|
|
400
|
+
patchObject["on"] = { on: false };
|
|
459
401
|
}
|
|
460
402
|
else
|
|
461
403
|
{
|
|
462
|
-
patchObject["
|
|
404
|
+
patchObject["dimming"] = { brightness: Math.round((100/254)*msg.payload.brightnessLevel) };
|
|
463
405
|
}
|
|
464
406
|
}
|
|
465
|
-
|
|
466
|
-
// SET HUMAN READABLE COLOR OR RANDOM
|
|
467
|
-
if(typeof msg.payload != 'undefined' && typeof msg.payload.color != 'undefined')
|
|
407
|
+
else if(typeof msg.payload != 'undefined' && typeof msg.payload.incrementBrightness != 'undefined')
|
|
468
408
|
{
|
|
469
|
-
let
|
|
409
|
+
let incrementBy = (isNaN(msg.payload.incrementBrightness)) ? 10 : parseFloat(msg.payload.incrementBrightness);
|
|
470
410
|
|
|
471
|
-
if(
|
|
411
|
+
if ((incrementBy > 100) || (incrementBy < -100))
|
|
472
412
|
{
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
XYAlertColor = colorUtils.rgbToXy(rgbFromHex[0], rgbFromHex[1], rgbFromHex[2] );
|
|
413
|
+
scope.error(RED._("hue-group.node.error-invalid-increment"), msg);
|
|
414
|
+
return false;
|
|
476
415
|
}
|
|
477
|
-
|
|
416
|
+
|
|
417
|
+
patchObject["dimming_delta"] = { action: (incrementBy < 0) ? "down" : "up", brightness_delta: Math.abs(incrementBy) };
|
|
418
|
+
}
|
|
419
|
+
else if(typeof msg.payload != 'undefined' && typeof msg.payload.decrementBrightness != 'undefined')
|
|
420
|
+
{
|
|
421
|
+
let decrementBy = (isNaN(msg.payload.decrementBrightness)) ? 10 : parseFloat(msg.payload.decrementBrightness);
|
|
422
|
+
|
|
423
|
+
if ((decrementBy > 100) || (decrementBy < -100))
|
|
478
424
|
{
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
{
|
|
482
|
-
let rgbFromHex = colorUtils.hexRgb(colorHex);
|
|
483
|
-
XYAlertColor = colorUtils.rgbToXy(rgbFromHex[0], rgbFromHex[1], rgbFromHex[2] );
|
|
484
|
-
}
|
|
425
|
+
scope.error(RED._("hue-group.node.error-invalid-decrement"), msg);
|
|
426
|
+
return false;
|
|
485
427
|
}
|
|
486
428
|
|
|
487
|
-
patchObject["
|
|
429
|
+
patchObject["dimming_delta"] = { action: (decrementBy < 0) ? "up" : "down", brightness_delta: Math.abs(decrementBy) };
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
// SET HUMAN READABLE COLOR OR RANDOM
|
|
433
|
+
if(typeof msg.payload != 'undefined' && typeof msg.payload.color != 'undefined')
|
|
434
|
+
{
|
|
435
|
+
const colorHex = new RegExp("random|any|whatever").test(msg.payload.color) ? colorUtils.randomHexColor() : colorUtils.colornames(msg.payload.color);
|
|
436
|
+
|
|
437
|
+
if(colorHex)
|
|
438
|
+
{
|
|
439
|
+
let rgbFromHex = colorUtils.hexRgb(colorHex);
|
|
440
|
+
patchObject["color"] = { xy: colorUtils.rgbToXy(rgbFromHex[0], rgbFromHex[1], rgbFromHex[2]) };
|
|
441
|
+
}
|
|
488
442
|
}
|
|
489
443
|
|
|
490
444
|
// SET HEX COLOR
|
|
491
445
|
if(typeof msg.payload != 'undefined' && typeof msg.payload.hex != 'undefined')
|
|
492
446
|
{
|
|
493
447
|
let rgbFromHex = colorUtils.hexRgb((msg.payload.hex).toString());
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
patchObject["xy"] = [xyColor.x, xyColor.y];
|
|
448
|
+
patchObject["color"] = { xy: colorUtils.rgbToXy(rgbFromHex[0], rgbFromHex[1], rgbFromHex[2]) };
|
|
497
449
|
}
|
|
498
450
|
|
|
499
451
|
// SET RGB COLOR
|
|
500
452
|
if(typeof msg.payload != 'undefined' && typeof msg.payload.rgb != 'undefined' && msg.payload.rgb.length === 3)
|
|
501
453
|
{
|
|
502
|
-
|
|
503
|
-
patchObject["xy"] = [xyColor.x, xyColor.y];
|
|
454
|
+
patchObject["color"] = { xy: colorUtils.rgbToXy(msg.payload.rgb[0], msg.payload.rgb[1], msg.payload.rgb[2]) };
|
|
504
455
|
}
|
|
505
456
|
|
|
506
457
|
// SET XY COLOR
|
|
507
458
|
if(typeof msg.payload != 'undefined' && typeof msg.payload.xyColor != 'undefined')
|
|
508
459
|
{
|
|
509
|
-
patchObject["
|
|
460
|
+
patchObject["color"] = { xy: { x: msg.payload.xyColor.x, y: msg.payload.xyColor.y } };
|
|
510
461
|
}
|
|
511
462
|
|
|
512
463
|
// SET COLOR TEMPERATURE
|
|
@@ -518,34 +469,34 @@ module.exports = function(RED)
|
|
|
518
469
|
let colorTemp = parseInt(msg.payload.colorTemp);
|
|
519
470
|
if(colorTemp >= 153 && colorTemp <= 500)
|
|
520
471
|
{
|
|
521
|
-
patchObject["
|
|
472
|
+
patchObject["color_temperature"] = { mirek: colorTemp };
|
|
522
473
|
}
|
|
523
474
|
else
|
|
524
475
|
{
|
|
525
|
-
scope.error("
|
|
476
|
+
scope.error(RED._("hue-group.node.error-invalid-temp"), msg);
|
|
526
477
|
return false;
|
|
527
478
|
}
|
|
528
479
|
}
|
|
529
480
|
else if(msg.payload.colorTemp == "cold")
|
|
530
481
|
{
|
|
531
|
-
patchObject["
|
|
482
|
+
patchObject["color_temperature"] = { mirek: 153 };
|
|
532
483
|
}
|
|
533
484
|
else if(msg.payload.colorTemp == "normal")
|
|
534
485
|
{
|
|
535
|
-
patchObject["
|
|
486
|
+
patchObject["color_temperature"] = { mirek: 240 };
|
|
536
487
|
}
|
|
537
488
|
else if(msg.payload.colorTemp == "warm")
|
|
538
489
|
{
|
|
539
|
-
patchObject["
|
|
490
|
+
patchObject["color_temperature"] = { mirek: 400 };
|
|
540
491
|
}
|
|
541
492
|
else if(msg.payload.colorTemp == "hot")
|
|
542
493
|
{
|
|
543
|
-
patchObject["
|
|
494
|
+
patchObject["color_temperature"] = { mirek: 500 };
|
|
544
495
|
}
|
|
545
496
|
else
|
|
546
497
|
{
|
|
547
498
|
// SET TEMPERATURE
|
|
548
|
-
patchObject["
|
|
499
|
+
patchObject["color_temperature"] = { mirek: colorUtils.colorTemperature() };
|
|
549
500
|
}
|
|
550
501
|
}
|
|
551
502
|
|
|
@@ -556,7 +507,7 @@ module.exports = function(RED)
|
|
|
556
507
|
targetTransitionTime = (targetTransitionTime > 6000000) ? 6000000 : targetTransitionTime;
|
|
557
508
|
targetTransitionTime = (targetTransitionTime < 0) ? 0 : targetTransitionTime;
|
|
558
509
|
|
|
559
|
-
patchObject["
|
|
510
|
+
patchObject["dynamics"] = { duration: targetTransitionTime };
|
|
560
511
|
}
|
|
561
512
|
|
|
562
513
|
// SET DOMINANT COLORS FROM IMAGE
|
|
@@ -567,37 +518,40 @@ module.exports = function(RED)
|
|
|
567
518
|
{
|
|
568
519
|
var colorsHEX = colors.map(color => color.hex());
|
|
569
520
|
let rgbFromHex = colorUtils.hexRgb(colorsHEX[0]);
|
|
570
|
-
let xyColor = colorUtils.rgbToXy(rgbFromHex[0], rgbFromHex[1], rgbFromHex[2]);
|
|
571
521
|
|
|
572
|
-
patchObject["
|
|
522
|
+
patchObject["color"] = { xy: colorUtils.rgbToXy(rgbFromHex[0], rgbFromHex[1], rgbFromHex[2]) };
|
|
573
523
|
}
|
|
574
524
|
}
|
|
575
525
|
|
|
526
|
+
// THE BRIDGE ONLY ACCEPTS ONE OF BOTH
|
|
527
|
+
if(patchObject["color"] && patchObject["color_temperature"]) { delete patchObject["color_temperature"]; }
|
|
528
|
+
|
|
576
529
|
//
|
|
577
530
|
// SHOULD PATCH?
|
|
578
531
|
if(Object.values(patchObject).length > 0)
|
|
579
532
|
{
|
|
580
|
-
// IS FOR LATER?
|
|
533
|
+
// IS FOR LATER? (ONLY IF THE COMMAND ITSELF DOES NOT SWITCH THE GROUP)
|
|
581
534
|
if(currentState.payload.on === false)
|
|
582
535
|
{
|
|
583
|
-
if(
|
|
536
|
+
if(typeof patchObject["on"] == 'undefined')
|
|
584
537
|
{
|
|
585
538
|
scope.futurePatchState = merge.deep(scope.futurePatchState, patchObject);
|
|
539
|
+
if(done) { done(); }
|
|
586
540
|
return false;
|
|
587
541
|
}
|
|
588
542
|
}
|
|
589
543
|
|
|
590
544
|
// PATCH!
|
|
591
545
|
async.retry({
|
|
592
|
-
times:
|
|
546
|
+
times: 5,
|
|
593
547
|
errorFilter: function(err) {
|
|
594
|
-
return (err.status == 503);
|
|
548
|
+
return (err.status == 503 || err.status == 429);
|
|
595
549
|
},
|
|
596
|
-
interval: function(retryCount) { return retryCount
|
|
550
|
+
interval: function(retryCount) { return 750*retryCount; }
|
|
597
551
|
},
|
|
598
552
|
function(callback, results)
|
|
599
553
|
{
|
|
600
|
-
bridge.patch("
|
|
554
|
+
bridge.patch("grouped_light", tempGroupID, patchObject)
|
|
601
555
|
.then(function() { callback(null, true); })
|
|
602
556
|
.catch(function(errors) { callback(errors, null); });
|
|
603
557
|
},
|
|
@@ -630,7 +584,15 @@ module.exports = function(RED)
|
|
|
630
584
|
}
|
|
631
585
|
}
|
|
632
586
|
}
|
|
587
|
+
|
|
588
|
+
//
|
|
589
|
+
// CLOSE NODE / DETACH FROM THE BRIDGE
|
|
590
|
+
this.on('close', function()
|
|
591
|
+
{
|
|
592
|
+
if(scope.unsubscribe) { scope.unsubscribe(); }
|
|
593
|
+
});
|
|
594
|
+
|
|
633
595
|
}
|
|
634
596
|
|
|
635
597
|
RED.nodes.registerType("hue-group", HueGroup);
|
|
636
|
-
}
|
|
598
|
+
}
|
package/huemagic/hue-light.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<input type="text" id="node-input-name" data-i18n="[placeholder]hue-light.config.input-name" style="width: calc(100% - 105px)">
|
|
5
5
|
</div>
|
|
6
6
|
<div class="form-row">
|
|
7
|
-
<label for="node-input-bridge"><i class="fa fa-server"></i>
|
|
7
|
+
<label for="node-input-bridge"><i class="fa fa-server"></i> <span data-i18n="hue-light.config.bridge"></span></label>
|
|
8
8
|
<input type="text" id="node-input-bridge" style="width: calc(100% - 105px)">
|
|
9
9
|
</div>
|
|
10
10
|
<div class="form-row">
|
|
@@ -19,21 +19,27 @@
|
|
|
19
19
|
</div>
|
|
20
20
|
</div>
|
|
21
21
|
<div class="form-row" style="margin-top: 30px">
|
|
22
|
-
<div style="display: inline-flex; width: calc(100% - 105px)">
|
|
23
|
-
<input type="checkbox" id="node-input-colornamer" style="flex:
|
|
24
|
-
<span data-i18n="hue-light.config.colornamer-info" style="
|
|
22
|
+
<div style="display: inline-flex; align-items: center; width: calc(100% - 105px)">
|
|
23
|
+
<input type="checkbox" id="node-input-colornamer" style="flex: 0 0 auto; width: auto; margin: 0;">
|
|
24
|
+
<span data-i18n="hue-light.config.colornamer-info" style="flex: 1; margin-left: 8px;"></span>
|
|
25
25
|
</div>
|
|
26
26
|
</div>
|
|
27
27
|
<div class="form-row">
|
|
28
|
-
<div style="display: inline-flex; width: calc(100% - 105px)">
|
|
29
|
-
<input type="checkbox" id="node-input-skipevents" style="flex:
|
|
30
|
-
<span data-i18n="hue-light.config.skipevents-node" style="
|
|
28
|
+
<div style="display: inline-flex; align-items: center; width: calc(100% - 105px)">
|
|
29
|
+
<input type="checkbox" id="node-input-skipevents" style="flex: 0 0 auto; width: auto; margin: 0;">
|
|
30
|
+
<span data-i18n="hue-light.config.skipevents-node" style="flex: 1; margin-left: 8px;"></span>
|
|
31
31
|
</div>
|
|
32
32
|
</div>
|
|
33
33
|
<div class="form-row">
|
|
34
|
-
<div style="display: inline-flex; width: calc(100% - 105px)">
|
|
35
|
-
<input type="checkbox" id="node-input-initevents" style="flex:
|
|
36
|
-
<span data-i18n="hue-light.config.sendinitevents-node" style="
|
|
34
|
+
<div style="display: inline-flex; align-items: center; width: calc(100% - 105px)">
|
|
35
|
+
<input type="checkbox" id="node-input-initevents" style="flex: 0 0 auto; width: auto; margin: 0;">
|
|
36
|
+
<span data-i18n="hue-light.config.sendinitevents-node" style="flex: 1; margin-left: 8px;"></span>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
<div class="form-row">
|
|
40
|
+
<div style="display: inline-flex; align-items: center; width: calc(100% - 105px)">
|
|
41
|
+
<input type="checkbox" id="node-input-onlycommands" style="flex: 0 0 auto; width: auto; margin: 0;">
|
|
42
|
+
<span data-i18n="hue-light.config.onlycommands-node" style="flex: 1; margin-left: 8px;"></span>
|
|
37
43
|
</div>
|
|
38
44
|
</div>
|
|
39
45
|
</script>
|
|
@@ -48,10 +54,11 @@
|
|
|
48
54
|
lightid: { value:"", required: false },
|
|
49
55
|
colornamer: { value: true },
|
|
50
56
|
skipevents: { value: false },
|
|
51
|
-
initevents: { value: false }
|
|
57
|
+
initevents: { value: false },
|
|
58
|
+
onlycommands: { value: false }
|
|
52
59
|
},
|
|
53
60
|
align: 'left',
|
|
54
|
-
icon: "hue-light.
|
|
61
|
+
icon: "hue-light.svg",
|
|
55
62
|
inputs: 1,
|
|
56
63
|
outputs: 1,
|
|
57
64
|
label: function() {
|