]> git.basschouten.com Git - openhab-addons.git/blob
37a43c780b57dfc7adc6446546fbd2d3a163ef5c
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2022 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.shelly.internal.handler;
14
15 import java.util.List;
16 import java.util.Map;
17
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.eclipse.jdt.annotation.Nullable;
20 import org.openhab.binding.shelly.internal.api.ShellyApiException;
21 import org.openhab.binding.shelly.internal.api.ShellyApiInterface;
22 import org.openhab.binding.shelly.internal.api.ShellyApiJsonDTO.ShellySettingsStatus;
23 import org.openhab.binding.shelly.internal.api.ShellyDeviceProfile;
24 import org.openhab.binding.shelly.internal.config.ShellyThingConfiguration;
25 import org.openhab.core.thing.Channel;
26 import org.openhab.core.thing.Thing;
27 import org.openhab.core.thing.ThingStatusDetail;
28 import org.openhab.core.types.State;
29
30 /**
31  * The {@link ShellyThingInterface} implements the interface for Shelly Manager to access the thing handler
32  *
33  * @author Markus Michels - Initial contribution
34  */
35 @NonNullByDefault
36 public interface ShellyThingInterface {
37
38     public ShellyDeviceProfile getProfile(boolean forceRefresh) throws ShellyApiException;
39
40     public double getChannelDouble(String group, String channel);
41
42     public boolean updateChannel(String group, String channel, State value);
43
44     public boolean updateChannel(String channelId, State value, boolean force);
45
46     public void setThingOnline();
47
48     public void setThingOffline(ThingStatusDetail detail, String messageKey);
49
50     public boolean requestUpdates(int requestCount, boolean refreshSettings);
51
52     public void triggerUpdateFromCoap();
53
54     public void reinitializeThing();
55
56     public void restartWatchdog();
57
58     public void publishState(String channelId, State value);
59
60     public boolean areChannelsCreated();
61
62     public State getChannelValue(String group, String channel);
63
64     public boolean updateInputs(ShellySettingsStatus status);
65
66     public void updateChannelDefinitions(Map<String, Channel> dynChannels);
67
68     public void postEvent(String event, boolean force);
69
70     public void triggerChannel(String group, String channelID, String event);
71
72     public void triggerButton(String group, int idx, String value);
73
74     public ShellyDeviceStats getStats();
75
76     public void resetStats();
77
78     public Thing getThing();
79
80     public String getThingName();
81
82     public ShellyThingConfiguration getThingConfig();
83
84     public String getProperty(String key);
85
86     public void updateProperties(String key, String value);
87
88     public boolean updateWakeupReason(@Nullable List<Object> valueArray);
89
90     public ShellyApiInterface getApi();
91
92     public ShellyDeviceProfile getProfile();
93
94     public long getScheduledUpdates();
95
96     public void fillDeviceStatus(ShellySettingsStatus status, boolean updated);
97
98     public boolean checkRepresentation(String key);
99 }