I am very new to this so apologies if this is a stupid question.
I am writing an app which switches a device on and off, for now it’s just an LED. I have this working. My app basically calls a web url which controls the LED. All good. I want to be able to check if the LED is on or off though (say it was left on or maybe the user switched it on via a button). How do I go about doing this? I guess I basically want to call an url which asks the agent if a pin is active then replies with a “1” or “0”.
Any help most appreciated. An example of this would be great. Actually, what exactly I need to search for would be great
Thanks!