Hi! With the Homeyscript I can see new possibilities, but I am totally useless on this, appearently! I have no background in programming, but have a good sense of how it works and what can be done. With that being said, I am in desperate need of assistance.
Background: Me and some friends are in to photographing and flying drones, and share our work. Currently, we are using a P2P SW for sharing with automatic downloads. I would like to get notified when AirDC (SW) starts a new download.
AirDC have a good API library that I intend to use, the one I think I should use is this one
The javascript (I guess javascript is okay) looks like this:
I would like to execute this script frequently and if a new download is added, I want to return the attribute “name” of the folder and via Homey create a push notification:
Thanks @robertklep, thank you for taking the time to read my post and respond.
At this point, I am very open for any solution! I actually have that app, so why not?!
Oh, sorry!
I tries the respond.status just to see if I got any status (working/not working). But I only got this output:
Script Error
ReferenceError: response is not defined
at airdctest.js:11:1
at processTicksAndRejections (internal/process/task_queues.js:97:5)
Can I assume that this is not supported by AirDCs API?!
Yeah, thanks @robertklep!
I know that it is like talking to a five year old.
I have read the information, but problem is that I do not fully understand the mechanisms so I more or less pick parts on chance.
Like I said, XMLHttpRequest and fetch have completely different calling semantics. You just replaced XMLHttpRequest with fetch, but all the other code that’s left in place is specific to XMLHttpRequest and won’t work with fetch.
Thanks @robertklep! I really appreciate your support. I would like to emphasize that I am not lazy, I have read and tried and read some more before posting here.
But when I don’t get it right I tried to get some help here. I will try this. Thanks again
Well, I did some more reading, and some more testing. Are there someone that can help me translate the example code to something that works in Homeyscript or HTTP request flow cards?