Skip to content

Commit 087766b

Browse files
authored
fix: Tuya: fix weather crash due to missing await (#12595)
1 parent 1d15c0c commit 087766b

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

src/lib/tuya.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5252,7 +5252,11 @@ const tuyaModernExtend = {
52525252

52535253
const pld = _prepareTuyaWeatherSyncPayload(meta, number_of_forecast_days, include_current_weather);
52545254

5255-
msg.endpoint.command("manuSpecificTuya", "tuyaWeatherSync", {payload: pld});
5255+
msg.endpoint
5256+
.command("manuSpecificTuya", "tuyaWeatherSync", {payload: pld})
5257+
.catch((error) =>
5258+
logger.warning(() => `Failed to sync '${msg.device.ieeeAddr}:${msg.endpoint.ID}' on weather request (${error})`, NS),
5259+
);
52565260
}
52575261
},
52585262
};
@@ -5264,7 +5268,12 @@ const tuyaModernExtend = {
52645268

52655269
const pld = _prepareTuyaWeatherSyncPayload(meta, numberOfForecastDays, includeCurrentWeather);
52665270

5267-
entity.command("manuSpecificTuya", "tuyaWeatherSync", {payload: pld});
5271+
entity
5272+
.command("manuSpecificTuya", "tuyaWeatherSync", {payload: pld})
5273+
.catch(
5274+
(error) => () =>
5275+
logger.warning(`Failed to sync weather for '${utils.isGroup(entity) ? entity.groupID : entity.ID}' (${error})`, NS),
5276+
);
52685277

52695278
return {state: {[key]: value}};
52705279
},

0 commit comments

Comments
 (0)