Compare commits

...

7 Commits
0.5.0 ... 0.5.3

Author SHA1 Message Date
277c67fc6f Add padding for links in About dialog 2019-04-04 21:54:41 +03:00
2a01ff8a03 Bump version in UI 2019-04-04 21:51:05 +03:00
b246b7bc1d 0.5.3 and new build numbers 2019-04-04 21:44:16 +03:00
e1868b9a14 Add privacy polici and terms and conditions links 2019-04-04 21:43:23 +03:00
125f3ac16c Resolves #327 Timer duration parsing error 2019-04-04 21:38:23 +03:00
be502b5668 Discord icon fix 2019-04-04 21:38:05 +03:00
6f33fdca9f New app icon 2019-04-04 21:37:41 +03:00
10 changed files with 67 additions and 18 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -9,22 +9,31 @@ class TimerEntity extends Entity {
void update(Map rawData) { void update(Map rawData) {
super.update(rawData); super.update(rawData);
String durationSource = "${attributes["duration"]}"; String durationSource = "${attributes["duration"]}";
List<String> durationList = durationSource.split(":"); if (durationSource != null && durationSource.isNotEmpty) {
if (durationList.length == 1) { try {
duration = Duration(seconds: int.tryParse(durationList[0] ?? 0)); List<String> durationList = durationSource.split(":");
} else if (durationList.length == 2) { if (durationList.length == 1) {
duration = Duration( duration = Duration(seconds: int.tryParse(durationList[0] ?? 0));
hours: int.tryParse(durationList[0]) ?? 0, } else if (durationList.length == 2) {
minutes: int.tryParse(durationList[1]) ?? 0 duration = Duration(
); hours: int.tryParse(durationList[0]) ?? 0,
} else if (durationList.length == 3) { minutes: int.tryParse(durationList[1]) ?? 0
duration = Duration( );
hours: int.tryParse(durationList[0]) ?? 0, } else if (durationList.length == 3) {
minutes: int.tryParse(durationList[1]) ?? 0, duration = Duration(
seconds: int.tryParse(durationList[2]) ?? 0 hours: int.tryParse(durationList[0]) ?? 0,
); minutes: int.tryParse(durationList[1]) ?? 0,
seconds: int.tryParse(durationList[2]) ?? 0
);
} else {
Logger.e("Strange $entityId duration format: $durationSource");
duration = Duration(seconds: 0);
}
} catch (e) {
Logger.e("Error parsing duration for $entityId: ${e.toString()}");
duration = Duration(seconds: 0);
}
} else { } else {
Logger.e("Cann't parse $entityId duration: $durationSource");
duration = Duration(seconds: 0); duration = Duration(seconds: 0);
} }
} }

View File

@ -100,7 +100,7 @@ part 'ui_widgets/config_panel_widget.dart';
EventBus eventBus = new EventBus(); EventBus eventBus = new EventBus();
const String appName = "HA Client"; const String appName = "HA Client";
const appVersion = "0.5.0"; const appVersion = "0.5.3";
String homeAssistantWebHost; String homeAssistantWebHost;
@ -392,6 +392,14 @@ class _MainPageState extends State<MainPage> with WidgetsBindingObserver, Ticker
}, },
), ),
Divider(), Divider(),
new ListTile(
leading: Icon(MaterialDesignIcons.getIconDataFromIconName("mdi:discord")),
title: Text("Join Discord server"),
onTap: () {
Navigator.of(context).pop();
HAUtils.launchURL("https://discord.gg/AUzEvwn");
},
),
new AboutListTile( new AboutListTile(
aboutBoxChildren: <Widget>[ aboutBoxChildren: <Widget>[
GestureDetector( GestureDetector(
@ -406,6 +414,38 @@ class _MainPageState extends State<MainPage> with WidgetsBindingObserver, Ticker
decoration: TextDecoration.underline decoration: TextDecoration.underline
), ),
), ),
),
Container(
height: 10.0,
),
GestureDetector(
onTap: () {
Navigator.of(context).pop();
HAUtils.launchURLInCustomTab(context, "http://ha-client.homemade.systems/terms_and_conditions");
},
child: Text(
"Terms and Conditions",
style: TextStyle(
color: Colors.blue,
decoration: TextDecoration.underline
),
),
),
Container(
height: 10.0,
),
GestureDetector(
onTap: () {
Navigator.of(context).pop();
HAUtils.launchURLInCustomTab(context, "http://ha-client.homemade.systems/privacy_policy");
},
child: Text(
"Privacy Policy",
style: TextStyle(
color: Colors.blue,
decoration: TextDecoration.underline
),
),
) )
], ],
applicationName: appName, applicationName: appName,

View File

@ -1,7 +1,7 @@
name: hass_client name: hass_client
description: Home Assistant Android Client description: Home Assistant Android Client
version: 0.5.0+97 version: 0.5.3+530
environment: environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0" sdk: ">=2.0.0-dev.68.0 <3.0.0"