The .finally() in internalSendMessage emits the updated event BEFORE
sendAndSetConnectorStatus updates connectorStatus.status, causing the
UI cache to snapshot the old status. The connectorStatusChanged event
fires AFTER the update, so posting an updated message on it ensures
the cache receives the correct connector status.
this.on(ChargingStationEvents.updated, () => {
parentPort?.postMessage(buildUpdatedMessage(this))
})
+ this.on(ChargingStationEvents.connectorStatusChanged, () => {
+ parentPort?.postMessage(buildUpdatedMessage(this))
+ })
this.on(ChargingStationEvents.accepted, () => {
this.startMessageSequence(
this.wsConnectionRetryCount > 0