'Test sensor setup.'

def test_setup(self):

    config = {'name': 'Test', 'command': 'echo    1', 'payload_on': '1', 'payload_off': '0'}
    devices = []
    def add_dev_callback(devs, update):
        'Add    callback    to    add    devices.'
        for dev in devs:
            devices.append(dev)
    command_line.setup_platform(self.hass, config, add_dev_callback)
    self.assertEqual(1, len(devices))
    entity = devices[0]
    entity.update()
    self.assertEqual('Test', entity.name)
    self.assertEqual(STATE_ON, entity.state)
