'Test the setting of a valid sensor class.'

def test_valid_device_class(self):

    assert setup_component(self.hass, binary_sensor.DOMAIN, {binary_sensor.DOMAIN: {'platform': 'mqtt', 'name': 'test', 'device_class': 'motion', 'state_topic': 'test-topic'}})
    state = self.hass.states.get('binary_sensor.test')
    self.assertEqual('motion', state.attributes.get('device_class'))
