]> git.basschouten.com Git - openhab-addons.git/blob
fc50d008bcc9bb1333e459e5a7c0fa8ec8954027
[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.boschshc.internal.services.silentmode.dto;
14
15 import org.openhab.binding.boschshc.internal.services.dto.BoschSHCServiceState;
16 import org.openhab.binding.boschshc.internal.services.silentmode.SilentModeState;
17 import org.openhab.core.library.types.OnOffType;
18
19 /**
20  * Represents the state of the silent mode for thermostats.
21  * <p>
22  * Example JSON for normal mode:
23  * 
24  * <pre>
25  * {
26  *   "@type": "silentModeState",
27  *   "mode": "MODE_NORMAL"
28  * }
29  * </pre>
30  * 
31  * Example JSON for silent mode:
32  * 
33  * <pre>
34  * {
35  *   "@type": "silentModeState",
36  *   "mode": "MODE_SILENT"
37  * }
38  * </pre>
39  * 
40  * @author David Pace - Initial contribution
41  *
42  */
43 public class SilentModeServiceState extends BoschSHCServiceState {
44
45     public SilentModeServiceState() {
46         super("silentModeState");
47     }
48
49     public SilentModeState mode;
50
51     public OnOffType toOnOffType() {
52         return mode == SilentModeState.MODE_SILENT ? OnOffType.ON : OnOffType.OFF;
53     }
54 }