WIP #120 History chart based on attributes
This commit is contained in:
@ -4,6 +4,13 @@ class ClimateEntity extends Entity {
|
||||
@override
|
||||
double widgetHeight = 38.0;
|
||||
|
||||
@override
|
||||
EntityHistoryConfig historyConfig = EntityHistoryConfig(
|
||||
chartType: EntityHistoryWidgetType.numericAttributes,
|
||||
numericState: false,
|
||||
numericAttributesToShow: ["temperature", "current_temperature"]
|
||||
);
|
||||
|
||||
static const SUPPORT_TARGET_TEMPERATURE = 1;
|
||||
static const SUPPORT_TARGET_TEMPERATURE_HIGH = 2;
|
||||
static const SUPPORT_TARGET_TEMPERATURE_LOW = 4;
|
||||
|
@ -38,7 +38,9 @@ class Entity {
|
||||
|
||||
List<Entity> childEntities = [];
|
||||
List<String> attributesToShow = ["all"];
|
||||
int historyWidgetType = EntityHistoryWidgetType.simple;
|
||||
EntityHistoryConfig historyConfig = EntityHistoryConfig(
|
||||
chartType: EntityHistoryWidgetType.simple
|
||||
);
|
||||
|
||||
String get displayName =>
|
||||
attributes["friendly_name"] ?? (attributes["name"] ?? "_");
|
||||
@ -136,7 +138,7 @@ class Entity {
|
||||
|
||||
Widget buildHistoryWidget() {
|
||||
return EntityHistoryWidget(
|
||||
type: historyWidgetType,
|
||||
config: historyConfig,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,10 @@ class SunEntity extends Entity {
|
||||
class SensorEntity extends Entity {
|
||||
|
||||
@override
|
||||
int historyWidgetType = EntityHistoryWidgetType.valueToTime;
|
||||
EntityHistoryConfig historyConfig = EntityHistoryConfig(
|
||||
chartType: EntityHistoryWidgetType.numericState,
|
||||
numericState: true
|
||||
);
|
||||
|
||||
SensorEntity(Map rawData) : super(rawData);
|
||||
|
||||
|
Reference in New Issue
Block a user