2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.fineoffsetweatherstation.internal.domain;
15 import static org.openhab.binding.fineoffsetweatherstation.internal.domain.response.BatteryStatus.Type.LEVEL;
16 import static org.openhab.binding.fineoffsetweatherstation.internal.domain.response.BatteryStatus.Type.LEVEL_OR_DC;
17 import static org.openhab.binding.fineoffsetweatherstation.internal.domain.response.BatteryStatus.Type.LOW_HIGH;
18 import static org.openhab.binding.fineoffsetweatherstation.internal.domain.response.BatteryStatus.Type.VOLTAGE_BROAD_STEPS;
19 import static org.openhab.binding.fineoffsetweatherstation.internal.domain.response.BatteryStatus.Type.VOLTAGE_FINE_STEPS;
21 import org.eclipse.jdt.annotation.NonNullByDefault;
22 import org.openhab.binding.fineoffsetweatherstation.internal.domain.response.BatteryStatus;
25 * The Sensors supported by the gateway.
27 * @author Andreas Berger - Initial contribution
35 WH34(VOLTAGE_FINE_STEPS),
36 WH35(VOLTAGE_FINE_STEPS),
37 WH40(VOLTAGE_BROAD_STEPS),
40 WH51(VOLTAGE_BROAD_STEPS),
44 WH68(VOLTAGE_FINE_STEPS),
45 WH80(VOLTAGE_FINE_STEPS),
46 WH90(VOLTAGE_FINE_STEPS);
48 private final BatteryStatus.Type batteryStatusTpe;
50 Sensor(BatteryStatus.Type batteryStatusTpe) {
51 this.batteryStatusTpe = batteryStatusTpe;
54 public BatteryStatus getBatteryStatus(byte data) {
55 return new BatteryStatus(batteryStatusTpe, data);