]> git.basschouten.com Git - openhab-addons.git/blob
8681f81a852da740702eb3356c6c807454d69797
[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.mielecloud.internal.webservice.api;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16
17 /**
18  * Represents the power status of the device, i.e. whether it is powered on, off or in standby.
19  *
20  * @author Björn Lange - Initial contribution
21  */
22 @NonNullByDefault
23 public enum PowerStatus {
24     POWER_ON("on"),
25     POWER_OFF("off"),
26     STANDBY("standby");
27
28     /**
29      * Corresponding state of the ChannelTypeDefinition
30      */
31     private String state;
32
33     PowerStatus(String value) {
34         this.state = value;
35     }
36
37     /**
38      * Checks whether the given value is the raw state represented by this enum instance.
39      */
40     public boolean matches(String passedValue) {
41         return state.equalsIgnoreCase(passedValue);
42     }
43
44     /**
45      * Gets the raw state.
46      */
47     public String getState() {
48         return state;
49     }
50 }