send last poll instead of polling new
This commit is contained in:
@@ -73,14 +73,19 @@ export class HomepageService extends BaseService<null> {
|
|||||||
|
|
||||||
async sendFullInformationToSocket(socket: WebSocket): Promise<void> {
|
async sendFullInformationToSocket(socket: WebSocket): Promise<void> {
|
||||||
try {
|
try {
|
||||||
const [desk, temp, tidal, personal_goals] = await this._getAll();
|
|
||||||
const updates: ComponentUpdate[] = [
|
const updates: ComponentUpdate[] = [
|
||||||
createComponentUpdate(StatusComponent.HA_DESK_POSITION, desk),
|
createComponentUpdate(
|
||||||
createComponentUpdate(StatusComponent.HA_TEMP, temp),
|
StatusComponent.HA_DESK_POSITION,
|
||||||
createComponentUpdate(StatusComponent.TIDAL_CURRENT, tidal),
|
this.lastPoll.ha_desk_position,
|
||||||
|
),
|
||||||
|
createComponentUpdate(StatusComponent.HA_TEMP, this.lastPoll.ha_temp),
|
||||||
|
createComponentUpdate(
|
||||||
|
StatusComponent.TIDAL_CURRENT,
|
||||||
|
this.lastPoll.tidal_current,
|
||||||
|
),
|
||||||
createComponentUpdate(
|
createComponentUpdate(
|
||||||
StatusComponent.GRIST_PERSONAL_GOALS,
|
StatusComponent.GRIST_PERSONAL_GOALS,
|
||||||
personal_goals,
|
this.lastPoll.grist_personal_goals,
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
socket.send(
|
socket.send(
|
||||||
|
|||||||
Reference in New Issue
Block a user