forked from platypush/platypush
Do not overwrite an entity's state from an event if the state was not sampled
This commit is contained in:
parent
a9751f21f1
commit
8e2154f2b5
1 changed files with 2 additions and 0 deletions
|
@ -238,6 +238,8 @@ export default {
|
||||||
|
|
||||||
this.clearEntityTimeouts(entityId)
|
this.clearEntityTimeouts(entityId)
|
||||||
const entity = {...event.entity}
|
const entity = {...event.entity}
|
||||||
|
if (event.entity?.state == null)
|
||||||
|
entity.state = this.entities[entityId]?.state
|
||||||
if (entity.meta?.name_override?.length)
|
if (entity.meta?.name_override?.length)
|
||||||
entity.name = entity.meta.name_override
|
entity.name = entity.meta.name_override
|
||||||
else if (this.entities[entityId]?.meta?.name_override?.length)
|
else if (this.entities[entityId]?.meta?.name_override?.length)
|
||||||
|
|
Loading…
Reference in a new issue