]> git.basschouten.com Git - openhab-addons.git/blob
d00a4b05a68d2cbe121d86f21a269f5114253a72
[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.mihome.internal.handler;
14
15 import java.util.HashMap;
16 import java.util.Map;
17
18 import org.openhab.core.thing.Thing;
19
20 /**
21  * Handles the Xiaomi gas sensor device
22  *
23  * @author Dieter Schmidt - Initial contribution
24  */
25 public class XiaomiSensorGasHandler extends XiaomiSensorBaseAlarmHandler {
26
27     private static final Map<Integer, String> ALARM_STATUS_MAP = new HashMap<>();
28
29     static {
30         ALARM_STATUS_MAP.put(0, "OK");
31         ALARM_STATUS_MAP.put(1, "Gas alarm");
32         ALARM_STATUS_MAP.put(2, "Analog alarm");
33         ALARM_STATUS_MAP.put(64, "Sensitivity fault alarm");
34         ALARM_STATUS_MAP.put(32768, "I2C communication failure");
35     }
36
37     public XiaomiSensorGasHandler(Thing thing) {
38         super(thing);
39     }
40 }