mirror of
https://github.com/danieldemus/openhab-addons
synced 2026-07-29 12:34:21 +02:00
[yeelight] Deprecations (#20870)
* [yeelight] Deprecations Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
This commit is contained in:
+2
-1
@@ -40,6 +40,7 @@ import org.openhab.core.thing.ThingTypeUID;
|
||||
import org.openhab.core.thing.binding.BaseThingHandler;
|
||||
import org.openhab.core.types.Command;
|
||||
import org.openhab.core.types.RefreshType;
|
||||
import org.openhab.core.util.ColorUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@@ -288,7 +289,7 @@ public abstract class YeelightHandlerBase extends BaseThingHandler
|
||||
|
||||
void handleHSBCommand(HSBType color) {
|
||||
DeviceAction cAction = DeviceAction.color;
|
||||
cAction.putValue(color.getRGB() & 0xFFFFFF);
|
||||
cAction.putValue(ColorUtil.hsbTosRgb(color) & 0xFFFFFF);
|
||||
cAction.putDuration(getDuration());
|
||||
DeviceManager.getInstance().doAction(deviceId, cAction);
|
||||
}
|
||||
|
||||
+3
-1
@@ -16,6 +16,7 @@ import java.awt.Color;
|
||||
import java.io.IOException;
|
||||
import java.net.DatagramPacket;
|
||||
import java.net.InetAddress;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.MulticastSocket;
|
||||
import java.net.NetworkInterface;
|
||||
import java.net.SocketException;
|
||||
@@ -127,7 +128,8 @@ public class DeviceManager {
|
||||
try (MulticastSocket multiSocket = new MulticastSocket(MULTI_CAST_PORT)) {
|
||||
multiSocket.setSoTimeout(TIMEOUT);
|
||||
multiSocket.setNetworkInterface(networkInterface);
|
||||
multiSocket.joinGroup(multicastAddress);
|
||||
multiSocket.joinGroup(new InetSocketAddress(multicastAddress, MULTI_CAST_PORT),
|
||||
networkInterface);
|
||||
|
||||
DatagramPacket dpSend = new DatagramPacket(DISCOVERY_MSG.getBytes(),
|
||||
DISCOVERY_MSG.getBytes().length, multicastAddress, MULTI_CAST_PORT);
|
||||
|
||||
Reference in New Issue
Block a user