Entity state by device class

This commit is contained in:
Yegor Vialov
2018-12-15 14:37:00 +02:00
parent a59de4b6dc
commit b6ac9f985f
2 changed files with 52 additions and 1 deletions

View File

@ -12,7 +12,7 @@ class SimpleEntityState extends StatelessWidget {
@override
Widget build(BuildContext context) {
final entityModel = EntityModel.of(context);
String state = entityModel.entityWrapper.entity.state ?? "";
String state = entityModel.entityWrapper.entity.displayState ?? "";
state = state.replaceAll("\n", "").replaceAll("\t", " ").trim();
while (state.contains(" ")){
state = state.replaceAll(" ", " ");