[amazonechocontrol] Improve color temperature channel (#17754)

Signed-off-by: AndrewFG <software@whitebear.ch>
This commit is contained in:
Andrew Fiddian-Green 2024-11-24 00:08:44 +00:00 committed by GitHub
parent 61e9413cdc
commit caf163e9ce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 35 additions and 13 deletions

View File

@ -442,8 +442,9 @@ The channels of the smarthome devices will be generated at runtime. Check in the
|--------------------------|----------------------|-------------|-------------------------------|------------------------------------------------------------------------------------------
| powerState | Switch | R/W | smartHomeDevice, smartHomeDeviceGroup | Shows and changes the state (ON/OFF) of your device
| brightness | Dimmer | R/W | smartHomeDevice, smartHomeDeviceGroup | Shows and changes the brightness of your lamp
| color | Color | R | smartHomeDevice, smartHomeDeviceGroup | Shows the color of your light
| color | Color | R/W | smartHomeDevice, smartHomeDeviceGroup | Shows the color of your light
| colorName | String | R/W | smartHomeDevice, smartHomeDeviceGroup | Shows and changes the color name of your light (groups are not able to show their color)
| colorTemperatureInKelvin | Number:Temperature | R/W | smartHomeDevice, smartHomeDeviceGroup | Shows the color temperature of your light
| colorTemperatureName | String | R/W | smartHomeDevice, smartHomeDeviceGroup | White temperatures name of your lights (groups are not able to show their color)
| armState | String | R/W | smartHomeDevice, smartHomeDeviceGroup | State of your alarm guard. Options: ARMED_AWAY, ARMED_STAY, ARMED_NIGHT, DISARMED (groups are not able to show their state)
| burglaryAlarm | Contact | R | smartHomeDevice | Burglary alarm

View File

@ -12,8 +12,7 @@
*/
package org.openhab.binding.amazonechocontrol.internal.smarthome;
import static org.openhab.binding.amazonechocontrol.internal.smarthome.Constants.ITEM_TYPE_NUMBER;
import static org.openhab.binding.amazonechocontrol.internal.smarthome.Constants.ITEM_TYPE_STRING;
import static org.openhab.binding.amazonechocontrol.internal.smarthome.Constants.*;
import java.io.IOException;
import java.util.List;
@ -28,6 +27,7 @@ import org.openhab.binding.amazonechocontrol.internal.jsons.JsonSmartHomeCapabil
import org.openhab.binding.amazonechocontrol.internal.jsons.JsonSmartHomeDevices.SmartHomeDevice;
import org.openhab.core.library.types.DecimalType;
import org.openhab.core.library.types.StringType;
import org.openhab.core.thing.DefaultSystemChannelTypeProvider;
import org.openhab.core.thing.type.ChannelTypeUID;
import org.openhab.core.types.Command;
import org.openhab.core.types.StateDescription;
@ -51,13 +51,13 @@ public class HandlerColorTemperatureController extends HandlerBase {
private static final ChannelTypeUID CHANNEL_TYPE_COLOR_TEMPERATURE_NAME = new ChannelTypeUID(
AmazonEchoControlBindingConstants.BINDING_ID, "colorTemperatureName");
private static final ChannelTypeUID CHANNEL_TYPE_COLOR_TEPERATURE_IN_KELVIN = new ChannelTypeUID(
AmazonEchoControlBindingConstants.BINDING_ID, "colorTemperatureInKelvin");
private static final ChannelTypeUID CHANNEL_TYPE_COLOR_TEMPERATURE_IN_KELVIN = //
DefaultSystemChannelTypeProvider.SYSTEM_CHANNEL_TYPE_UID_COLOR_TEMPERATURE_ABS;
// Channel and Properties
private static final ChannelInfo COLOR_TEMPERATURE_IN_KELVIN = new ChannelInfo(
"colorTemperatureInKelvin" /* propertyName */ , "colorTemperatureInKelvin" /* ChannelId */,
CHANNEL_TYPE_COLOR_TEPERATURE_IN_KELVIN /* Channel Type */ , ITEM_TYPE_NUMBER /* Item Type */);
CHANNEL_TYPE_COLOR_TEMPERATURE_IN_KELVIN /* Channel Type */ , ITEM_TYPE_NUMBER_TEMPERATURE /* Item Type */);
private static final ChannelInfo COLOR_TEMPERATURE_NAME = new ChannelInfo("colorProperties" /* propertyName */ ,
"colorTemperatureName" /* ChannelId */, CHANNEL_TYPE_COLOR_TEMPERATURE_NAME /* Channel Type */ ,

View File

@ -81,8 +81,6 @@ channel-type.amazonechocontrol.color.label = Color
channel-type.amazonechocontrol.color.description = Color
channel-type.amazonechocontrol.colorName.label = Color Name
channel-type.amazonechocontrol.colorName.description = Color Name
channel-type.amazonechocontrol.colorTemperatureInKelvin.label = Color Temperature In Kelvin
channel-type.amazonechocontrol.colorTemperatureInKelvin.description = Color Temperature In Kelvin
channel-type.amazonechocontrol.colorTemperatureName.label = Color Temperature Name
channel-type.amazonechocontrol.colorTemperatureName.description = Color Temperature Name
channel-type.amazonechocontrol.equalizerBass.label = Bass

View File

@ -255,6 +255,9 @@
</supported-bridge-type-refs>
<label>Smart Home Device</label>
<description>Smart home device connected to Alexa</description>
<properties>
<property name="thingTypeVersion">1</property>
</properties>
<representation-property>id</representation-property>
<config-description>
<parameter name="id" type="text" required="true">
@ -269,6 +272,9 @@
</supported-bridge-type-refs>
<label>Smart Home Device Group</label>
<description>Group of smart home devices in your amazon account</description>
<properties>
<property name="thingTypeVersion">1</property>
</properties>
<representation-property>id</representation-property>
<config-description>
<parameter name="id" type="text" required="true">
@ -573,11 +579,6 @@
<label>Color Temperature Name</label>
<description>Color Temperature Name</description>
</channel-type>
<channel-type id="colorTemperatureInKelvin">
<item-type>Number</item-type>
<label>Color Temperature In Kelvin</label>
<description>Color Temperature In Kelvin</description>
</channel-type>
<!-- Alexa.PercentageController -->
<channel-type id="percentage">
<item-type>Dimmer</item-type>

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<update:update-descriptions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:update="https://openhab.org/schemas/update-description/v1.0.0"
xsi:schemaLocation="https://openhab.org/schemas/update-description/v1.0.0 https://openhab.org/schemas/update-description-1.0.0.xsd">
<thing-type uid="amazonechocontrol:smartHomeDevice">
<instruction-set targetVersion="1">
<update-channel id="colorTemperatureInKelvin">
<type>system:color-temperature-abs</type>
</update-channel>
</instruction-set>
</thing-type>
<thing-type uid="amazonechocontrol:smartHomeDeviceGroup">
<instruction-set targetVersion="1">
<update-channel id="colorTemperatureInKelvin">
<type>system:color-temperature-abs</type>
</update-channel>
</instruction-set>
</thing-type>
</update:update-descriptions>