'Test if source is a sensor.'

def test_sensor_source(self):

    assert setup_component(self.hass, 'sensor', {'sensor': {'platform': 'statistics', 'name': 'test', 'entity_id': 'sensor.test_monitored'}})
    for value in self.values:
        self.hass.states.set('sensor.test_monitored', value, {ATTR_UNIT_OF_MEASUREMENT: TEMP_CELSIUS})
        self.hass.block_till_done()
    state = self.hass.states.get('sensor.test_mean')
    self.assertEqual(str(self.mean), state.state)
    self.assertEqual(self.min, state.attributes.get('min_value'))
    self.assertEqual(self.max, state.attributes.get('max_value'))
    self.assertEqual(self.variance, state.attributes.get('variance'))
    self.assertEqual(self.median, state.attributes.get('median'))
    self.assertEqual(self.deviation, state.attributes.get('standard_deviation'))
    self.assertEqual(self.mean, state.attributes.get('mean'))
    self.assertEqual(self.count, state.attributes.get('count'))
    self.assertEqual(self.total, state.attributes.get('total'))
    self.assertEqual('\xc2\xb0C', state.attributes.get('unit_of_measurement'))
    self.assertEqual(self.change, state.attributes.get('change'))
    self.assertEqual(self.average_change, state.attributes.get('average_change'))
