]> git.basschouten.com Git - openhab-addons.git/blob
c806e3ec644aa32e9d7d3e2d227051ff3a73344d
[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 SET_SLEEP_NUMBER = "/rest/bed/%s/sleepNumber";
31     private static final String SET_PAUSE_MODE = "/rest/bed/%s/pauseMode";
32
33     public static String login() {
34         return LOGIN;
35     }
36
37     public static String bed() {
38         return BED;
39     }
40
41     public static String sleeper() {
42         return SLEEPER;
43     }
44
45     public static String familyStatus() {
46         return FAMILY_STATUS;
47     }
48
49     public static String pauseMode(String bedId) {
50         return String.format(PAUSE_MODE, bedId);
51     }
52
53     public static String sleepData() {
54         return SLEEP_DATA;
55     }
56
57     public static String setSleepNumber(String bedId) {
58         return String.format(SET_SLEEP_NUMBER, bedId);
59     }
60
61     public static String setPauseMode(String bedId) {
62         return String.format(SET_PAUSE_MODE, bedId);
63     }
64
65     private Endpoints() {
66     }
67 }