diff --git a/lib/entity_class/entity_wrapper.class.dart b/lib/entity_class/entity_wrapper.class.dart index 0f4ffc8..25bdecd 100644 --- a/lib/entity_class/entity_wrapper.class.dart +++ b/lib/entity_class/entity_wrapper.class.dart @@ -4,6 +4,7 @@ class EntityWrapper { String displayName; String icon; + String entityPicture; EntityUIAction uiAction; Entity entity; @@ -16,6 +17,9 @@ class EntityWrapper { }) { if (entity.statelessType == StatelessEntityType.NONE || entity.statelessType == StatelessEntityType.CALL_SERVICE || entity.statelessType == StatelessEntityType.WEBLINK) { this.icon = icon ?? entity.icon; + if (icon == null) { + entityPicture = entity.entityPicture; + } this.displayName = displayName ?? entity.displayName; if (uiAction == null) { uiAction = EntityUIAction(); diff --git a/lib/entity_widgets/entity_colors.class.dart b/lib/entity_widgets/entity_colors.class.dart index 83233b2..2a13dc7 100644 --- a/lib/entity_widgets/entity_colors.class.dart +++ b/lib/entity_widgets/entity_colors.class.dart @@ -2,6 +2,8 @@ part of '../main.dart'; class EntityColor { + static const defaultStateColor = Color.fromRGBO(68, 115, 158, 1.0); + static const badgeColors = { "default": Color.fromRGBO(223, 76, 30, 1.0), "binary_sensor": Color.fromRGBO(3, 155, 229, 1.0) @@ -15,11 +17,11 @@ class EntityColor { "above_horizon": Colors.amber, EntityState.home: Colors.amber, EntityState.open: Colors.amber, - EntityState.off: Color.fromRGBO(68, 115, 158, 1.0), - EntityState.closed: Color.fromRGBO(68, 115, 158, 1.0), - "below_horizon": Color.fromRGBO(68, 115, 158, 1.0), - "default": Color.fromRGBO(68, 115, 158, 1.0), - EntityState.idle: Color.fromRGBO(68, 115, 158, 1.0), + EntityState.off: defaultStateColor, + EntityState.closed: defaultStateColor, + "below_horizon": defaultStateColor, + "default": defaultStateColor, + EntityState.idle: defaultStateColor, "heat": Colors.redAccent, "cool": Colors.lightBlue, EntityState.unavailable: Colors.black26, diff --git a/lib/entity_widgets/entity_icon.dart b/lib/entity_widgets/entity_icon.dart index cb7d3e3..e6e99fe 100644 --- a/lib/entity_widgets/entity_icon.dart +++ b/lib/entity_widgets/entity_icon.dart @@ -27,7 +27,7 @@ class EntityIcon extends StatelessWidget { if (data == null) { return null; } - if (data.entity.entityPicture != null) { + if (data.entityPicture != null) { return Container( height: size+12, width: size+12, @@ -36,7 +36,7 @@ class EntityIcon extends StatelessWidget { image: DecorationImage( fit:BoxFit.cover, image: CachedNetworkImageProvider( - "${data.entity.entityPicture}" + "${data.entityPicture}" ), ) ),