Skip to content

Commit 129557a

Browse files
committed
Fix on Graph percentage
Fix on Graph percentage
1 parent 0fc3605 commit 129557a

File tree

10 files changed

+50
-33
lines changed

10 files changed

+50
-33
lines changed

app/src/main/java/nl/hnogames/domoticz/Adapters/DashboardAdapter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,11 @@ private void setSwitchRowData(DevicesInfo mDeviceInfo,
229229
setButtons(holder, Buttons.BUTTON_ON);
230230
setPushOnOffSwitchRowData(mDeviceInfo, holder, true);
231231
break;
232-
case Domoticz.UTILITIES_TYPE_THERMOSTAT:
232+
case DomoticzValues.Device.Utility.Type.THERMOSTAT:
233233
setButtons(holder, Buttons.BUTTON_ON);
234234
setThermostatRowData(mDeviceInfo, holder);
235235
break;
236-
case Domoticz.UTILITIES_TYPE_HEATING:
236+
case DomoticzValues.Device.Utility.Type.HEATING:
237237
setButtons(holder, Buttons.SET);
238238
setTemperatureRowData(mDeviceInfo, holder);
239239
break;

app/src/main/java/nl/hnogames/domoticz/Adapters/SwitchesAdapter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,11 +249,11 @@ private void setSwitchRowData(DevicesInfo mDeviceInfo,
249249
setButtons(holder, Buttons.BUTTON_ON);
250250
setPushOnOffSwitchRowData(mDeviceInfo, holder, true);
251251
break;
252-
case Domoticz.UTILITIES_TYPE_THERMOSTAT:
252+
case DomoticzValues.Device.Utility.Type.THERMOSTAT:
253253
setButtons(holder, Buttons.BUTTON_ON);
254254
setThermostatRowData(mDeviceInfo, holder);
255255
break;
256-
case Domoticz.UTILITIES_TYPE_HEATING:
256+
case DomoticzValues.Device.Utility.Type.HEATING:
257257
setButtons(holder, Buttons.SET);
258258
setTemperatureRowData(mDeviceInfo, holder);
259259
break;

app/src/main/java/nl/hnogames/domoticz/Adapters/UtilityAdapter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,11 @@ public void onBindViewHolder(final DataObjectHolder holder, final int position)
120120
final UtilitiesInfo mUtilitiesInfo = filteredData.get(position);
121121
final double setPoint = mUtilitiesInfo.getSetPoint();
122122

123-
if (Domoticz.UTILITIES_TYPE_THERMOSTAT.equalsIgnoreCase(mUtilitiesInfo.getType())) {
123+
if (DomoticzValues.Device.Utility.Type.THERMOSTAT.equalsIgnoreCase(mUtilitiesInfo.getType())) {
124124
setButtons(holder, Buttons.THERMOSTAT);
125125
CreateThermostatRow(holder, mUtilitiesInfo, setPoint);
126126
} else {
127-
if (Domoticz.UTILITIES_SUBTYPE_TEXT.equalsIgnoreCase(mUtilitiesInfo.getSubType())) {
127+
if (DomoticzValues.Device.Utility.SubType.TEXT.equalsIgnoreCase(mUtilitiesInfo.getSubType())) {
128128
CreateTextRow(holder, mUtilitiesInfo);
129129
setButtons(holder, Buttons.TEXT);
130130
} else {

app/src/main/java/nl/hnogames/domoticz/Fragments/Graph.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -370,19 +370,19 @@ private LineData generateData(View view) {
370370
}
371371
}
372372

373-
if (g.getPercentage() != null && g.getPercentage().length() > 0) {
373+
if (g.getValue() != null && g.getValue().length() > 0) {
374374
addPercentage = true;
375-
valuesv.add(new Entry(mydate.getTimeInMillis(), Float.parseFloat(g.getPercentage())));
376-
if (g.hasPercentageRange()) {
375+
valuesv.add(new Entry(mydate.getTimeInMillis(), Float.parseFloat(g.getValue())));
376+
if (g.hasValueRange()) {
377377
addPercentageRange = true;
378-
valuesvMin.add(new Entry(mydate.getTimeInMillis(), Float.parseFloat(g.getPercentageMin())));
379-
valuesvMax.add(new Entry(mydate.getTimeInMillis(), Float.parseFloat(g.getPercentageMax())));
378+
valuesvMin.add(new Entry(mydate.getTimeInMillis(), Float.parseFloat(g.getValueMin())));
379+
valuesvMax.add(new Entry(mydate.getTimeInMillis(), Float.parseFloat(g.getValueMax())));
380380
}
381381
}
382382

383-
if (g.getSecondPercentage() != null && g.getSecondPercentage().length() > 0) {
383+
if (g.getSecondValue() != null && g.getSecondValue().length() > 0) {
384384
addSecondPercentage = true;
385-
valuesv2.add(new Entry(mydate.getTimeInMillis(), Float.parseFloat(g.getSecondPercentage())));
385+
valuesv2.add(new Entry(mydate.getTimeInMillis(), Float.parseFloat(g.getSecondValue())));
386386
}
387387

388388
if (g.getCounter() != null && g.getCounter().length() > 0) {

app/src/main/res/layout/dialog_graph.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,15 @@
9090
android:id="@+id/legend_percentage"
9191
android:layout_width="wrap_content"
9292
android:layout_height="wrap_content"
93-
android:text="Percentage"
93+
android:text="Value"
9494
android:textColor="@color/material_yellow_600"
9595
android:visibility="gone" />
9696

9797
<TextView
9898
android:id="@+id/legend_percentage2"
9999
android:layout_width="wrap_content"
100100
android:layout_height="wrap_content"
101-
android:text="Percentage 2"
101+
android:text="Value 2"
102102
android:textColor="@color/material_orange_600"
103103
android:visibility="gone" />
104104

app/version.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Fri Jan 20 11:53:42 CET 2017
2-
VERSION_BUILD=2041
3-
VERSION_PATCH=357
4-
VERSION_CODE=174
1+
#Fri Jan 20 14:28:48 CET 2017
2+
VERSION_BUILD=2066
3+
VERSION_PATCH=358
4+
VERSION_CODE=175

domoticzapi/src/main/java/nl/hnogames/domoticzapi/Containers/GraphPointInfo.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public class GraphPointInfo {
3939
private float te = Float.NaN;
4040
private float ta = Float.NaN;
4141
private float tm = Float.NaN;
42-
boolean hasTemperatureRange = true;
42+
boolean hasTemperatureRange = false;
4343

4444
private String eu;
4545

@@ -51,7 +51,7 @@ public class GraphPointInfo {
5151

5252
private String vMin;
5353
private String vMax;
54-
boolean hasPercentageRange = true;
54+
boolean hasPercentageRange = false;
5555

5656
private String c;
5757
private String di;
@@ -137,10 +137,10 @@ public String toString() {
137137
'}';
138138
}
139139

140-
public String getPercentage() {
140+
public String getValue() {
141141
return v;
142142
}
143-
public String getSecondPercentage() {
143+
public String getSecondValue() {
144144
return v2;
145145
}
146146

@@ -155,13 +155,13 @@ public String getPowerUsage() {
155155
return eu;
156156
}
157157

158-
public String getPercentageMin() {
158+
public String getValueMin() {
159159
return vMin;
160160
}
161-
public String getPercentageMax() {
161+
public String getValueMax() {
162162
return vMax;
163163
}
164-
public boolean hasPercentageRange() {
164+
public boolean hasValueRange() {
165165
return hasPercentageRange;
166166
}
167167

domoticzapi/src/main/java/nl/hnogames/domoticzapi/Domoticz.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,6 @@ public class Domoticz {
116116
public static final int DOMOTICZ_FAKE_ID = 99999;
117117
public static final String HIDDEN_CHARACTER = "$";
118118

119-
public static final String UTILITIES_TYPE_THERMOSTAT = "Thermostat";
120-
public static final String UTILITIES_TYPE_HEATING = "Heating";
121-
public static final String UTILITIES_SUBTYPE_TEXT = "Text";
122119
public static final String DOMOTICZ_DEFAULT_SERVER = "DEFAULT";
123120
private static final String TAG = "DomoticzAPI";
124121

domoticzapi/src/main/java/nl/hnogames/domoticzapi/DomoticzValues.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,26 @@ interface Action {
8686
}
8787
}
8888

89+
interface Utility {
90+
interface Type {
91+
String HEATING = "Heating";
92+
String THERMOSTAT = "Thermostat";
93+
}
94+
95+
interface SubType {
96+
String TEXT = "Text";
97+
98+
String PERCENTAGE = "Percentage";
99+
String ENERGY = "Energy";
100+
String KWH = "kWh";
101+
String GAS = "Gas";
102+
String ELECTRIC = "Electric";
103+
String VOLTCRAFT = "Voltcraft";
104+
String SETPOINT = "SetPoint";
105+
String YOULESS = "YouLess";
106+
}
107+
}
108+
89109
interface Blind {
90110
interface State {
91111
String CLOSED = "Closed";

domoticzapi/version.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Fri Jan 20 11:53:42 CET 2017
2-
VERSION_BUILD=1511
3-
VERSION_PATCH=46
4-
VERSION_CODE=46
1+
#Fri Jan 20 14:28:49 CET 2017
2+
VERSION_BUILD=1536
3+
VERSION_PATCH=47
4+
VERSION_CODE=47

0 commit comments

Comments
 (0)