Shelly Scripting – erste Schritte mit mJS auf dem Shelly Pro 4 PM

Shelly Scripting – Tutorial

 

let greeting = „Hello world!“;
print(greeting);
Shelly.call(
„HTTP.GET“,
{„url“: „https://api.zippopotam.us/us/90210“},
function (response) {
if (response && response.code && response.code === 200) {
print(JSON.stringify(response.body));
Shelly.emitEvent(„HTTP-result“, response.body);
}
else {
print(„Error: HTTP request failed.“);
}
}
);

Leave a Reply

You must be logged in to post a comment.