How to use the homey-meshdriver.Util.convertRGBToHSV 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
.then(result => {
						if (result[0] === 0 && result[1] === 0) {
							const hsv = Utils.convertRGBToHSV({
								red: result[2],
								green: result[3],
								blue: result[4],
							});

							this.setCapabilityValue('light_mode', 'color');
							this.setCapabilityValue('light_hue', hsv.hue);
							this.setCapabilityValue('light_saturation', hsv.saturation);
						} else {
							const temperature = Math.round(result[0] / 255 * 100) / 100;
							this.setCapabilityValue('light_mode', 'temperature');
							this.setCapabilityValue('light_temperature', temperature);
						}
					});
			}, 500);

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