Closed mStirner closed 10 months ago
A quick and dirty test:
mounted() {
let $route = useRoute();
this.data = Array.from(store.endpoints).find((item) => {
return item._id === $route.params._id;
});
console.log("Endpoint mounted", this.data.name);
setInterval(() => {
let state = this.data.states[0];
state.value = Date.now();
console.log(`Set state ${state.name}=${state.value}`);
}, 1000);
}
Computed properties states
& commands
are just for the header bar which represents number of commads/headers, and not the arrays of data
/item.
Manipulating the value
property does update the UI/rendering.
The backend does not trigger any event which could lead to re-render. So, not really a frontend issue.
Keep this open till resolved/solution found.
When a endpoint state is updated via HTTP API, its not reactive rendered. The frontend needs to be refreshed. Perhaps because of
computed.states
: https://github.com/OpenHausIO/frontend/blob/7e4bd6d8f794be1f61bc838efc91dd16432f337b/src/views/Endpoint.vue#L81-L92 ?