From df04d000b2624f659d9ef5aadeeccd772a59ddc6 Mon Sep 17 00:00:00 2001 From: estevez Date: Sat, 29 Sep 2018 12:02:41 +0300 Subject: [PATCH] Fixes #94 Gropups state change event parsing --- lib/entity_collection.class.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/entity_collection.class.dart b/lib/entity_collection.class.dart index 0ea32dd..3c1ac66 100644 --- a/lib/entity_collection.class.dart +++ b/lib/entity_collection.class.dart @@ -28,9 +28,9 @@ class EntityCollection { void updateState(Map rawStateData) { if (isExist(rawStateData["entity_id"])) { - updateFromRaw(rawStateData["new_state"]); + updateFromRaw(rawStateData["new_state"] ?? rawStateData["old_state"]); } else { - addFromRaw(rawStateData["new_state"]); + addFromRaw(rawStateData["new_state"] ?? rawStateData["old_state"]); } }