'Test the mean sensor.'

def test_mean_sensor(self):

    config = {'sensor': {'platform': 'min_max', 'name': 'test_mean', 'type': 'mean', 'entity_ids': ['sensor.test_1', 'sensor.test_2', 'sensor.test_3']}}
    assert setup_component(self.hass, 'sensor', config)
    entity_ids = config['sensor']['entity_ids']
    for (entity_id, value) in dict(zip(entity_ids, self.values)).items():
        self.hass.states.set(entity_id, value)
        self.hass.block_till_done()
    state = self.hass.states.get('sensor.test_mean')
    self.assertEqual(str(float(self.mean)), state.state)
    self.assertEqual(self.min, state.attributes.get('min_value'))
    self.assertEqual(self.max, state.attributes.get('max_value'))
