def testSensorInfo(self):
    debug('testSensorInfo')
    actuator_channel = GPIO().pins[10]
    light_switch_channel = GPIO().pins[11]
    sensors = {'actuator': {'description': 'Digital Output', 'device': 'DigitalActuator', 'args': {'gpio': 'GPIO', 'invert': False, 'channel': actuator_channel}, 'name': 'test_actuator'}, 'light_switch': {'description': 'Light Switch', 'device': 'LightSwitch', 'args': {'gpio': 'GPIO', 'invert': True, 'channel': light_switch_channel}, 'name': 'test_light_switch'}, 'MCP3004': {'description': 'MCP3004', 'device': 'MCP3004', 'args': {'chip': '0'}, 'name': 'test_MCP3004'}, 'distance': {'description': 'Analog Distance Sensor', 'device': 'DistanceSensor', 'args': {'adc': 'test_MCP3004', 'channel': 0}, 'name': 'test_distance'}}
    for sensor in sensors.values():
        SensorsClientTest.client.AddSensor(sensor['name'], sensor['description'], sensor['device'], sensor['args'])
    SensorsClientTest.client.SensorsInfo()
    self.setSensorValue(sensors['actuator'], 1)
    self.setSensorValue(sensors['actuator'], 0)
    self.setSensorValue(sensors['light_switch'], 1)
    self.setSensorValue(sensors['light_switch'], 0)
    channel = 'dev:{}'.format(sensors['distance']['name'])
    retrievedSensorInfo = next((obj for obj in SensorsClientTest.client.SensorsInfo() if (obj['channel'] == channel)))
    self.assertGreaterEqual(retrievedSensorInfo['value'], 0.0)
    self.assertLessEqual(retrievedSensorInfo['value'], 1.0)
    for sensor in sensors.values():
        self.assertTrue(SensorsClientTest.client.RemoveSensor(sensor['name']))
def testSensorInfo(self):
    debug('testSensorInfo')
    actuator_channel = GPIO().pins[10]
    light_switch_channel = GPIO().pins[11]
    sensors = {'actuator': {'description': 'Digital Output', 'device': 'DigitalActuator', 'args': {'gpio': 'GPIO', 'invert': False, 'channel': actuator_channel}, 'name': 'test_actuator'}, 'light_switch': {'description': 'Light Switch', 'device': 'LightSwitch', 'args': {'gpio': 'GPIO', 'invert': True, 'channel': light_switch_channel}, 'name': 'test_light_switch'}, 'MCP3004': {'description': 'MCP3004', 'device': 'MCP3004', 'args': {'chip': '0'}, 'name': 'test_MCP3004'}, 'distance': {'description': 'Analog Distance Sensor', 'device': 'DistanceSensor', 'args': {'adc': 'test_MCP3004', 'channel': 0}, 'name': 'test_distance'}}
    for sensor in sensors.values():
        SensorsClientTest.client.AddSensor(sensor['name'], sensor['description'], sensor['device'], sensor['args'])
    SensorsClientTest.client.SensorsInfo()
    self.setSensorValue(sensors['actuator'], 1)
    self.setSensorValue(sensors['actuator'], 0)
    self.setSensorValue(sensors['light_switch'], 1)
    self.setSensorValue(sensors['light_switch'], 0)
    channel = 'dev:{}'.format(sensors['distance']['name'])
    retrievedSensorInfo = next((obj for obj in SensorsClientTest.client.SensorsInfo() if (obj['channel'] == channel)))
    self.assertGreaterEqual(retrievedSensorInfo['value'], 0.0)
    self.assertLessEqual(retrievedSensorInfo['value'], 1.0)
    for sensor in sensors.values():
        self.assertTrue(SensorsClientTest.client.RemoveSensor(sensor['name']))