From 66f84952f0e6042f863a12781c5d041af5d03c9d Mon Sep 17 00:00:00 2001 From: Yegor Vialov Date: Sun, 4 Nov 2018 22:25:22 +0200 Subject: [PATCH] Get entity name from entity id if was not set --- lib/entity_class/entity.class.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/entity_class/entity.class.dart b/lib/entity_class/entity.class.dart index e1badd4..309b70c 100644 --- a/lib/entity_class/entity.class.dart +++ b/lib/entity_class/entity.class.dart @@ -43,7 +43,7 @@ class Entity { ); String get displayName => - attributes["friendly_name"] ?? (attributes["name"] ?? "_"); + attributes["friendly_name"] ?? (attributes["name"] ?? entityId.split(".")[1].replaceAll("_", " ")); String get deviceClass => attributes["device_class"] ?? null; bool get isView =>