]> git.basschouten.com Git - openhab-addons.git/blob
72bce6484310b937b8a7f85fa06566c5f983b991
[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     public Api getApi();
42
43     public Device getDevice();
44
45     public String createNotification(Notification notification) throws NotificationCreationException;
46
47     public List<Notification> getNotifications();
48
49     public @Nullable Notification getCurrentNotification();
50
51     public Notification getNotification(String id) throws NotificationNotFoundException;
52
53     public void deleteNotification(String id) throws NotificationNotFoundException;
54
55     public Display getDisplay();
56
57     public Display updateDisplay(Display display) throws UpdateException;
58
59     public Audio getAudio();
60
61     public Audio updateAudio(Audio audio) throws UpdateException;
62
63     public Bluetooth getBluetooth();
64
65     public Bluetooth updateBluetooth(Bluetooth bluetooth) throws UpdateException;
66
67     public Wifi getWifi();
68
69     public void updateApplication(String packageName, String accessToken, WidgetUpdates widgetUpdates)
70             throws UpdateException;
71
72     public SortedMap<String, Application> getApplications();
73
74     public @Nullable Application getApplication(String packageName) throws ApplicationNotFoundException;
75
76     public void activatePreviousApplication();
77
78     public void activateNextApplication();
79
80     public void activateApplication(String packageName, String widgetId) throws ApplicationActivationException;
81
82     public void doAction(String packageName, String widgetId, @Nullable UpdateAction action)
83             throws ApplicationActionException;
84
85     public static LaMetricTimeLocal create(LocalConfiguration config) {
86         return new LaMetricTimeLocalImpl(config);
87     }
88
89     public static LaMetricTimeLocal create(LocalConfiguration config, ClientBuilder clientBuilder) {
90         return new LaMetricTimeLocalImpl(config, clientBuilder);
91     }
92 }