fix: Better resilience towards MQTT connection loss and errors (#168)

This commit is contained in:
Pascal Bourque
2025-10-31 15:47:15 -04:00
committed by GitHub
parent 137e51efa0
commit 0c906fefe9
3 changed files with 188 additions and 30 deletions

View File

@@ -67,7 +67,7 @@ async function main() {
const device = devices.DevicesObj[status.deviceId];
const watts = status.current !== undefined ? status.current * device.Voltage : undefined;
rootLogger.info(
`'${device.Name}' status changed: ${status.temperature}°C, ${status.humidity}%, ${watts ?? 'na'}W`
`[${status.deviceId}] '${device.Name}' status changed: ${status.temperature}°C, ${status.humidity}%, ${watts ?? 'na'}W`
);
} catch (error) {
rootLogger.error(error, `Error processing status update for device '${status.deviceId}'`);