How to use the homey-meshdriver.Util.convertHSVToRGB function in homey-meshdriver

To help you get started, we’ve selected a few homey-meshdriver examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github athombv / node-homey-meshdriver / lib / zwave / ZwaveLightDevice.js View on Github external
setTimeout(async () => {
					if (debounceColorMode) {
						clearTimeout(debounceColorMode);
						debounceColorMode = false;
						return this.setCapabilityValue('light_mode', value);
					}

					if (value === 'color') {
						const hue = this.getCapabilityValue('light_hue') || 1;
						const saturation = this.getCapabilityValue('light_saturation') || 1;
						const _value = 1; // brightness value is not determined in SWITCH_COLOR but with SWITCH_MULTILEVEL, changing this throws the dim value vs real life brightness out of sync

						const rgb = Utils.convertHSVToRGB({ hue, saturation, _value });

						return await this._sendColors({
							warm: 0,
							cold: 0,
							red: rgb.red,
							green: rgb.green,
							blue: rgb.blue,
							duration: options.duration || null,
						});

					} else if (value === 'temperature') {
						const temperature = this.getCapabilityValue('light_temperature') || 1;
						const warm = temperature * 255;
						const cold = (1 - temperature) * 255;

						return await this._sendColors({

homey-meshdriver

Use this module to make the creation of Z-Wave & ZigBee Homey Apps easier.

ISC
Latest version published 2 years ago

Package Health Score

45 / 100
Full package analysis

Similar packages