]> git.basschouten.com Git - openhab-addons.git/blob
df8b986433cc06c0e81e4fa90ac88226f88be74b
[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.lametrictime.internal.api.local;
14
15 import java.util.List;
16 import java.util.SortedMap;
17
18 import javax.ws.rs.client.ClientBuilder;
19
20 import org.eclipse.jdt.annotation.NonNullByDefault;
21 import org.eclipse.jdt.annotation.Nullable;
22 import org.openhab.binding.lametrictime.internal.api.local.dto.Api;
23 import org.openhab.binding.lametrictime.internal.api.local.dto.Application;
24 import org.openhab.binding.lametrictime.internal.api.local.dto.Audio;
25 import org.openhab.binding.lametrictime.internal.api.local.dto.Bluetooth;
26 import org.openhab.binding.lametrictime.internal.api.local.dto.Device;
27 import org.openhab.binding.lametrictime.internal.api.local.dto.Display;
28 import org.openhab.binding.lametrictime.internal.api.local.dto.Notification;
29 import org.openhab.binding.lametrictime.internal.api.local.dto.UpdateAction;
30 import org.openhab.binding.lametrictime.internal.api.local.dto.WidgetUpdates;
31 import org.openhab.binding.lametrictime.internal.api.local.dto.Wifi;
32 import org.openhab.binding.lametrictime.internal.api.local.impl.LaMetricTimeLocalImpl;
33
34 /**
35  * Interface for local device access.
36  *
37  * @author Gregory Moyer - Initial contribution
38  */
39 @NonNullByDefault
40 public interface LaMetricTimeLocal {
41     Api getApi();
42
43     Device getDevice();
44
45     String createNotification(Notification notification) throws NotificationCreationException;
46
47     List<Notification> getNotifications();
48
49     @Nullable
50     Notification getCurrentNotification();
51
52     Notification getNotification(String id) throws NotificationNotFoundException;
53
54     void deleteNotification(String id) throws NotificationNotFoundException;
55
56     Display getDisplay();
57
58     Display updateDisplay(Display display) throws UpdateException;
59
60     Audio getAudio();
61
62     Audio updateAudio(Audio audio) throws UpdateException;
63
64     Bluetooth getBluetooth();
65
66     Bluetooth updateBluetooth(Bluetooth bluetooth) throws UpdateException;
67
68     Wifi getWifi();
69
70     void updateApplication(String packageName, String accessToken, WidgetUpdates widgetUpdates) throws UpdateException;
71
72     SortedMap<String, Application> getApplications();
73
74     @Nullable
75     Application getApplication(String packageName) throws ApplicationNotFoundException;
76
77     void activatePreviousApplication();
78
79     void activateNextApplication();
80
81     void activateApplication(String packageName, String widgetId) throws ApplicationActivationException;
82
83     void doAction(String packageName, String widgetId, @Nullable UpdateAction action) throws ApplicationActionException;
84
85     static LaMetricTimeLocal create(LocalConfiguration config) {
86         return new LaMetricTimeLocalImpl(config);
87     }
88
89     static LaMetricTimeLocal create(LocalConfiguration config, ClientBuilder clientBuilder) {
90         return new LaMetricTimeLocalImpl(config, clientBuilder);
91     }
92 }