Skip to content

Commit

Permalink
Add demo mode
Browse files Browse the repository at this point in the history
  • Loading branch information
javalikescript committed Dec 1, 2024
1 parent f2e1986 commit 6cdf2b9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions extensions/owm/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
"writeOnly": true,
"required": true
},
"cityId": {
"title": "City ID",
"type": "string",
"deprecated": true,
"required": true
},
"latitude": {
"title": "Latitude",
"type": "number",
Expand Down Expand Up @@ -49,6 +55,11 @@
"type": "string",
"pattern": "^%a%a_?%a*$"
},
"demo": {
"type": "boolean",
"default": false,
"format": "hidden"
},
"maxPollingDelay": {
"title": "Minimum Call Interval in seconds",
"type": "integer",
Expand Down
4 changes: 2 additions & 2 deletions extensions/owm/owm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ local function updateForecastThing(data, time)
updateWeatherThing(thingByKey.nextDays, adapter.computeNextDays(data, time))
end

local demo = false
if demo then
if configuration.demo then
logger:info('OpenWeatherMap DEMO mode')
extension:subscribeEvent('poll', function()
local json = require('jls.util.json')
local File = require('jls.io.File')
Expand Down

0 comments on commit 6cdf2b9

Please sign in to comment.