]> git.basschouten.com Git - openhab-addons.git/blob
55374c8643a172b9f4a0fb89ad27ed6eb246c493
[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.nibeheatpump.internal.models;
14
15 /**
16  * Class for VariableInformation
17  *
18  * @author Pauli Anttila - Initial contribution
19  */
20 public class VariableInformation {
21
22     public enum NibeDataType {
23         U8,
24         U16,
25         U32,
26         S8,
27         S16,
28         S32
29     }
30
31     public enum Type {
32         SENSOR,
33         SETTING
34     }
35
36     public int factor;
37     public NibeDataType dataType;
38     public Type type;
39     public String variable;
40
41     public VariableInformation() {
42     }
43
44     public VariableInformation(int factor, NibeDataType dataType, Type type, String variable) {
45         this.factor = factor;
46         this.dataType = dataType;
47         this.type = type;
48         this.variable = variable;
49     }
50
51     public static VariableInformation getVariableInfo(PumpModel model, int key) {
52         switch (model) {
53             case F1X45:
54                 return F1X45.getVariableInfo(key);
55             case F1X55:
56                 return F1X55.getVariableInfo(key);
57             case SMO40:
58                 return SMO40.getVariableInfo(key);
59             case F750:
60                 return F750.getVariableInfo(key);
61             case F470:
62                 return F470.getVariableInfo(key);
63             default:
64                 return null;
65         }
66     }
67
68     @Override
69     public String toString() {
70         String str = "";
71
72         str += "Factor = " + factor;
73         str += ", DataType = " + dataType;
74         str += ", Type = " + type;
75         str += ", VariableName = " + variable;
76
77         return str;
78     }
79 }