Skip to content

Commit d00f684

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/beta-development'
2 parents 9088969 + c5dd82d commit d00f684

19 files changed

+79
-54
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,19 @@ This is a Android client for Domoticz and is available for download in the Play
55
-----
66
**Domoticz** is a very light weight home automation system that lets you monitor and configure various devices like: lights, switches, various sensors/meters like temperature, rainfall, wind, Ultraviolet (UV) radiation, electricity usage/production, gas consumption, water consumption and much more. Notifications/alerts can be sent to any mobile device.
77

8+
For Beta registration or more information check:
9+
http://hnogames.nl/domoticz.html
10+
811

912
# Google Play Store
1013
-----
1114
You can download Domoticz from the Google Play Store. There is a premium and free version! Premium features are Geofencing, Android Wear and Widgets.
1215

1316
**Free:**
14-
[![google-play-badge](https://cloud.githubusercontent.com/assets/14561640/11994769/a4f0bd22-aa44-11e5-9151-b09c19971c7c.png)](https://play.google.com/store/apps/details?id=nl.hnogames.domoticz)
17+
[![google-play-badge](https://cloud.githubusercontent.com/assets/14561640/22199304/96017fa6-e15a-11e6-99bd-6fd3412eac8e.png)](https://play.google.com/store/apps/details?id=nl.hnogames.domoticz)
1518

1619
**Premium:**
17-
[![google-play-badge](https://cloud.githubusercontent.com/assets/14561640/11994769/a4f0bd22-aa44-11e5-9151-b09c19971c7c.png)](https://play.google.com/store/apps/details?id=nl.hnogames.domoticz.premium)
20+
[![google-play-badge](https://cloud.githubusercontent.com/assets/14561640/22199304/96017fa6-e15a-11e6-99bd-6fd3412eac8e.png)](https://play.google.com/store/apps/details?id=nl.hnogames.domoticz.premium)
1821

1922
# Geofencing
2023
-----

app/src/debug/AndroidManifest.xml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,12 @@
7070
android:label="@string/app_name_domoticz"
7171
android:theme="@style/AppThemeMain"
7272
tools:replace="android:icon, android:label, android:theme, android:name" >
73+
7374
<activity android:name=".Service.NFCServiceActivity" >
7475
<intent-filter>
76+
<action android:name="android.intent.action.VIEW" />
77+
<category android:name="android.intent.category.DEFAULT" />
78+
<category android:name="android.intent.category.BROWSABLE" />
7579
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
7680
<category android:name="android.intent.category.DEFAULT" />
7781
<data
@@ -216,10 +220,12 @@
216220
</receiver>
217221

218222
<service android:name=".Widgets.SecurityWidgetProvider$UpdateSecurityWidgetService" />
219-
223+
220224
<receiver android:name=".Service.BootUpReceiver" >
221225
<intent-filter>
222226
<action android:name="android.intent.action.BOOT_COMPLETED" />
227+
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
228+
<category android:name="android.intent.category.LAUNCHER" />
223229
</intent-filter>
224230
</receiver>
225231

@@ -240,10 +246,13 @@
240246
<action android:name="android.intent.action.VIEW" />
241247
<category android:name="android.intent.category.DEFAULT" />
242248
<category android:name="android.intent.category.BROWSABLE" />
243-
<!-- Accepts URIs that begin with "http://www.domoticz.com/open” -->
249+
<!-- Accepts URIs that begin with "http://www.domoticz.com/open” or https -->
244250
<data android:scheme="http"
245251
android:host="www.domoticz.com"
246252
android:pathPrefix="/open" />
253+
<data android:scheme="https"
254+
android:host="www.domoticz.com"
255+
android:pathPrefix="/open" />
247256
<!-- note that the leading "/" is required for pathPrefix-->
248257
<!-- Accepts URIs that begin with "domoticz://open” -->
249258
<data android:scheme="domoticz"

app/src/main/AndroidManifest.xml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,12 @@
7070
android:label="@string/app_name_domoticz"
7171
android:theme="@style/AppThemeMain"
7272
tools:replace="android:icon, android:label, android:theme, android:name" >
73+
7374
<activity android:name=".Service.NFCServiceActivity" >
7475
<intent-filter>
76+
<action android:name="android.intent.action.VIEW" />
77+
<category android:name="android.intent.category.DEFAULT" />
78+
<category android:name="android.intent.category.BROWSABLE" />
7579
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
7680
<category android:name="android.intent.category.DEFAULT" />
7781
<data
@@ -220,6 +224,8 @@
220224
<receiver android:name=".Service.BootUpReceiver" >
221225
<intent-filter>
222226
<action android:name="android.intent.action.BOOT_COMPLETED" />
227+
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
228+
<category android:name="android.intent.category.LAUNCHER" />
223229
</intent-filter>
224230
</receiver>
225231

@@ -240,10 +246,13 @@
240246
<action android:name="android.intent.action.VIEW" />
241247
<category android:name="android.intent.category.DEFAULT" />
242248
<category android:name="android.intent.category.BROWSABLE" />
243-
<!-- Accepts URIs that begin with "http://www.domoticz.com/open” -->
249+
<!-- Accepts URIs that begin with "http://www.domoticz.com/open” or https -->
244250
<data android:scheme="http"
245251
android:host="www.domoticz.com"
246252
android:pathPrefix="/open" />
253+
<data android:scheme="https"
254+
android:host="www.domoticz.com"
255+
android:pathPrefix="/open" />
247256
<!-- note that the leading "/" is required for pathPrefix-->
248257
<!-- Accepts URIs that begin with "domoticz://open” -->
249258
<data android:scheme="domoticz"
@@ -386,4 +395,4 @@
386395
</activity>
387396
</application>
388397

389-
</manifest>
398+
</manifest>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,7 @@ public void onError(Exception error) {
941941
if (getActivity() instanceof MainActivity)
942942
((MainActivity) getActivity()).Talk(R.string.security_wrong_code);
943943
} //else
944-
// errorHandling(error, coordinatorLayout);
944+
// errorHandling(error, coordinatorLayout);
945945
}
946946
});
947947
}

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,7 @@ public View onCreateView(LayoutInflater inflater,
159159
chart.setDrawGridBackground(false);
160160
chart.setHighlightPerDragEnabled(true);
161161

162-
if(range.equals("day"))
163-
{
162+
if (range.equals("day")) {
164163
xAxis.setValueFormatter(new IAxisValueFormatter() {
165164
@Override
166165
public String getFormattedValue(float value, AxisBase axis) {
@@ -169,8 +168,7 @@ public String getFormattedValue(float value, AxisBase axis) {
169168
return String.format("%02d", calendar.get(Calendar.HOUR)) + ":" + String.format("%02d", calendar.get(Calendar.MINUTE));
170169
}
171170
});
172-
}
173-
else {
171+
} else {
174172
xAxis.setValueFormatter(new IAxisValueFormatter() {
175173
@Override
176174
public String getFormattedValue(float value, AxisBase axis) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ public void onError(Exception error) {
843843
if (getActivity() instanceof MainActivity)
844844
((MainActivity) getActivity()).Talk(R.string.security_wrong_code);
845845
} //else
846-
// errorHandling(error);
846+
// errorHandling(error);
847847
}
848848
});
849849
}

app/src/main/java/nl/hnogames/domoticz/GeoSettingsActivity.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ protected void onCreate(Bundle savedInstanceState) {
120120
if (mSharedPrefs.darkThemeEnabled()) {
121121
coordinatorLayout.setBackgroundColor(ContextCompat.getColor(this, R.color.background_dark));
122122
}
123+
123124
createListView();
124125
initSwitches();
125126
createLocationRequest();

app/src/main/java/nl/hnogames/domoticz/MainActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ public void onReceiveDevice(DevicesInfo mDevicesInfo) {
373373
int jsonUrl = DomoticzValues.Json.Url.Set.SWITCHES;
374374
int jsonValue = 0;
375375

376-
if(mDevicesInfo == null)
376+
if (mDevicesInfo == null)
377377
return;
378378

379379
if (inputJSONAction < 0) {

app/src/main/java/nl/hnogames/domoticz/Service/BootUpReceiver.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,29 @@
2424
import android.content.BroadcastReceiver;
2525
import android.content.Context;
2626
import android.content.Intent;
27+
import android.support.design.widget.Snackbar;
28+
import android.util.Log;
2729

30+
import nl.hnogames.domoticz.R;
2831
import nl.hnogames.domoticz.Utils.SharedPrefUtil;
32+
import nl.hnogames.domoticz.Utils.UsefulBits;
2933
import nl.hnogames.domoticz.Utils.WidgetUtils;
3034

3135
public class BootUpReceiver extends BroadcastReceiver {
3236
@Override
3337
public void onReceive(Context context, Intent intent) {
34-
SharedPrefUtil mSharedPrefUtil = new SharedPrefUtil(context);
35-
38+
if(context == null)
39+
return;
3640
WidgetUtils.RefreshWidgets(context);
41+
startGeofenceService(context);
42+
}
43+
44+
private void startGeofenceService(Context context) {
45+
SharedPrefUtil mSharedPrefUtil = new SharedPrefUtil(context);
3746

3847
if (mSharedPrefUtil.isGeofenceEnabled()) {
3948
mSharedPrefUtil.enableGeoFenceService();
40-
mSharedPrefUtil.setGeofencingStarted(true);
49+
Log.i("BOOT", "Bootup received, starting geofences");
4150
}
4251
}
4352
}

app/src/main/java/nl/hnogames/domoticz/UI/SecurityPanelDialog.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,11 @@ public SecurityPanelDialog(Context c, Domoticz mDomoticz, DevicesInfo panelInfo)
8686
.buttonRippleColorRes(R.color.white);
8787
} else
8888
mdb = new MaterialDialog.Builder(mContext);
89+
8990
mdb.customView(R.layout.dialog_security, true)
9091
.theme(mSharedPrefs.darkThemeEnabled() ? Theme.DARK : Theme.LIGHT)
9192
.negativeText(android.R.string.cancel);
93+
9294
mdb.dismissListener(this);
9395
}
9496

app/src/main/java/nl/hnogames/domoticz/Widgets/SecurityWidgetProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ protected void onHandleIntent(Intent intent) {
104104
try {
105105
updateAppWidget(appWidgetManager, incomingAppWidgetId);
106106
} catch (NullPointerException e) {
107-
if(e != null && !UsefulBits.isEmpty(e.getMessage()))
107+
if (e != null && !UsefulBits.isEmpty(e.getMessage()))
108108
Log.e(SecurityWidgetProvider.class.getSimpleName(), e.getMessage());
109109
}
110110
}

app/src/main/java/nl/hnogames/domoticz/Widgets/SmallWidgetConfigurationActivity.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,8 @@ public void initListViews() {
130130
@Override
131131
public void onReceiveDevices(final ArrayList<DevicesInfo> mDevicesInfo) {
132132
ArrayList<DevicesInfo> mNewDevicesInfo = new ArrayList<DevicesInfo>();
133-
for (DevicesInfo d : mDevicesInfo)
134-
{
135-
if(SmallWidgetSupported(d))
133+
for (DevicesInfo d : mDevicesInfo) {
134+
if (SmallWidgetSupported(d))
136135
mNewDevicesInfo.add(d);
137136
}
138137

app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetConfigurationActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ private int withButtons(DevicesInfo s) {
377377

378378
case DomoticzValues.Device.Type.Value.BLINDS:
379379
case DomoticzValues.Device.Type.Value.BLINDINVERTED:
380-
if(DomoticzValues.canHandleStopButton(s))
380+
if (DomoticzValues.canHandleStopButton(s))
381381
withButton = BUTTON_BLINDS;
382382
else
383383
withButton = BUTTON_ONOFF;

app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetIntentReceiver.java

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
package nl.hnogames.domoticz.Widgets;
2323

24-
import android.appwidget.AppWidgetManager;
2524
import android.content.BroadcastReceiver;
2625
import android.content.Context;
2726
import android.content.Intent;
@@ -75,8 +74,7 @@ public void onReceive(final Context context, Intent intent) {
7574
iStart.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
7675
iStart.putExtra("QRCODE", true);
7776
context.startActivity(iStart);
78-
}
79-
else {
77+
} else {
8078
loadPasswordandValue();
8179

8280
if (intent.getAction().equals("nl.hnogames.domoticz.Service.WIDGET_TOGGLE_ACTION")) {
@@ -98,7 +96,7 @@ public void onReceive(final Context context, Intent intent) {
9896
private boolean isOnOffSwitch(DevicesInfo mExtendedStatusInfo) {
9997
if (mExtendedStatusInfo == null)
10098
return false;
101-
if(smallWidget)
99+
if (smallWidget)
102100
return true;
103101

104102
if (mExtendedStatusInfo.getSwitchTypeVal() == 0 &&
@@ -121,7 +119,7 @@ private boolean isOnOffSwitch(DevicesInfo mExtendedStatusInfo) {
121119
return true;
122120
case DomoticzValues.Device.Type.Value.BLINDS:
123121
case DomoticzValues.Device.Type.Value.BLINDINVERTED:
124-
if(DomoticzValues.canHandleStopButton(mExtendedStatusInfo))
122+
if (DomoticzValues.canHandleStopButton(mExtendedStatusInfo))
125123
return false;
126124
else
127125
return true;
@@ -164,12 +162,10 @@ private boolean isPushOffSwitch(DevicesInfo mExtendedStatusInfo) {
164162
return false;
165163
}
166164

167-
private void loadPasswordandValue()
168-
{
165+
private void loadPasswordandValue() {
169166
password = mSharedPrefs.getWidgetPassword(widgetID);
170167
value = mSharedPrefs.getWidgetValue(widgetID);
171-
if(UsefulBits.isEmpty(value) && UsefulBits.isEmpty(password))
172-
{
168+
if (UsefulBits.isEmpty(value) && UsefulBits.isEmpty(password)) {
173169
password = mSharedPrefs.getSmallWidgetPassword(widgetID);
174170
value = mSharedPrefs.getSmallWidgetValue(widgetID);
175171
}
@@ -179,7 +175,7 @@ private void processSwitch(final Context context, int idx) {
179175

180176
final Domoticz domoticz = new Domoticz(context, AppController.getInstance().getRequestQueue());
181177
boolean isScene = mSharedPrefs.getWidgetisScene(widgetID);
182-
if(smallWidget)
178+
if (smallWidget)
183179
isScene = mSharedPrefs.getSmallWidgetisScene(widgetID);
184180
Log.i("PROCESS SWITCH", "Device: " + idx + " " + isScene);
185181

@@ -225,7 +221,7 @@ public void onError(Exception error) {
225221

226222
@Override
227223
public void onReceiveScene(final SceneInfo scene) {
228-
Log.i("SCENE TOGGLE", "Device: " + scene.getName() );
224+
Log.i("SCENE TOGGLE", "Device: " + scene.getName());
229225

230226
if (scene != null) {
231227
if (DomoticzValues.Scene.Type.SCENE.equalsIgnoreCase(scene.getType())) {

app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetProviderLarge.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ protected void onHandleIntent(Intent intent) {
102102
try {
103103
updateAppWidget(appWidgetManager, incomingAppWidgetId);
104104
} catch (NullPointerException e) {
105-
if(e != null && !UsefulBits.isEmpty(e.getMessage()))
105+
if (e != null && !UsefulBits.isEmpty(e.getMessage()))
106106
Log.e(WidgetProviderLarge.class.getSimpleName(), e.getMessage());
107107
}
108108
}
@@ -174,7 +174,7 @@ public void onReceiveDevice(DevicesInfo s) {
174174

175175
views.setTextViewText(R.id.desc, text);
176176
if (withButtons == BUTTON_1 && s.getStatus() != null) {
177-
if(s.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.PUSH_ON_BUTTON)
177+
if (s.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.PUSH_ON_BUTTON)
178178
views.setTextViewText(R.id.on_button, context.getString(R.string.button_state_on));
179179
else if (s.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.PUSH_OFF_BUTTON)
180180
views.setTextViewText(R.id.on_button, context.getString(R.string.button_state_off));
@@ -395,7 +395,7 @@ private int withButtons(DevicesInfo s) {
395395

396396
case DomoticzValues.Device.Type.Value.BLINDS:
397397
case DomoticzValues.Device.Type.Value.BLINDINVERTED:
398-
if(DomoticzValues.canHandleStopButton(s))
398+
if (DomoticzValues.canHandleStopButton(s))
399399
withButton = BUTTON_3;
400400
else
401401
withButton = BUTTON_2;

app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetProviderSmall.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import android.content.Context;
2929
import android.content.Intent;
3030
import android.util.Log;
31-
import android.view.View;
3231
import android.widget.RemoteViews;
3332

3433
import java.util.ArrayList;
@@ -85,6 +84,7 @@ public void onUpdate(Context context, AppWidgetManager appWidgetManager,
8584
public static class UpdateWidgetService extends IntentService {
8685
private static final int WITHBUTTON = 1;
8786
private RemoteViews views;
87+
8888
public UpdateWidgetService() {
8989
super("UpdateWidgetService");
9090
}
@@ -100,7 +100,7 @@ protected void onHandleIntent(Intent intent) {
100100
try {
101101
updateAppWidget(appWidgetManager, incomingAppWidgetId);
102102
} catch (NullPointerException e) {
103-
if(e != null && !UsefulBits.isEmpty(e.getMessage()))
103+
if (e != null && !UsefulBits.isEmpty(e.getMessage()))
104104
Log.e(WidgetProviderSmall.class.getSimpleName(), e.getMessage());
105105
}
106106
}
@@ -210,14 +210,14 @@ public void onReceiveScene(SceneInfo s) {
210210
return;
211211

212212
if (s.getStatusInString() != null) {
213-
views.setTextViewText(R.id.title, s.getName());
214-
views.setTextViewText(R.id.desc, s.getStatusInString());
215-
views.setOnClickPendingIntent(R.id.rowIcon, buildButtonPendingIntent(
216-
UpdateWidgetService.this,
217-
appWidgetId,
218-
idx,
219-
!s.getStatusInBoolean(),
220-
true));
213+
views.setTextViewText(R.id.title, s.getName());
214+
views.setTextViewText(R.id.desc, s.getStatusInString());
215+
views.setOnClickPendingIntent(R.id.rowIcon, buildButtonPendingIntent(
216+
UpdateWidgetService.this,
217+
appWidgetId,
218+
idx,
219+
!s.getStatusInBoolean(),
220+
true));
221221
}
222222

223223
views.setImageViewResource(R.id.rowIcon, DomoticzIcons.getDrawableIcon(s.getType(), null, null, false, false, null));

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
xmlns:app="http://schemas.android.com/apk/res-auto"
2525
android:layout_width="match_parent"
2626
android:layout_height="match_parent"
27-
android:background="@drawable/appwidget_bg_clickable"
2827
android:orientation="vertical">
2928

3029
<RelativeLayout

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 14:28:48 CET 2017
2-
VERSION_BUILD=2066
3-
VERSION_PATCH=358
4-
VERSION_CODE=175
1+
#Mon Jan 23 16:33:15 CET 2017
2+
VERSION_BUILD=2104
3+
VERSION_PATCH=360
4+
VERSION_CODE=177

0 commit comments

Comments
 (0)