Fix target temp history
This commit is contained in:
parent
f281fab744
commit
b2da9fc04d
@ -8,7 +8,7 @@ class ClimateEntity extends Entity {
|
||||
EntityHistoryConfig historyConfig = EntityHistoryConfig(
|
||||
chartType: EntityHistoryWidgetType.numericAttributes,
|
||||
numericState: false,
|
||||
numericAttributesToShow: ["temperature", "current_temperature"]
|
||||
numericAttributesToShow: ["current_temperature"]
|
||||
);
|
||||
|
||||
static const SUPPORT_TARGET_TEMPERATURE = 1;
|
||||
@ -91,6 +91,20 @@ class ClimateEntity extends Entity {
|
||||
|
||||
ClimateEntity(Map rawData) : super(rawData);
|
||||
|
||||
@override
|
||||
void update(Map rawData) {
|
||||
super.update(rawData);
|
||||
if (supportTargetTemperature) {
|
||||
historyConfig.numericAttributesToShow.add("temperature");
|
||||
}
|
||||
if (supportTargetTemperatureHigh) {
|
||||
historyConfig.numericAttributesToShow.add("target_temp_high");
|
||||
}
|
||||
if (supportTargetTemperatureLow) {
|
||||
historyConfig.numericAttributesToShow.add("target_temp_low");
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget _buildStatePart(BuildContext context) {
|
||||
return ClimateStateWidget();
|
||||
|
@ -14,7 +14,6 @@ import 'package:date_format/date_format.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:flutter_colorpicker/material_picker.dart';
|
||||
import 'package:charts_flutter/flutter.dart' as charts;
|
||||
import 'dart:math' as math;
|
||||
|
||||
part 'entity_class/entity.class.dart';
|
||||
part 'entity_class/switch_entity.class.dart';
|
||||
|
Reference in New Issue
Block a user