Fix type cast error in location util
This commit is contained in:
parent
819dfc725d
commit
e5fe853f0b
@ -38,7 +38,7 @@ class LocationUtils {
|
|||||||
static final long MIN_WORKER_LOCATION_UPDATE_INTERVAL_MS = 900000; //15 minutes
|
static final long MIN_WORKER_LOCATION_UPDATE_INTERVAL_MS = 900000; //15 minutes
|
||||||
|
|
||||||
static int getLocationUpdatesState(Context context) {
|
static int getLocationUpdatesState(Context context) {
|
||||||
return context.getSharedPreferences("FlutterSharedPreferences", Context.MODE_PRIVATE).getInt(KEY_REQUESTING_LOCATION_UPDATES, LOCATION_UPDATES_DISABLED);
|
return (int) context.getSharedPreferences("FlutterSharedPreferences", Context.MODE_PRIVATE).getInt(KEY_REQUESTING_LOCATION_UPDATES, LOCATION_UPDATES_DISABLED);
|
||||||
}
|
}
|
||||||
|
|
||||||
static long getLocationUpdateIntervals(Context context) {
|
static long getLocationUpdateIntervals(Context context) {
|
||||||
|
@ -97,10 +97,13 @@ class _IntegrationSettingsPageState extends State<IntegrationSettingsPage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_switchLocationTrackingState(bool state) async {
|
_switchLocationTrackingState(bool state) async {
|
||||||
await AppSettings().save({'location-updates-interval': _locationInterval.inSeconds, 'location-updates-priority': _accuracy, 'location-updates-show-notification': _showNotification});
|
|
||||||
if (state) {
|
if (state) {
|
||||||
try {
|
try {
|
||||||
await platform.invokeMethod('startLocationService');
|
await platform.invokeMethod('startLocationService', <String, dynamic>{
|
||||||
|
'location-updates-interval': _locationInterval.inSeconds,
|
||||||
|
'location-updates-priority': _accuracy,
|
||||||
|
'location-updates-show-notification': _showNotification
|
||||||
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
_locationTrackingEnabled = false;
|
_locationTrackingEnabled = false;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
name: hass_client
|
name: hass_client
|
||||||
description: Home Assistant Android Client
|
description: Home Assistant Android Client
|
||||||
|
|
||||||
version: 1.3.0+1302
|
version: 1.3.0+1303
|
||||||
|
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
|
Reference in New Issue
Block a user