version 0.3.8

This commit is contained in:
Yegor Vialov 2018-11-06 21:12:24 +02:00
parent efd06ca547
commit 0e3474bbcb
5 changed files with 6 additions and 11 deletions

View File

@ -39,7 +39,6 @@ class _CoverControlWidgetState extends State<CoverControlWidget> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final entityModel = EntityModel.of(context); final entityModel = EntityModel.of(context);
final CoverEntity entity = entityModel.entity; final CoverEntity entity = entityModel.entity;
TheLogger.debug("${entity.state}");
if (_changedHere) { if (_changedHere) {
_changedHere = false; _changedHere = false;
} else { } else {

View File

@ -91,18 +91,15 @@ class _EntityHistoryWidgetState extends State<EntityHistoryWidget> {
} }
Widget _selectChartWidget() { Widget _selectChartWidget() {
TheLogger.debug(" selecting history widget (${widget.config.chartType})");
switch (widget.config.chartType) { switch (widget.config.chartType) {
case EntityHistoryWidgetType.simple: { case EntityHistoryWidgetType.simple: {
TheLogger.debug(" Simple selected");
return SimpleStateHistoryChartWidget( return SimpleStateHistoryChartWidget(
rawHistory: _history, rawHistory: _history,
); );
} }
case EntityHistoryWidgetType.numericState: { case EntityHistoryWidgetType.numericState: {
TheLogger.debug(" EntityHistory selected");
return NumericStateHistoryChartWidget( return NumericStateHistoryChartWidget(
rawHistory: _history, rawHistory: _history,
config: widget.config, config: widget.config,
@ -110,7 +107,6 @@ class _EntityHistoryWidgetState extends State<EntityHistoryWidget> {
} }
case EntityHistoryWidgetType.numericAttributes: { case EntityHistoryWidgetType.numericAttributes: {
TheLogger.debug(" NumericAttributes selected");
return CombinedHistoryChartWidget( return CombinedHistoryChartWidget(
rawHistory: _history, rawHistory: _history,
config: widget.config, config: widget.config,

View File

@ -220,7 +220,7 @@ class HomeAssistant {
} else if (data["type"] == "auth_invalid") { } else if (data["type"] == "auth_invalid") {
_completeConnecting({"errorCode": 6, "errorMessage": "${data["message"]}"}); _completeConnecting({"errorCode": 6, "errorMessage": "${data["message"]}"});
} else if (data["type"] == "result") { } else if (data["type"] == "result") {
TheLogger.debug("[Received] => id:${data["id"]}, ${data['success'] ? 'success' : 'error'}"); TheLogger.debug("[Received] <== id:${data["id"]}, ${data['success'] ? 'success' : 'error'}");
if (data["id"] == _configMessageId) { if (data["id"] == _configMessageId) {
_parseConfig(data); _parseConfig(data);
} else if (data["id"] == _statesMessageId) { } else if (data["id"] == _statesMessageId) {
@ -234,7 +234,7 @@ class HomeAssistant {
} }
} else if (data["type"] == "event") { } else if (data["type"] == "event") {
if ((data["event"] != null) && (data["event"]["event_type"] == "state_changed")) { if ((data["event"] != null) && (data["event"]["event_type"] == "state_changed")) {
//TheLogger.debug("[Received] => ${data['type']}.${data["event"]["event_type"]}: ${data["event"]["data"]["entity_id"]}"); //TheLogger.debug("[Received] <== ${data['type']}.${data["event"]["event_type"]}: ${data["event"]["data"]["entity_id"]}");
_handleEntityStateChange(data["event"]["data"]); _handleEntityStateChange(data["event"]["data"]);
} else if (data["event"] != null) { } else if (data["event"] != null) {
TheLogger.warning("Unhandled event type: ${data["event"]["event_type"]}"); TheLogger.warning("Unhandled event type: ${data["event"]["event_type"]}");
@ -487,7 +487,7 @@ class HomeAssistant {
//String endTime = formatDate(now, [yyyy, '-', mm, '-', dd, 'T', HH, ':', nn, ':', ss, z]); //String endTime = formatDate(now, [yyyy, '-', mm, '-', dd, 'T', HH, ':', nn, ':', ss, z]);
String startTime = formatDate(now.subtract(Duration(hours: 24)), [yyyy, '-', mm, '-', dd, 'T', HH, ':', nn, ':', ss, z]); String startTime = formatDate(now.subtract(Duration(hours: 24)), [yyyy, '-', mm, '-', dd, 'T', HH, ':', nn, ':', ss, z]);
String url = "$homeAssistantWebHost/api/history/period/$startTime?&filter_entity_id=$entityId"; String url = "$homeAssistantWebHost/api/history/period/$startTime?&filter_entity_id=$entityId";
TheLogger.debug( "$url"); TheLogger.debug("[Sending] ==> $url");
http.Response historyResponse; http.Response historyResponse;
if (_authType == "access_token") { if (_authType == "access_token") {
historyResponse = await http.get(url, headers: { historyResponse = await http.get(url, headers: {
@ -502,7 +502,7 @@ class HomeAssistant {
} }
var history = json.decode(historyResponse.body); var history = json.decode(historyResponse.body);
if (history is List) { if (history is List) {
TheLogger.debug( "Got ${history.first.length} history recors"); TheLogger.debug( "[Received] <== ${history.first.length} history recors");
return history; return history;
} else { } else {
return []; return [];

View File

@ -75,7 +75,7 @@ part 'ui_widgets/card_header_widget.dart';
EventBus eventBus = new EventBus(); EventBus eventBus = new EventBus();
const String appName = "HA Client"; const String appName = "HA Client";
const appVersion = "0.3.7"; const appVersion = "0.3.8";
String homeAssistantWebHost; String homeAssistantWebHost;

View File

@ -1,7 +1,7 @@
name: hass_client name: hass_client
description: Home Assistant Android Client description: Home Assistant Android Client
version: 0.3.7+59 version: 0.3.8+60
environment: environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0" sdk: ">=2.0.0-dev.68.0 <3.0.0"