forked from platypush/platypush
[Entities UI] Better refresh logic.
This commit is contained in:
parent
6673bb4c19
commit
171ed7f743
2 changed files with 4 additions and 9 deletions
|
@ -426,14 +426,9 @@ export default {
|
||||||
'platypush.message.event.entities.EntityDeleteEvent'
|
'platypush.message.event.entities.EntityDeleteEvent'
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!this.loadCachedEntities()) {
|
const hasCachedEntities = this.loadCachedEntities()
|
||||||
await this.sync()
|
await this.sync(!hasCachedEntities)
|
||||||
this.refresh()
|
await this.refresh()
|
||||||
} else {
|
|
||||||
await this.request('entities.scan')
|
|
||||||
this.sync()
|
|
||||||
}
|
|
||||||
|
|
||||||
setInterval(() => this.refreshEntitiesCache(), 10000)
|
setInterval(() => this.refreshEntitiesCache(), 10000)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -278,7 +278,7 @@ class AssistantPlugin(Plugin, AssistantEntityManager, ABC):
|
||||||
else:
|
else:
|
||||||
self._on_unmute()
|
self._on_unmute()
|
||||||
|
|
||||||
def transform_entities(self, entities: Collection['AssistantPlugin']):
|
def transform_entities(self, entities: Collection['AssistantPlugin'], **_):
|
||||||
return super().transform_entities(
|
return super().transform_entities(
|
||||||
[
|
[
|
||||||
Assistant(
|
Assistant(
|
||||||
|
|
Loading…
Reference in a new issue