diff --git a/docs/USAGE.md b/docs/USAGE.md index 4044edf4..83315022 100644 --- a/docs/USAGE.md +++ b/docs/USAGE.md @@ -1114,7 +1114,7 @@ Items that represents a color temperature. It is important to note that temperat * Supported item types: * Dimmer (Colder `0%` to warmer `100%` based on defined temperature range for bindings integration) - * Number (Color temperature value in Kelvin for custom integration) + * Number(:Temperature) (Color temperature value in Kelvin for custom integration) * Supported binding presets: * [hue](https://www.openhab.org/addons/bindings/hue/) [color=`2000:6500`, white=`2200:6500`] * [lifx](https://www.openhab.org/addons/bindings/lifx/) [color=`2500:9000`, white=`2700:6500`] diff --git a/lambda/alexa/smarthome/properties/colorTemperature.js b/lambda/alexa/smarthome/properties/colorTemperature.js index 03664f52..06272216 100644 --- a/lambda/alexa/smarthome/properties/colorTemperature.js +++ b/lambda/alexa/smarthome/properties/colorTemperature.js @@ -26,7 +26,7 @@ export default class ColorTemperature extends AlexaProperty { * @return {Array} */ get supportedItemTypes() { - return [ItemType.DIMMER, ItemType.NUMBER]; + return [ItemType.DIMMER, ItemType.NUMBER, ItemType.NUMBER_TEMPERATURE]; } /** @@ -110,7 +110,7 @@ export default class ColorTemperature extends AlexaProperty { * @return {Boolean} */ get requiresSetColorReset() { - return this.item.type === ItemType.NUMBER && this.parameters[Parameter.REQUIRES_SET_COLOR_RESET] === true; + return this.item.type !== ItemType.DIMMER && this.parameters[Parameter.REQUIRES_SET_COLOR_RESET] === true; } /** diff --git a/lambda/test/alexa/cases/discovery/light.test.js b/lambda/test/alexa/cases/discovery/light.test.js index ff93cb97..b4592e41 100644 --- a/lambda/test/alexa/cases/discovery/light.test.js +++ b/lambda/test/alexa/cases/discovery/light.test.js @@ -179,6 +179,16 @@ export default { } } }, + { + type: 'Number:Temperature', + name: 'colorTemperature11', + label: 'Color Temperature 11', + metadata: { + alexa: { + value: 'ColorTemperature' + } + } + }, { type: 'Color', name: 'light99', @@ -371,6 +381,15 @@ export default { item: { name: 'colorTemperature10', type: 'Number' } } ] + }, + colorTemperature11: { + capabilities: [ + 'Alexa.ColorTemperatureController.colorTemperatureInKelvin', + 'Alexa.EndpointHealth.connectivity', + 'Alexa' + ], + displayCategories: ['LIGHT'], + friendlyName: 'Color Temperature 11' } } };