]> git.basschouten.com Git - openhab-addons.git/blob
25b6c9d387da32789347f0e3bdd65d9c1eb33d14
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.tplinksmarthome.internal.device;
14
15 import java.io.IOException;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.eclipse.jdt.annotation.Nullable;
19 import org.openhab.binding.tplinksmarthome.internal.model.SetRelayState;
20 import org.openhab.core.library.types.OnOffType;
21 import org.openhab.core.thing.ChannelUID;
22 import org.openhab.core.types.State;
23
24 /**
25  * TP-Link Smart Home range extender with smart plug.
26  *
27  * @author Hilbrand Bouwkamp - Initial contribution
28  */
29 @NonNullByDefault
30 public class RangeExtenderDevice extends SwitchDevice {
31
32     @Override
33     protected State getOnOffState(DeviceState deviceState) {
34         return deviceState.getSysinfo().getPlug().getRelayStatus();
35     }
36
37     @Override
38     protected @Nullable SetRelayState setOnOffState(ChannelUID channelUid, OnOffType onOff) throws IOException {
39         // It's unknown what the command is to send to the device so it's not supported.
40         return null;
41     }
42 }