]> git.basschouten.com Git - openhab-addons.git/blob
025b430bffee4b09ed1d366db50a797279833085
[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.enocean.internal.eep.A5_10;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.binding.enocean.internal.messages.ERP1Message;
17 import org.openhab.core.library.types.DecimalType;
18 import org.openhab.core.types.State;
19
20 /**
21  * From A5_10_18 up to A5_10_17 temperature is given as a 8Bit value (range: 250(!)..0).
22  * Therefore higher values mean lower temperatures.
23  * Temperature range 0..40.
24  * 
25  * @author Daniel Weber - Initial contribution
26  */
27 @NonNullByDefault
28 public class A5_10_18 extends A5_10 {
29
30     public A5_10_18(ERP1Message packet) {
31         super(packet);
32     }
33
34     protected double getMinUnscaledTemperatureValue() {
35         return 250.0;
36     }
37
38     @Override
39     protected State getFanSpeedStage() {
40         return new DecimalType((getDB0Value() >>> 4) - 1);
41     }
42 }