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-motion.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<input type="text" id="node-input-name" data-i18n="[placeholder]hue-motion.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-motion.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,15 +19,21 @@
|
|
|
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-skipevents" style="flex:
|
|
24
|
-
<span data-i18n="hue-motion.config.skipevents-node" style="
|
|
22
|
+
<div style="display: inline-flex; align-items: center; width: calc(100% - 105px)">
|
|
23
|
+
<input type="checkbox" id="node-input-skipevents" style="flex: 0 0 auto; width: auto; margin: 0;">
|
|
24
|
+
<span data-i18n="hue-motion.config.skipevents-node" 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-initevents" style="flex:
|
|
30
|
-
<span data-i18n="hue-motion.config.sendinitevents-node" style="
|
|
28
|
+
<div style="display: inline-flex; align-items: center; width: calc(100% - 105px)">
|
|
29
|
+
<input type="checkbox" id="node-input-initevents" style="flex: 0 0 auto; width: auto; margin: 0;">
|
|
30
|
+
<span data-i18n="hue-motion.config.sendinitevents-node" style="flex: 1; margin-left: 8px;"></span>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
<div class="form-row">
|
|
34
|
+
<div style="display: inline-flex; align-items: center; width: calc(100% - 105px)">
|
|
35
|
+
<input type="checkbox" id="node-input-onlycommands" style="flex: 0 0 auto; width: auto; margin: 0;">
|
|
36
|
+
<span data-i18n="hue-motion.config.onlycommands-node" style="flex: 1; margin-left: 8px;"></span>
|
|
31
37
|
</div>
|
|
32
38
|
</div>
|
|
33
39
|
</script>
|
|
@@ -41,10 +47,11 @@
|
|
|
41
47
|
bridge: { type: "hue-bridge", required: true },
|
|
42
48
|
sensorid: { value:"", required: false },
|
|
43
49
|
skipevents: { value: false },
|
|
44
|
-
initevents: { value: false }
|
|
50
|
+
initevents: { value: false },
|
|
51
|
+
onlycommands: { value: false }
|
|
45
52
|
},
|
|
46
53
|
align: 'left',
|
|
47
|
-
icon: "hue-motion.
|
|
54
|
+
icon: "hue-motion.svg",
|
|
48
55
|
inputs: 1,
|
|
49
56
|
outputs: 1,
|
|
50
57
|
label: function() {
|
package/huemagic/hue-motion.js
CHANGED
|
@@ -37,7 +37,7 @@ module.exports = function(RED)
|
|
|
37
37
|
|
|
38
38
|
//
|
|
39
39
|
// SUBSCRIBE TO UPDATES FROM THE BRIDGE
|
|
40
|
-
bridge.subscribe("motion", config.sensorid, function(info)
|
|
40
|
+
this.unsubscribe = bridge.subscribe("motion", config.sensorid, function(info)
|
|
41
41
|
{
|
|
42
42
|
let currentState = bridge.get("motion", info.id);
|
|
43
43
|
|
|
@@ -45,7 +45,7 @@ module.exports = function(RED)
|
|
|
45
45
|
if(currentState !== false)
|
|
46
46
|
{
|
|
47
47
|
// SEND MESSAGE
|
|
48
|
-
if(!config.skipevents && (config.initevents || info.suppressMessage == false))
|
|
48
|
+
if(!config.skipevents && (config.initevents || info.suppressMessage == false) && (!config.onlycommands || scope.lastCommand !== null))
|
|
49
49
|
{
|
|
50
50
|
// SET LAST COMMAND
|
|
51
51
|
if(scope.lastCommand !== null)
|
|
@@ -104,14 +104,14 @@ module.exports = function(RED)
|
|
|
104
104
|
const tempSensorID = (!config.sensorid && typeof msg.topic != 'undefined' && bridge.validResourceID.test(msg.topic) === true) ? msg.topic : config.sensorid;
|
|
105
105
|
if(!tempSensorID)
|
|
106
106
|
{
|
|
107
|
-
scope.error("
|
|
107
|
+
scope.error(RED._("hue-motion.node.error-no-id"), msg);
|
|
108
108
|
return false;
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
let currentState = bridge.get("motion", tempSensorID);
|
|
112
112
|
if(!currentState)
|
|
113
113
|
{
|
|
114
|
-
scope.error("
|
|
114
|
+
scope.error(RED._("hue-motion.node.error-not-available"), msg);
|
|
115
115
|
return false;
|
|
116
116
|
}
|
|
117
117
|
|
|
@@ -141,6 +141,27 @@ module.exports = function(RED)
|
|
|
141
141
|
patchObject["enabled"] = (msg.payload == true);
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
+
// TUNE THE SENSITIVITY (CAMERAS AND MOTIONAWARE AREAS)
|
|
145
|
+
if(typeof msg.payload != 'undefined' && typeof msg.payload.sensitivity != 'undefined')
|
|
146
|
+
{
|
|
147
|
+
const maximum = currentState.payload.sensitivityMax;
|
|
148
|
+
|
|
149
|
+
if(typeof maximum == 'undefined')
|
|
150
|
+
{
|
|
151
|
+
scope.error(RED._("hue-motion.node.error-no-sensitivity"), msg);
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
const sensitivity = parseInt(msg.payload.sensitivity);
|
|
156
|
+
if(isNaN(sensitivity) || sensitivity < 0 || sensitivity > maximum)
|
|
157
|
+
{
|
|
158
|
+
scope.error(RED._("hue-motion.node.error-invalid-sensitivity", { max: maximum }), msg);
|
|
159
|
+
return false;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
patchObject["sensitivity"] = { sensitivity: sensitivity };
|
|
163
|
+
}
|
|
164
|
+
|
|
144
165
|
//
|
|
145
166
|
// SHOULD PATCH?
|
|
146
167
|
if(Object.values(patchObject).length > 0)
|
|
@@ -153,15 +174,15 @@ module.exports = function(RED)
|
|
|
153
174
|
|
|
154
175
|
// PATCH!
|
|
155
176
|
async.retry({
|
|
156
|
-
times:
|
|
177
|
+
times: 5,
|
|
157
178
|
errorFilter: function(err) {
|
|
158
|
-
return (err.status == 503);
|
|
179
|
+
return (err.status == 503 || err.status == 429);
|
|
159
180
|
},
|
|
160
|
-
interval: function(retryCount) { return retryCount
|
|
181
|
+
interval: function(retryCount) { return 750*retryCount; }
|
|
161
182
|
},
|
|
162
183
|
function(callback, results)
|
|
163
184
|
{
|
|
164
|
-
bridge.patch(
|
|
185
|
+
bridge.patch(currentState.info.type, tempSensorID, patchObject)
|
|
165
186
|
.then(function() { if(done) { callback(null, true); }})
|
|
166
187
|
.catch(function(errors) { callback(errors, null); });
|
|
167
188
|
},
|
|
@@ -194,6 +215,14 @@ module.exports = function(RED)
|
|
|
194
215
|
if(done) { done(); }
|
|
195
216
|
}
|
|
196
217
|
});
|
|
218
|
+
|
|
219
|
+
//
|
|
220
|
+
// CLOSE NODE / DETACH FROM THE BRIDGE
|
|
221
|
+
this.on('close', function()
|
|
222
|
+
{
|
|
223
|
+
if(scope.unsubscribe) { scope.unsubscribe(); }
|
|
224
|
+
});
|
|
225
|
+
|
|
197
226
|
}
|
|
198
227
|
|
|
199
228
|
RED.nodes.registerType("hue-motion", HueMotion);
|
package/huemagic/hue-rules.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<input type="text" id="node-input-name" data-i18n="[placeholder]hue-rules.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-rules.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,15 +19,21 @@
|
|
|
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-skipevents" style="flex:
|
|
24
|
-
<span data-i18n="hue-rules.config.skipevents-node" style="
|
|
22
|
+
<div style="display: inline-flex; align-items: center; width: calc(100% - 105px)">
|
|
23
|
+
<input type="checkbox" id="node-input-skipevents" style="flex: 0 0 auto; width: auto; margin: 0;">
|
|
24
|
+
<span data-i18n="hue-rules.config.skipevents-node" 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-initevents" style="flex:
|
|
30
|
-
<span data-i18n="hue-rules.config.sendinitevents-node" style="
|
|
28
|
+
<div style="display: inline-flex; align-items: center; width: calc(100% - 105px)">
|
|
29
|
+
<input type="checkbox" id="node-input-initevents" style="flex: 0 0 auto; width: auto; margin: 0;">
|
|
30
|
+
<span data-i18n="hue-rules.config.sendinitevents-node" style="flex: 1; margin-left: 8px;"></span>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
<div class="form-row">
|
|
34
|
+
<div style="display: inline-flex; align-items: center; width: calc(100% - 105px)">
|
|
35
|
+
<input type="checkbox" id="node-input-onlycommands" style="flex: 0 0 auto; width: auto; margin: 0;">
|
|
36
|
+
<span data-i18n="hue-rules.config.onlycommands-node" style="flex: 1; margin-left: 8px;"></span>
|
|
31
37
|
</div>
|
|
32
38
|
</div>
|
|
33
39
|
</script>
|
|
@@ -41,10 +47,11 @@
|
|
|
41
47
|
bridge: { type: "hue-bridge", required: true },
|
|
42
48
|
ruleid: { value:"", required: false },
|
|
43
49
|
skipevents: { value: false },
|
|
44
|
-
initevents: { value: false }
|
|
50
|
+
initevents: { value: false },
|
|
51
|
+
onlycommands: { value: false }
|
|
45
52
|
},
|
|
46
53
|
align: 'left',
|
|
47
|
-
icon: "hue-rules.
|
|
54
|
+
icon: "hue-rules.svg",
|
|
48
55
|
inputs: 1,
|
|
49
56
|
outputs: 1,
|
|
50
57
|
label: function() {
|
package/huemagic/hue-rules.js
CHANGED
|
@@ -37,7 +37,7 @@ module.exports = function(RED)
|
|
|
37
37
|
|
|
38
38
|
//
|
|
39
39
|
// SUBSCRIBE TO UPDATES FROM THE BRIDGE
|
|
40
|
-
bridge.subscribe("rule", config.ruleid, function(info)
|
|
40
|
+
this.unsubscribe = bridge.subscribe("rule", config.ruleid, function(info)
|
|
41
41
|
{
|
|
42
42
|
let currentState = bridge.get("rule", info.id);
|
|
43
43
|
|
|
@@ -58,7 +58,7 @@ module.exports = function(RED)
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
// SEND MESSAGE
|
|
61
|
-
if(!config.skipevents && (config.initevents || info.suppressMessage == false))
|
|
61
|
+
if(!config.skipevents && (config.initevents || info.suppressMessage == false) && (!config.onlycommands || scope.lastCommand !== null))
|
|
62
62
|
{
|
|
63
63
|
// SET LAST COMMAND
|
|
64
64
|
if(scope.lastCommand !== null)
|
|
@@ -94,14 +94,14 @@ module.exports = function(RED)
|
|
|
94
94
|
const tempRuleID = (!config.ruleid && typeof msg.topic != 'undefined' && isNaN(msg.topic) == false) ? msg.topic : config.ruleid;
|
|
95
95
|
if(!tempRuleID)
|
|
96
96
|
{
|
|
97
|
-
scope.error("
|
|
97
|
+
scope.error(RED._("hue-rules.node.error-no-id"), msg);
|
|
98
98
|
return false;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
let currentState = bridge.get("rule", "rule_" + tempRuleID);
|
|
102
102
|
if(!currentState)
|
|
103
103
|
{
|
|
104
|
-
scope.error("
|
|
104
|
+
scope.error(RED._("hue-rules.node.error-not-available"), msg);
|
|
105
105
|
return false;
|
|
106
106
|
}
|
|
107
107
|
|
|
@@ -113,11 +113,11 @@ module.exports = function(RED)
|
|
|
113
113
|
|
|
114
114
|
// PATCH!
|
|
115
115
|
async.retry({
|
|
116
|
-
times:
|
|
116
|
+
times: 5,
|
|
117
117
|
errorFilter: function(err) {
|
|
118
|
-
return (err.status == 503);
|
|
118
|
+
return (err.status == 503 || err.status == 429);
|
|
119
119
|
},
|
|
120
|
-
interval: function(retryCount) { return retryCount
|
|
120
|
+
interval: function(retryCount) { return 750*retryCount; }
|
|
121
121
|
},
|
|
122
122
|
function(callback, results)
|
|
123
123
|
{
|
|
@@ -154,7 +154,15 @@ module.exports = function(RED)
|
|
|
154
154
|
if(done) {done();}
|
|
155
155
|
}
|
|
156
156
|
});
|
|
157
|
+
|
|
158
|
+
//
|
|
159
|
+
// CLOSE NODE / DETACH FROM THE BRIDGE
|
|
160
|
+
this.on('close', function()
|
|
161
|
+
{
|
|
162
|
+
if(scope.unsubscribe) { scope.unsubscribe(); }
|
|
163
|
+
});
|
|
164
|
+
|
|
157
165
|
}
|
|
158
166
|
|
|
159
167
|
RED.nodes.registerType("hue-rules", HueRules);
|
|
160
|
-
}
|
|
168
|
+
}
|
package/huemagic/hue-scene.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<input type="text" id="node-input-name" data-i18n="[placeholder]hue-scene.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-scene.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">
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
sceneid: { value: null }
|
|
31
31
|
},
|
|
32
32
|
align: 'left',
|
|
33
|
-
icon: "hue-scene.
|
|
33
|
+
icon: "hue-scene.svg",
|
|
34
34
|
inputs: 1,
|
|
35
35
|
outputs: 1,
|
|
36
36
|
label: function() {
|
|
@@ -97,7 +97,11 @@
|
|
|
97
97
|
$.get('hue/resources', { bridge: bridgeConfig.bridge, key: bridgeConfig.key, type: "scene" })
|
|
98
98
|
.done( function(data) {
|
|
99
99
|
var allResources = JSON.parse(data);
|
|
100
|
-
allResources =
|
|
100
|
+
allResources = allResources.sort(function(a, b) {
|
|
101
|
+
// GROUP FIRST, SO THE SCENES OF A ROOM STAY TOGETHER
|
|
102
|
+
const byGroup = (a.group || "").localeCompare(b.group || "");
|
|
103
|
+
return (byGroup !== 0) ? byGroup : (a.name || "").localeCompare(b.name || "");
|
|
104
|
+
});
|
|
101
105
|
if(allResources.length <= 0)
|
|
102
106
|
{
|
|
103
107
|
notification.close();
|
|
@@ -108,7 +112,7 @@
|
|
|
108
112
|
// SET OPTIONS
|
|
109
113
|
allResources.forEach(function(resource)
|
|
110
114
|
{
|
|
111
|
-
sceneOptions[resource.id] = { value: resource.id, label: resource.
|
|
115
|
+
sceneOptions[resource.id] = { value: resource.id, label: resource.group + " – " + resource.name };
|
|
112
116
|
});
|
|
113
117
|
|
|
114
118
|
// SELECT CURRENT VALUE
|
|
@@ -145,7 +149,7 @@
|
|
|
145
149
|
|
|
146
150
|
if(currentSelectedOptionValue !== false)
|
|
147
151
|
{
|
|
148
|
-
$('#node-input-name').val(currentSelectedOptionValue.split("
|
|
152
|
+
$('#node-input-name').val(currentSelectedOptionValue.split(" – ").pop());
|
|
149
153
|
}
|
|
150
154
|
});
|
|
151
155
|
|
package/huemagic/hue-scene.js
CHANGED
|
@@ -12,9 +12,11 @@ module.exports = function(RED)
|
|
|
12
12
|
|
|
13
13
|
// GET TARGET WIRED GROUPS
|
|
14
14
|
this.targetGroups = {};
|
|
15
|
-
|
|
15
|
+
const wiredNodes = (scope.wires && scope.wires[0]) ? scope.wires[0] : [];
|
|
16
|
+
|
|
17
|
+
for (var w = wiredNodes.length - 1; w >= 0; w--)
|
|
16
18
|
{
|
|
17
|
-
let oneWiredNode = RED.nodes.getNode(
|
|
19
|
+
let oneWiredNode = RED.nodes.getNode(wiredNodes[w]);
|
|
18
20
|
if(oneWiredNode && oneWiredNode.type == "hue-group" && oneWiredNode.exportedConfig && oneWiredNode.exportedConfig.groupid && oneWiredNode.exportedConfig.groupid.length > 1)
|
|
19
21
|
{
|
|
20
22
|
this.targetGroups[oneWiredNode.exportedConfig.groupid] = true;
|
|
@@ -43,8 +45,7 @@ module.exports = function(RED)
|
|
|
43
45
|
// PREPARE TARGET GROUPS
|
|
44
46
|
let copyOfTargetGroups = Object.keys(scope.targetGroups);
|
|
45
47
|
if(typeof groupIDS == 'string') { copyOfTargetGroups.push(groupIDS); }
|
|
46
|
-
else if(
|
|
47
|
-
else { return false; }
|
|
48
|
+
else if(Array.isArray(groupIDS)) { copyOfTargetGroups = copyOfTargetGroups.concat(groupIDS); }
|
|
48
49
|
|
|
49
50
|
// CREATE PATCH
|
|
50
51
|
let patchObject = {};
|
|
@@ -54,14 +55,23 @@ module.exports = function(RED)
|
|
|
54
55
|
{
|
|
55
56
|
// ERROR
|
|
56
57
|
this.status({fill: "red", shape: "ring", text: "hue-scene.node.no-id"});
|
|
57
|
-
scope.error("
|
|
58
|
+
scope.error(RED._("hue-scene.node.no-id"), msg);
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// SCENE NOT (YET) KNOWN?
|
|
63
|
+
const targetScene = bridge.resources ? bridge.resources[sceneDef] : false;
|
|
64
|
+
if(!targetScene)
|
|
65
|
+
{
|
|
66
|
+
this.status({fill: "red", shape: "ring", text: "hue-scene.node.no-id"});
|
|
67
|
+
scope.error(RED._("hue-scene.node.error-not-available"), msg);
|
|
58
68
|
return false;
|
|
59
69
|
}
|
|
60
70
|
|
|
61
71
|
// RECALL ON GROUP? -> USE API v1
|
|
62
|
-
if(copyOfTargetGroups.length > 0)
|
|
72
|
+
if(copyOfTargetGroups.length > 0 && targetScene.id_v1)
|
|
63
73
|
{
|
|
64
|
-
let targetSceneID =
|
|
74
|
+
let targetSceneID = targetScene.id_v1.replace("/scenes/", "");
|
|
65
75
|
|
|
66
76
|
// SEND STATUS
|
|
67
77
|
scope.status({fill: "blue", shape: "dot", text: "hue-scene.node.recalled-on-group"})
|
|
@@ -75,11 +85,11 @@ module.exports = function(RED)
|
|
|
75
85
|
{
|
|
76
86
|
// PATCH!
|
|
77
87
|
async.retry({
|
|
78
|
-
times:
|
|
88
|
+
times: 5,
|
|
79
89
|
errorFilter: function(err) {
|
|
80
|
-
return (err.status == 503);
|
|
90
|
+
return (err.status == 503 || err.status == 429);
|
|
81
91
|
},
|
|
82
|
-
interval: function(retryCount) { return retryCount
|
|
92
|
+
interval: function(retryCount) { return 750*retryCount; }
|
|
83
93
|
},
|
|
84
94
|
function(callback, results)
|
|
85
95
|
{
|
|
@@ -110,23 +120,49 @@ module.exports = function(RED)
|
|
|
110
120
|
}
|
|
111
121
|
else
|
|
112
122
|
{
|
|
113
|
-
// RECALL SCENE
|
|
114
|
-
|
|
123
|
+
// RECALL SCENE (SMART SCENES USE THEIR OWN RESOURCE AND ACTION)
|
|
124
|
+
const sceneType = (targetScene.type === "smart_scene") ? "smart_scene" : "scene";
|
|
125
|
+
patchObject["recall"] = { action: (sceneType === "smart_scene") ? "activate" : "active" };
|
|
126
|
+
|
|
127
|
+
// A NORMAL SCENE CAN ALSO FADE IN AND BE DIMMED WHILE IT IS RECALLED
|
|
128
|
+
if(sceneType === "scene")
|
|
129
|
+
{
|
|
130
|
+
if(typeof msg.payload != 'undefined' && typeof msg.payload.transitionTime != 'undefined')
|
|
131
|
+
{
|
|
132
|
+
let duration = Math.round(parseFloat(msg.payload.transitionTime) * 1000);
|
|
133
|
+
duration = (duration > 6000000) ? 6000000 : ((duration < 0) ? 0 : duration);
|
|
134
|
+
|
|
135
|
+
patchObject["recall"]["duration"] = duration;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
if(typeof msg.payload != 'undefined' && typeof msg.payload.brightness != 'undefined')
|
|
139
|
+
{
|
|
140
|
+
const brightness = parseFloat(msg.payload.brightness);
|
|
141
|
+
|
|
142
|
+
if(isNaN(brightness) || brightness < 0 || brightness > 100)
|
|
143
|
+
{
|
|
144
|
+
scope.error(RED._("hue-scene.node.error-invalid-brightness"), msg);
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
patchObject["recall"]["dimming"] = { brightness: brightness };
|
|
149
|
+
}
|
|
150
|
+
}
|
|
115
151
|
|
|
116
152
|
// CHANGE NODE UI STATE
|
|
117
153
|
scope.status({fill: "grey", shape: "ring", text: "hue-scene.node.command"});
|
|
118
154
|
|
|
119
155
|
// PATCH!
|
|
120
156
|
async.retry({
|
|
121
|
-
times:
|
|
157
|
+
times: 5,
|
|
122
158
|
errorFilter: function(err) {
|
|
123
|
-
return (err.status == 503);
|
|
159
|
+
return (err.status == 503 || err.status == 429);
|
|
124
160
|
},
|
|
125
|
-
interval: function(retryCount) { return retryCount
|
|
161
|
+
interval: function(retryCount) { return 750*retryCount; }
|
|
126
162
|
},
|
|
127
163
|
function(callback, results)
|
|
128
164
|
{
|
|
129
|
-
bridge.patch(
|
|
165
|
+
bridge.patch(sceneType, sceneDef, patchObject)
|
|
130
166
|
.then(function()
|
|
131
167
|
{
|
|
132
168
|
scope.status({fill: "blue", shape: "dot", text: "hue-scene.node.recalled"});
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
<script type="text/x-red" data-template-name="hue-speaker">
|
|
2
|
+
<div class="form-row">
|
|
3
|
+
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="hue-speaker.config.name"></span></label>
|
|
4
|
+
<input type="text" id="node-input-name" data-i18n="[placeholder]hue-speaker.config.input-name" style="width: calc(100% - 105px)">
|
|
5
|
+
</div>
|
|
6
|
+
<div class="form-row">
|
|
7
|
+
<label for="node-input-bridge"><i class="fa fa-server"></i> <span data-i18n="hue-speaker.config.bridge"></span></label>
|
|
8
|
+
<input type="text" id="node-input-bridge" style="width: calc(100% - 105px)">
|
|
9
|
+
</div>
|
|
10
|
+
<div class="form-row">
|
|
11
|
+
<label for="node-input-speakerid"><i class="fa fa-volume-up"></i> <span data-i18n="hue-speaker.config.speaker"></span></label>
|
|
12
|
+
<div style="display: inline-flex; width: calc(100% - 105px)">
|
|
13
|
+
<div id="input-select-toggle" style="flex-grow: 1;">
|
|
14
|
+
<input type="text" id="node-input-speakerid" placeholder="00000000-0000-0000-0000-000000000000" style="width: 100%"/>
|
|
15
|
+
</div>
|
|
16
|
+
<button id="node-config-input-scan-speaker" type="button" class="red-ui-button" style="margin-left: 10px;">
|
|
17
|
+
<i class="fa fa-search"></i>
|
|
18
|
+
</button>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
<div class="form-row" style="margin-top: 30px">
|
|
22
|
+
<div style="display: inline-flex; align-items: center; width: calc(100% - 105px)">
|
|
23
|
+
<input type="checkbox" id="node-input-skipevents" style="flex: 0 0 auto; width: auto; margin: 0;">
|
|
24
|
+
<span data-i18n="hue-speaker.config.skipevents-node" style="flex: 1; margin-left: 8px;"></span>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
<div class="form-row">
|
|
28
|
+
<div style="display: inline-flex; align-items: center; width: calc(100% - 105px)">
|
|
29
|
+
<input type="checkbox" id="node-input-initevents" style="flex: 0 0 auto; width: auto; margin: 0;">
|
|
30
|
+
<span data-i18n="hue-speaker.config.sendinitevents-node" style="flex: 1; margin-left: 8px;"></span>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
<div class="form-row">
|
|
34
|
+
<div style="display: inline-flex; align-items: center; width: calc(100% - 105px)">
|
|
35
|
+
<input type="checkbox" id="node-input-onlycommands" style="flex: 0 0 auto; width: auto; margin: 0;">
|
|
36
|
+
<span data-i18n="hue-speaker.config.onlycommands-node" style="flex: 1; margin-left: 8px;"></span>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<script type="text/javascript">
|
|
42
|
+
RED.nodes.registerType('hue-speaker',{
|
|
43
|
+
category: 'HueMagic',
|
|
44
|
+
color: '#8182df',
|
|
45
|
+
defaults: {
|
|
46
|
+
name: { value:"" },
|
|
47
|
+
bridge: { type: "hue-bridge", required: true },
|
|
48
|
+
speakerid: { value:"", required: false },
|
|
49
|
+
skipevents: { value: false },
|
|
50
|
+
initevents: { value: false },
|
|
51
|
+
onlycommands: { value: false }
|
|
52
|
+
},
|
|
53
|
+
align: 'left',
|
|
54
|
+
icon: "hue-speaker.svg",
|
|
55
|
+
inputs: 1,
|
|
56
|
+
outputs: 1,
|
|
57
|
+
label: function() {
|
|
58
|
+
return this.name || this._("hue-speaker.node.title");
|
|
59
|
+
},
|
|
60
|
+
paletteLabel: function() {
|
|
61
|
+
return this._("hue-speaker.node.title");
|
|
62
|
+
},
|
|
63
|
+
inputLabels: function() {
|
|
64
|
+
return this._("hue-speaker.node.input");
|
|
65
|
+
},
|
|
66
|
+
outputLabels: function() {
|
|
67
|
+
return this._("hue-speaker.node.output");
|
|
68
|
+
},
|
|
69
|
+
oneditprepare: function()
|
|
70
|
+
{
|
|
71
|
+
const scope = this;
|
|
72
|
+
let options = [];
|
|
73
|
+
|
|
74
|
+
function manualInput()
|
|
75
|
+
{
|
|
76
|
+
// GET CURRENT SELECTED VALUE
|
|
77
|
+
var current = $('#node-input-speakerid').val();
|
|
78
|
+
|
|
79
|
+
// REMOVE SELECT FIELD
|
|
80
|
+
$('#input-select-toggle').empty();
|
|
81
|
+
|
|
82
|
+
// CREATE NEW INPUT FIELD
|
|
83
|
+
$('#input-select-toggle').append('<input type="text" id="node-input-speakerid" placeholder="00000000-0000-0000-0000-000000000000" style="width: 100%" value="'+current+'" />');
|
|
84
|
+
|
|
85
|
+
// CHANGE BUTTON ICON
|
|
86
|
+
var button = $("#node-config-input-scan-speaker");
|
|
87
|
+
var buttonIcon = button.find("i");
|
|
88
|
+
buttonIcon.removeClass("fa-pencil");
|
|
89
|
+
buttonIcon.addClass("fa-search");
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function sortResourcesBy(prop, resources)
|
|
93
|
+
{
|
|
94
|
+
return resources.sort((a, b) => {
|
|
95
|
+
if ( a[prop] < b[prop] ){
|
|
96
|
+
return -1;
|
|
97
|
+
}
|
|
98
|
+
if ( a[prop] > b[prop] ){
|
|
99
|
+
return 1;
|
|
100
|
+
}
|
|
101
|
+
return 0;
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function searchAndSelect()
|
|
106
|
+
{
|
|
107
|
+
// GET CURRENT BRIDGE CONFIGURATION
|
|
108
|
+
var bridgeConfig = RED.nodes.node($('#node-input-bridge option:selected').val());
|
|
109
|
+
if(!bridgeConfig) { return false; }
|
|
110
|
+
|
|
111
|
+
// GET CURRENT SELECTED VALUE
|
|
112
|
+
var current = $('#node-input-speakerid').val();
|
|
113
|
+
|
|
114
|
+
// TRIGGER SEARCHING NOTIFICATION
|
|
115
|
+
var notification = RED.notify(scope._("hue-speaker.config.searching"), { type: "compact", modal: true, fixed: true });
|
|
116
|
+
|
|
117
|
+
// GET THE SENSORS
|
|
118
|
+
$.get('hue/resources', { bridge: bridgeConfig.bridge, key: bridgeConfig.key, type: "speaker" })
|
|
119
|
+
.done( function(data) {
|
|
120
|
+
var allResources = JSON.parse(data);
|
|
121
|
+
allResources = sortResourcesBy('name', allResources);
|
|
122
|
+
if(allResources.length <= 0)
|
|
123
|
+
{
|
|
124
|
+
notification.close();
|
|
125
|
+
RED.notify(scope._("hue-speaker.config.none-found"), { type: "error" });
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// SET OPTIONS
|
|
130
|
+
allResources.forEach(function(resource)
|
|
131
|
+
{
|
|
132
|
+
if(resource.model)
|
|
133
|
+
{
|
|
134
|
+
options[resource.id] = { value: resource.id, label: resource.name + " ("+resource.model+")" };
|
|
135
|
+
}
|
|
136
|
+
else
|
|
137
|
+
{
|
|
138
|
+
options[resource.id] = { value: resource.id, label: resource.name };
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
// SELECT CURRENT VALUE
|
|
143
|
+
$("#node-input-speakerid").typedInput({
|
|
144
|
+
types: [
|
|
145
|
+
{
|
|
146
|
+
value: current,
|
|
147
|
+
options: Object.values(options)
|
|
148
|
+
}
|
|
149
|
+
]
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
// CHANGE BUTTON ICON
|
|
153
|
+
var button = $("#node-config-input-scan-speaker");
|
|
154
|
+
var buttonIcon = button.find("i");
|
|
155
|
+
buttonIcon.removeClass("fa-search");
|
|
156
|
+
buttonIcon.addClass("fa-pencil");
|
|
157
|
+
|
|
158
|
+
// CLOSE SEARCH NOTIFICATION
|
|
159
|
+
notification.close();
|
|
160
|
+
})
|
|
161
|
+
.fail(function()
|
|
162
|
+
{
|
|
163
|
+
notification.close();
|
|
164
|
+
RED.notify(scope._("hue-speaker.config.unknown-error"), "error");
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// CHANGED SENSOR ID? -> REPLACE NAME (IF POSSIBLE)
|
|
169
|
+
$(document).on('change', '#node-input-speakerid', function(e)
|
|
170
|
+
{
|
|
171
|
+
let currentSelectedOptionID = $(e.currentTarget).val();
|
|
172
|
+
let currentSelectedOptionValue = (currentSelectedOptionID.length > 0 && options[currentSelectedOptionID]) ? options[currentSelectedOptionID].label : false;
|
|
173
|
+
|
|
174
|
+
if(currentSelectedOptionValue !== false)
|
|
175
|
+
{
|
|
176
|
+
$('#node-input-name').val(currentSelectedOptionValue.split(" (")[0]);
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
// TOGGLE SELECT/INPUT FIELD
|
|
181
|
+
$('#node-config-input-scan-speaker').click(function()
|
|
182
|
+
{
|
|
183
|
+
if($('#input-select-toggle').find(".red-ui-typedInput-container").length > 0)
|
|
184
|
+
{
|
|
185
|
+
manualInput();
|
|
186
|
+
}
|
|
187
|
+
else
|
|
188
|
+
{
|
|
189
|
+
searchAndSelect();
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
},
|
|
193
|
+
button: {
|
|
194
|
+
enabled: function() {
|
|
195
|
+
return (this.speakerid && this.speakerid.length > 1)
|
|
196
|
+
},
|
|
197
|
+
visible: function() {
|
|
198
|
+
return (this.speakerid && this.speakerid.length > 1)
|
|
199
|
+
},
|
|
200
|
+
onclick: function()
|
|
201
|
+
{
|
|
202
|
+
const node = this;
|
|
203
|
+
if(node.bridge)
|
|
204
|
+
{
|
|
205
|
+
$.ajax({
|
|
206
|
+
url: "inject/" + node.id,
|
|
207
|
+
type: "POST",
|
|
208
|
+
data: JSON.stringify({ __user_inject_props__: "status"}),
|
|
209
|
+
contentType: "application/json; charset=utf-8",
|
|
210
|
+
success: function (resp) {
|
|
211
|
+
RED.notify(node.name + ": " + node._("hue-speaker.node.statusmsg"), { type: "success", id: "status", timeout: 2000 });
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
</script>
|