Converts a GPIO to a JSON string. See constructor isolate for detials.
String toJson() { return '{"path":"$path","chip":$chip,"line":$line,"direction":${direction.index},"name":"$name","handle":${_gpioHandle.address}}'; }