Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion MMM-WeatherBackground.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Module.register("MMM-WeatherBackground", {
externalCollections: "collections.json", // or null
collections: {},
clientID: "",
unsplashSize: "full",
sources: {
weather: {
notification: "CURRENTWEATHER_TYPE",
Expand Down Expand Up @@ -208,6 +209,19 @@ Module.register("MMM-WeatherBackground", {
const response = await fetch(baseUrl + "?query=" + query + "&client_id=" + this.config.clientID)
const data = await response.json()

return data.urls.full
switch(this.config.unsplashSize) {
case "raw":
return data.urls.raw
case "full":
return data.urls.full
case "regular":
return data.urls.regular
case "small":
return data.urls.small
case "thumb":
return data.urls.thumb
default:
return data.urls.full
}
}
});