def device_state(device_id):
    """ Get device state via HTTP GET. """
    if device_id not in devices:
        return jsonify(success=False)
    return jsonify(state=devices[device_id].state)
def device_state ( device_id ) : if device_id not in devices : return jsonify ( success = False ) return jsonify ( state = devices [ device_id ] . state )
Get device state via HTTP GET.