Fixes #94 Gropups state change event parsing

This commit is contained in:
estevez 2018-09-29 12:02:41 +03:00
parent d0d1ab2740
commit df04d000b2

View File

@ -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"]);
}
}