Im trying to build a driver to import .ical data, ive got the below but im inable to debug the response data, response status is 200 and working but nothing else dose
try {
httpGet(reqParams) { resp ->
if(resp.status == 200) {
log.debug "${resp.status}" //log.debug "${resp.responseData}" //log.debug "${resp.data}"
Trying to shutdown my pi using this but can't get it to work in RM
Yes, the UI sends a post request to "http://your-ip/settings with
name = syscmd and value = poweroff to shutdown
or
name = syscmd and value = poweroff to reboot to reboot your device
Maybe httpGet is throwing an exception, like Connection Refused or something, which means no response regardless of status. What happens in your catch block?
Hmmm looks like either: the toString() is causing an issue, or the data returned is different than what I'm seeing (for example, nowhere in that data do I see an "@")
If you put a line that outputs resp.data (i.e. log.debug "Data: ${resp.data}" ) what does that look like?
this spec rfc2445
says
The iCalendar object is organized into individual lines of text,
called content lines. Content lines are delimited by a line break,
which is a CRLF sequence (US-ASCII decimal 13, followed by US-ASCII
decimal 10).
Okay, I see the problem - I was expecting one event and you're getting several. If we take each block from BEGIN:VEVENT through END:VEVENT and pass it through we could get a HashMap for the event...
Going to look for an iCal parser that could be used/converted...
483 in calendar.js looks like its intrating over the list ....
for (const calendarUrl in this.calendarData) {
const calendar = this.calendarData[calendarUrl];
for (const e in calendar) {
const event = JSON.parse(JSON.stringify(calendar[e])); // clone object
if (event.endDate < now) {
not sure if the problem is thats it is a ByteArrayInputStream, when ever i tyry to do anything the error keeps coming back to that?
i think the problem is the description in the file, this is a extact from my calander, can we ignore/omit the fields taged as DESCRIPTION
CREATED:20210525T155038Z DESCRIPTION:Good AfternoonMark\nI have been made aware that the joining ins
tructions for tonight's All Leaders meeting have not been sent out.\nI apol
ogise for this and hope it does not cause too much inconvenience.\n\nRather
than trying to rescue it at this late stage, I have decided to postpone i
t until next Tuesday 1st June at 7.30pm.\n\nPlease join using the following
link. Your section ADC's will be in touch if there are section meetings to
follow.\nThe GSLs meeting will follow on as normal.\nIf any GSLs were hopi
ng to raise questions tonight, I am available throughout the evening on th
Not sure if this is helpful or not, but I did have problems with one API call when trying to output it to the logs, it reformatted it, removing important special characters, so through off my assessment of how I needed to treat it in the code. Perhaps looking at the code through Postman or something similar may help...
Looks like the description may have contained a “:”
What you may want to do is narrow it down to the fields that you really want to see, and only add those to the map, i.e. Start TimeStamp, End Timestamp, Location, Summary. Probably should also refine the map structure similiar to
Means we need to interogate the dSplit[0] and little more, but ultimately you end up with a data structure that is more usable and could be more easily processed;