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'
|
||||
)
|
||||
|
||||
if (!this.loadCachedEntities()) {
|
||||
await this.sync()
|
||||
this.refresh()
|
||||
} else {
|
||||
await this.request('entities.scan')
|
||||
this.sync()
|
||||
}
|
||||
|
||||
const hasCachedEntities = this.loadCachedEntities()
|
||||
await this.sync(!hasCachedEntities)
|
||||
await this.refresh()
|
||||
setInterval(() => this.refreshEntitiesCache(), 10000)
|
||||
},
|
||||
|
||||
|
|
|
@ -278,7 +278,7 @@ class AssistantPlugin(Plugin, AssistantEntityManager, ABC):
|
|||
else:
|
||||
self._on_unmute()
|
||||
|
||||
def transform_entities(self, entities: Collection['AssistantPlugin']):
|
||||
def transform_entities(self, entities: Collection['AssistantPlugin'], **_):
|
||||
return super().transform_entities(
|
||||
[
|
||||
Assistant(
|
||||
|
|
Loading…
Reference in a new issue