2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.tplinksmarthome.internal.device;
15 import java.io.IOException;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.eclipse.jdt.annotation.Nullable;
19 import org.openhab.binding.tplinksmarthome.internal.TPLinkSmartHomeThingType;
20 import org.openhab.binding.tplinksmarthome.internal.model.HasErrorResponse;
21 import org.openhab.core.library.types.HSBType;
22 import org.openhab.core.library.types.OnOffType;
25 * TP-Link Smart Home Light Strip.
27 * @author Hilbrand Bouwkamp - Initial contribution
30 public class LightStripDevice extends BulbDevice {
32 public LightStripDevice(final TPLinkSmartHomeThingType type) {
37 protected @Nullable HasErrorResponse handleOnOffType(final String channelID, final OnOffType onOff,
38 final int transitionPeriod) throws IOException {
39 return commands.setLightStripStateResponse(
40 connection.sendCommand(commands.setLightStripState(onOff, transitionPeriod)));
44 protected @Nullable HasErrorResponse handleBrightness(final int brightness, final int transitionPeriod)
46 return commands.setLightStripStateResponse(
47 connection.sendCommand(commands.setLightStripBrightness(brightness, transitionPeriod)));
51 protected @Nullable HasErrorResponse handleColorTemperature(final int colorTemperature, final int transitionPeriod)
53 return commands.setLightStripStateResponse(
54 connection.sendCommand(commands.setLightStripColorTemperature(colorTemperature, transitionPeriod)));
58 protected @Nullable HasErrorResponse handleHSBType(final String channelID, final HSBType command,
59 final int transitionPeriod) throws IOException {
60 return commands.setLightStripStateResponse(
61 connection.sendCommand(commands.setLightStripColor(command, transitionPeriod)));