{"record":{"id":"d68debfa2f892871","repo":"MagicMirrorOrg/MagicMirror","slug":"unknown-weather-type-this-config-type-d68deb","errorCode":null,"errorMessage":"Unknown weather type: ${this.config.type}","messagePattern":"Unknown weather type: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"defaultmodules/weather/providers/openmeteo.js","lineNumber":225,"sourceCode":"\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tlet weatherData;\n\t\t\tswitch (this.config.type) {\n\t\t\t\tcase \"current\":\n\t\t\t\t\tweatherData = this.#generateWeatherDayFromCurrentWeather(parsedData);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"forecast\":\n\t\t\t\tcase \"daily\":\n\t\t\t\t\tweatherData = this.#generateWeatherObjectsFromForecast(parsedData);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"hourly\":\n\t\t\t\t\tweatherData = this.#generateWeatherObjectsFromHourly(parsedData);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tLog.error(`[openmeteo] Unknown type: ${this.config.type}`);\n\t\t\t\t\tthrow new Error(`Unknown weather type: ${this.config.type}`);\n\t\t\t}\n\n\t\t\tif (weatherData && this.onDataCallback) {\n\t\t\t\tthis.onDataCallback(weatherData);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tLog.error(\"[openmeteo] Error processing weather data:\", error);\n\t\t\tif (this.onErrorCallback) {\n\t\t\t\tthis.onErrorCallback({\n\t\t\t\t\tmessage: error.message,\n\t\t\t\t\ttranslationKey: \"MODULE_ERROR_UNSPECIFIED\"\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t#getQueryParameters () {\n\t\tlet maxNumberOfDays = this.config.maxNumberOfDays;","sourceCodeStart":207,"sourceCodeEnd":243,"githubUrl":"https://github.com/MagicMirrorOrg/MagicMirror/blob/4b4a59534f7da01e4030e46029fe9dd649a7675e/defaultmodules/weather/providers/openmeteo.js#L207-L243","documentation":"openmeteo's #handleResponse switches on this.config.type; unsupported values log '[openmeteo] Unknown type' and throw 'Unknown weather type'. It fires after a successful API parse, so it purely indicates a config problem, not an API problem.","triggerScenarios":"config.type is any string other than the handled cases ('current', 'daily', 'hourly'), e.g. 'today', 'forecast', or a mistyped value.","commonSituations":"Config copied from a provider with richer type vocabulary; camelCase or capitalized type; UI passing a free-form string into the provider.","solutions":["Set config.type to 'current', 'daily' or 'hourly'","Fix the casing/whitespace of the type string","Validate type against the supported set before calling initialize()"],"exampleFix":"// before\nconfig = { type: \"3hourly\", ... }\n// after\nconfig = { type: \"hourly\", ... }","handlingStrategy":"validation","validationCode":"const OPENMETEO_TYPES = [\"current\", \"daily\", \"hourly\"];\nif (!OPENMETEO_TYPES.includes(config.type)) throw new Error(`openmeteo type must be one of ${OPENMETEO_TYPES.join(\" | \")}`);","typeGuard":"const isValidType = (t) => typeof t === \"string\" && [\"current\", \"daily\", \"hourly\"].includes(t);","tryCatchPattern":"try {\n  provider.initialize(config);\n} catch (err) {\n  if (err.message.startsWith(\"Unknown weather type:\")) {\n    console.error(`openmeteo: '${config.type}' unsupported — use current/daily/hourly`);\n  } else throw err;\n}","preventionTips":["Enum-validate config.type before initialize()","Keep type values lowercase and exact","Don't import type vocabulary from other providers","Add a config schema test per provider"],"tags":["config","openmeteo","unknown-value"],"backgroundTag":"invalid-enum-value","analyzedSha":"4b4a59534f7da01e4030e46029fe9dd649a7675e","analyzedAt":"2026-08-31T21:49:42.591Z","schemaVersion":2},"datasetVersion":"2026-08-31T22:30:34.772Z"}