]> git.basschouten.com Git - openhab-addons.git/blob
10156f47d50dfc25d7ded0ad326a7535a16730b1
[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.ihc.internal.ws.services;
14
15 import org.openhab.binding.ihc.internal.ws.datatypes.WSTimeManagerSettings;
16 import org.openhab.binding.ihc.internal.ws.exeptions.IhcExecption;
17 import org.openhab.binding.ihc.internal.ws.http.IhcConnectionPool;
18
19 /**
20  * Class to handle IHC / ELKO LS Controller's time service.
21  *
22  * @author Pauli Anttila - Initial contribution
23  */
24 public class IhcTimeService extends IhcBaseService {
25
26     public IhcTimeService(String host, int timeout, IhcConnectionPool ihcConnectionPool) {
27         super(ihcConnectionPool, timeout, host, "TimeManagerService");
28     }
29
30     /**
31      * Query time settings from the controller.
32      *
33      * @return time settings.
34      * @throws IhcExecption
35      */
36     public synchronized WSTimeManagerSettings getTimeSettings() throws IhcExecption {
37         String response = sendSoapQuery("getSettings", EMPTY_QUERY);
38         return new WSTimeManagerSettings().parseXMLData(response);
39     }
40 }