This release (V1.2B) rolls up some minor corrections and better handling of iCal date format.
The BIG news is that I've added the capability to create events in google calendar - it leverages the authentication already built into GCal3 - so there is no additional login / credential checking etc.
The attached 3 files (S_GCal3.xml, I_GCal3.xml and GCal3.lua) update V1.1 from the marketplace. Several things to note:
(1) This only works when the plugin is associated with a google calendar NOT an iCalendar (i.e. do not use the iCal reference to a google calendar)
(2) You need to make sure that your calendar sharing is set so that service account can Make Changes to events
Here's an example of how to create an event - there are three mandatory inputs startDate, endDate and title - description is optional. Be careful to preserve the JSON structure. The example shows one event inside the [] but the code will handle multiple events [{event1},{event2}, ....... ,{eventn}].
title and description can have the optional [start,end] offset and the {parameter} attributes that are recognised by GCal3.
startDate and endDate MUST be in the form yyyy-mm-ddThh:mm:ss for local time OR yyyy-mm-ddThh:mm:ssZ for utc. No other representations are allowed
The parameter passed into the luup.call_action call must be an array of the form
ArrayName.CalendarEvent as 'CalendarEvent' is the name of the parameter that the plugin is expecting e.g.' Event.CalendarEvent' in the example below.
Please provide feedback !
-- Sample code for adding event
local GCAL_SID = "urn:srs-com:serviceId:GCalIII"
local GCAL_DEV = 3 -- The GCAL device number
local startDate = os.date("%Y-%m-%dT%H:%M:%S", os.time()+(1*3600)) -- plus one hour
local endDate = os.date("%Y-%m-%dT%H:%M:%S", os.time()+(1.5*3600)) -- plus 1.5 hour
local title = "TEST[-5,-5]"
local description = "MyDescription1{event parameter}"
local Event = {}
local event1 = '[{"eventName":"' ..
title
.. '","eventStart":"' ..
startDate
..'","eventEnd":"' ..
endDate
.. '","eventDescription":"' ..
description
.. '"}]'
Event.CalendarEvent = event1
local resultcode,_,_,_ = luup.call_action(GCAL_SID, "AddEvent",Event, GCAL_DEV)