Skip to content

Commit

Permalink
Fix log for Alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
galadril committed Jan 4, 2018
1 parent 5bd417f commit 5d5b755
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public void onBindViewHolder(final DataObjectHolder holder, final int position)
setButtons(holder, Buttons.THERMOSTAT);
CreateThermostatRow(holder, mUtilitiesInfo, setPoint);
} else {
if (DomoticzValues.Device.Utility.SubType.TEXT.equalsIgnoreCase(mUtilitiesInfo.getSubType())) {
if (DomoticzValues.Device.Utility.SubType.TEXT.equalsIgnoreCase(mUtilitiesInfo.getSubType()) || DomoticzValues.Device.Utility.SubType.ALERT.equalsIgnoreCase(mUtilitiesInfo.getSubType())) {
CreateTextRow(holder, mUtilitiesInfo);
setButtons(holder, Buttons.TEXT);
} else {
Expand Down Expand Up @@ -155,7 +155,6 @@ private void CreateTextRow(DataObjectHolder holder, UtilitiesInfo mUtilitiesInfo
holder.name.setText(mUtilitiesInfo.getName());
holder.data.setText(context.getString(R.string.data) + ": " + mUtilitiesInfo.getData());
holder.hardware.setText(context.getString(R.string.hardware) + ": " + mUtilitiesInfo.getHardwareName());

if (mUtilitiesInfo.getUsage() != null && mUtilitiesInfo.getUsage().length() > 0)
holder.data.setText(context.getString(R.string.usage) + ": " + mUtilitiesInfo.getUsage());

Expand All @@ -179,8 +178,7 @@ private void CreateTextRow(DataObjectHolder holder, UtilitiesInfo mUtilitiesInfo

if (mUtilitiesInfo.getCounterToday() != null && mUtilitiesInfo.getCounterToday().length() > 0)
holder.data.append(" " + context.getString(R.string.today) + ": " + mUtilitiesInfo.getCounterToday());
if (mUtilitiesInfo.getCounter() != null && mUtilitiesInfo.getCounter().length() > 0 &&
!mUtilitiesInfo.getCounter().equals(mUtilitiesInfo.getData()))
if (mUtilitiesInfo.getCounter() != null && mUtilitiesInfo.getCounter().length() > 0 && !mUtilitiesInfo.getCounter().equals(mUtilitiesInfo.getData()))
holder.data.append(" " + context.getString(R.string.total) + ": " + mUtilitiesInfo.getCounter());
if (mSharedPrefs.darkThemeEnabled()) {
holder.buttonLog.setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status));
Expand Down Expand Up @@ -380,9 +378,7 @@ public void onClick(View v) {
.replace("kWh", "counter")
.replace("Gas", "counter")
.replace("Energy", "counter")
.replace("BWR102", "counter")
.replace("Voltcraft", "counter")
.replace("Sound Level", "counter")
.replace("SetPoint", "temp")
.replace("YouLess counter", "counter").contains("counter"))
holder.weekButton.setVisibility(View.VISIBLE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ public void onLogClick(final UtilitiesInfo utility, final String range) {
.replace("Voltage", "counter")
.replace("SetPoint", "temp")
.replace("Lux", "counter")
.replace("BWR102", "counter")
.replace("Sound Level", "counter")
.replace("Pressure", "counter")
.replace("YouLess counter", "counter");

Expand Down
4 changes: 2 additions & 2 deletions app/version.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Thu Jan 04 10:41:42 CET 2018
VERSION_BUILD=3674
#Thu Jan 04 10:58:45 CET 2018
VERSION_BUILD=3676
VERSION_PATCH=419
VERSION_CODE=236
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ interface Type {

interface SubType {
String TEXT = "Text";
String ALERT = "Alert";
String PERCENTAGE = "Percentage";
String ENERGY = "Energy";
String KWH = "kWh";
Expand Down
4 changes: 2 additions & 2 deletions domoticzapi/version.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Thu Jan 04 10:41:42 CET 2018
VERSION_BUILD=3113
#Thu Jan 04 10:58:45 CET 2018
VERSION_BUILD=3115
VERSION_PATCH=106
VERSION_CODE=106

0 comments on commit 5d5b755

Please sign in to comment.