diff --git a/defaultmodules/weather/node_helper.js b/defaultmodules/weather/node_helper.js index f9ea08c42a..cda81a5140 100644 --- a/defaultmodules/weather/node_helper.js +++ b/defaultmodules/weather/node_helper.js @@ -31,7 +31,12 @@ module.exports = NodeHelper.create({ Log.log(`Attempting to initialize provider ${identifier} for instance ${instanceId}`); if (this.providers[instanceId]) { - Log.log(`Weather provider ${identifier} already initialized for instance ${instanceId}`); + Log.log(`Weather provider ${identifier} already initialized for instance ${instanceId}, re-sending WEATHER_INITIALIZED`); + // Client may have restarted (e.g. page reload) - re-send so it recovers location name + this.sendSocketNotification("WEATHER_INITIALIZED", { + instanceId, + locationName: this.providers[instanceId].locationName + }); return; } diff --git a/defaultmodules/weather/weather.js b/defaultmodules/weather/weather.js index 732958e6c8..d3fbeb13ac 100644 --- a/defaultmodules/weather/weather.js +++ b/defaultmodules/weather/weather.js @@ -110,8 +110,8 @@ Module.register("weather", { this.config.showHumidity = this.config.showHumidity ? "wind" : "none"; } - // All providers run server-side: generate unique instance ID and initialize via node_helper - this.instanceId = `${this.identifier}_${Date.now()}`; + // All providers run server-side: use stable identifier so reconnects don't spawn duplicate HTTPFetchers + this.instanceId = this.identifier; if (window.initWeatherTheme) window.initWeatherTheme(this);