def _main():
    api = ConnectAPI()
    # calling start_notifications is required for getting/setting resource synchronously
    api.start_notifications()
    devices = api.list_connected_devices().data
    if not devices:
        raise Exception("No connected devices registered. Aborting")

    # Synchronously get the initial/current value of the resource
    value = api.get_resource_value(devices[0].id, WRITEABLE_RESOURCE)
    print("Current value: %r" % (value,))

    # Set Resource value. Resource needs to have type == "writable_resource"
    api.set_resource_value(device_id=devices[0].id,
                           resource_path=WRITEABLE_RESOURCE,
                           resource_value='10')

    # Synchronously get the current value of the resource
    value = api.get_resource_value(devices[0].id, WRITEABLE_RESOURCE)
    print("Current value: %r" % (value,))