Static Methods
calculateDimDuration
(static) calculateDimDuration(duration, opts): numberCalculate a duration value for SWITCH_MULTILEVEL and SWITCH_BINARY from an input value in milliseconds. Below 127 the value is in seconds, above the value is in minutes. Hence, above 127 some rounding might occur. If a value larger than 7560 is entered it will be maxed at 254 (longest duration possible).
Parameters
Name | Type | Description |
---|---|---|
duration
|
number | Dim duration in milliseconds (0 - 7560000ms) |
opts
|
object | |
maxValue
|
number | Use a custom max value |
|
Returns
Range 0 - 254 (short to long) 1-127 = 1 second – 127 seconds 128 – 253 = 1 minute – 126 minutes 254 max
calculateZwaveDimDuration
(static) calculateZwaveDimDuration(duration, opts): numberdeprecated since v1.0.0 - Use calculateDimDuration instead.
Parameters
Name | Type | Description |
---|---|---|
duration
|
number | Dim duration in milliseconds (0 - 7560000ms) |
opts
|
object | |
maxValue
|
number | Use a custom max value |
|
Returns
Range 0 - 254 (short to long) 1-127 = 1 second – 127 seconds 128 – 253 = 1 minute – 126 minutes 254 max
convertHSVToCIE
(static) convertHSVToCIE(): Util.CIE|ErrorconvertHSVToRGB
(static) convertHSVToRGB(): Util.RGBconvertRGBToCIE
(static) convertRGBToCIE(): Util.CIE|ErrorconvertRGBToHSV
(static) convertRGBToHSV(): Util.HSVmapValueRange
(static) mapValueRange(inputStart, inputEnd, outputStart, outputEnd, input): number|nullMap a range of values to a different range of values.
Parameters
Name | Type | Description |
---|---|---|
inputStart
|
||
inputEnd
|
||
outputStart
|
||
outputEnd
|
||
input
|
Returns
Type Definitions
CIE
CIEType
- object
Properties
Name | Type | Description |
---|---|---|
x
|
number | CIE x (small x) value, range 0 - 0.8. |
y
|
number | CIE y (small y) value, range 0 - 0.9. |
HSV
HSVType
- object
Properties
Name | Type | Description |
---|---|---|
hue
|
number | Hue value, range 0 - 1. |
saturation
|
number | Saturation value, range 0 - 1. |
value
|
number | Value (brightness) value, range 0 - 1. |
RGB
RGBType
- object
Properties
Name | Type | Description |
---|---|---|
red
|
number | Red value, range 0 - 255. |
green
|
number | Green value, range 0 - 255. |
blue
|
number | Blue value, range 0 - 255. |