A couple of years ago I was going to make an openluup specific port of GCal3 and then got distracted …
GCal3, over the past year or so, has been not needed code changes. Recently google made a change that needed an immediate fix … Fortunately it was easy enough to identify so I issues a quick patch file.
A couple of folks using openluup picked up the patch file - functionally working but a UI problem - like no UI
So I’m reinvigorated to take a look at openluup - but am traveling over the next few weeks and cannot get physically to my server to install etc. .
One question (for now) to maybe solve the UI problem. In the patched file (nothing to do with the google issue) just from a more recent GCal version - I have this code:
if ( luup.version_branch == 1 and luup.version_major == 7 and GCV.UI7Check == "false") then
GCV.UI7Check = "true"
luup.attr_set("device_json", "D_GCal3_UI7.json", lul_device)
(Yes - I know the if looks strange)
Several questiions:
Do the luup.version and luup.version_major variables have meaning / return particular values in openluup ?
If no - is there a simple way to tell if the code is running on openluup?
Does the line luup.attr_set(“device_json” … do anything in openluup?
akbooer sure added a quick reliable check to see if you are running on openLuup. I use this bit of code to determine what a plugin is running on (part of a library of utils i compiled):
local _UI5 = 5
local _UI6 = 6
local _UI7 = 7
local _UI8 = 8
local _OpenLuup = 99
-- See what system we are running on, some Vera or OpenLuup
local function _getui()
if (luup.attr_get("openLuup",0) ~= nil) then
return _OpenLuup
else
return luup.version_major
end
return _UI7
end
Thanks guys. I have made some fairly small changes to the current, latest GCal code base and it looks like it will no longer cause issues in openLuup. With that said - I will now look at putting this code into Alt App Store.
One question I have - does openlup pull all the files from the github folder or just those that it expects to be “plugin related”. I’m assuming and hoping the former. The reason I’m asking is that I’m thinking of including the test calendar id and the test credentials file as part of the initial install setup. So it would be nice if the install from github, by default, pulled the credentials file as well as the plugin files.
In particular, judicious use of the Folder and Pattern fields can get you close to what you want. If you’ve named files in the usual way, then a pattern of [tt]“[DIJLS]_%w+%.%w+”[/tt] should work just fine.