]> git.basschouten.com Git - openhab-addons.git/blob
5a99eed3458206cc674efdede2e1c22c58684bb9
[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.sleepiq.internal.api.impl;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16
17 /**
18  * The {@link Endpoints} class contains all endpoints for the sleepiq API.
19  *
20  * @author Gregory Moyer - Initial contribution
21  */
22 @NonNullByDefault
23 public class Endpoints {
24     private static final String LOGIN = "/rest/login";
25     private static final String BED = "/rest/bed";
26     private static final String SLEEPER = "/rest/sleeper";
27     private static final String FAMILY_STATUS = "/rest/bed/familyStatus";
28     private static final String PAUSE_MODE = "/rest/bed/%s/pauseMode";
29     private static final String SLEEP_DATA = "/rest/sleepData";
30     private static final String SLEEP_NUMBER = "/rest/bed/%s/sleepNumber";
31     private static final String FOUNDATION_STATUS = "/rest/bed/%s/foundation/status";
32     private static final String FOUNDATION_FEATURES = "/rest/bed/%s/foundation/system";
33     private static final String FOUNDATION_POSITION = "/rest/bed/%s/foundation/adjustment/micro";
34     private static final String FOUNDATION_PRESET = "/rest/bed/%s/foundation/preset";
35     private static final String FOUNDATION_OUTLET = "/rest/bed/%s/foundation/outlet";
36
37     public static String login() {
38         return LOGIN;
39     }
40
41     public static String bed() {
42         return BED;
43     }
44
45     public static String sleeper() {
46         return SLEEPER;
47     }
48
49     public static String familyStatus() {
50         return FAMILY_STATUS;
51     }
52
53     public static String pauseMode(String bedId) {
54         return String.format(PAUSE_MODE, bedId);
55     }
56
57     public static String sleepData() {
58         return SLEEP_DATA;
59     }
60
61     public static String sleepNumber(String bedId) {
62         return String.format(SLEEP_NUMBER, bedId);
63     }
64
65     public static String foundationStatus(String bedId) {
66         return String.format(FOUNDATION_STATUS, bedId);
67     }
68
69     public static String foundationFeatures(String bedId) {
70         return String.format(FOUNDATION_FEATURES, bedId);
71     }
72
73     public static String foundationPosition(String bedId) {
74         return String.format(FOUNDATION_POSITION, bedId);
75     }
76
77     public static String foundationPreset(String bedId) {
78         return String.format(FOUNDATION_PRESET, bedId);
79     }
80
81     public static String foundationOutlet(String bedId) {
82         return String.format(FOUNDATION_OUTLET, bedId);
83     }
84
85     private Endpoints() {
86     }
87 }