]> git.basschouten.com Git - openhab-addons.git/blob
be66d8013942ae082088115a664eabcc130a5dd4
[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.opensprinkler.internal.api;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jetty.client.HttpClient;
17 import org.openhab.binding.opensprinkler.internal.api.exception.CommunicationApiException;
18 import org.openhab.binding.opensprinkler.internal.api.exception.GeneralApiException;
19 import org.openhab.binding.opensprinkler.internal.api.exception.UnauthorizedApiException;
20 import org.openhab.binding.opensprinkler.internal.config.OpenSprinklerHttpInterfaceConfig;
21 import org.openhab.core.types.Command;
22
23 /**
24  * The {@link OpenSprinklerHttpApiV217} class is used for communicating with
25  * the OpenSprinkler API for firmware versions 2.1.7 and up.
26  *
27  * @author Matthew Skinner - Initial contribution
28  */
29 @NonNullByDefault
30 public class OpenSprinklerHttpApiV217 extends OpenSprinklerHttpApiV213 {
31
32     OpenSprinklerHttpApiV217(final HttpClient httpClient, final OpenSprinklerHttpInterfaceConfig config)
33             throws GeneralApiException, CommunicationApiException {
34         super(httpClient, config);
35     }
36
37     @Override
38     public void runProgram(Command command) throws UnauthorizedApiException, CommunicationApiException {
39         http.sendHttpGet(getBaseUrl() + "mp", getRequestRequiredOptions() + "&pid=" + command);
40     }
41 }