mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[tplinksmarthome] support QuantityType commands (#17946)
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
This commit is contained in:
parent
108067ac4b
commit
56d447fa77
@ -68,6 +68,13 @@ public class BulbDevice extends SmartHomeDevice {
|
|||||||
response = handleOnOffType(channelId, onOffCommand, transitionPeriod);
|
response = handleOnOffType(channelId, onOffCommand, transitionPeriod);
|
||||||
} else if (command instanceof HSBType hsbCommand && CHANNEL_COLOR.equals(channelId)) {
|
} else if (command instanceof HSBType hsbCommand && CHANNEL_COLOR.equals(channelId)) {
|
||||||
response = handleHSBType(channelId, hsbCommand, transitionPeriod);
|
response = handleHSBType(channelId, hsbCommand, transitionPeriod);
|
||||||
|
} else if (command instanceof QuantityType<?> genericQuantity
|
||||||
|
&& CHANNEL_COLOR_TEMPERATURE_ABS.equals(channelId)) {
|
||||||
|
QuantityType<?> kelvinQuantity = genericQuantity.toInvertibleUnit(Units.KELVIN);
|
||||||
|
if (kelvinQuantity == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
response = handleDecimalType(channelId, new DecimalType(kelvinQuantity.intValue()), transitionPeriod);
|
||||||
} else if (command instanceof DecimalType decimalCommand) {
|
} else if (command instanceof DecimalType decimalCommand) {
|
||||||
response = handleDecimalType(channelId, decimalCommand, transitionPeriod);
|
response = handleDecimalType(channelId, decimalCommand, transitionPeriod);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user