'Test that invalid color/brightness/white values are ignored.'

def test_invalid_color_brightness_and_white_values(self):

    assert setup_component(self.hass, light.DOMAIN, {light.DOMAIN: {'platform': 'mqtt_json', 'name': 'test', 'state_topic': 'test_light_rgb', 'command_topic': 'test_light_rgb/set', 'brightness': True, 'rgb': True, 'white_value': True, 'qos': '0'}})
    state = self.hass.states.get('light.test')
    self.assertEqual(STATE_OFF, state.state)
    self.assertEqual(185, state.attributes.get(ATTR_SUPPORTED_FEATURES))
    self.assertIsNone(state.attributes.get('rgb_color'))
    self.assertIsNone(state.attributes.get('brightness'))
    self.assertIsNone(state.attributes.get('white_value'))
    self.assertFalse(state.attributes.get(ATTR_ASSUMED_STATE))
    fire_mqtt_message(self.hass, 'test_light_rgb', '{"state":"ON","color":{"r":255,"g":255,"b":255},"brightness":    255,"white_value":    255}')
    self.hass.block_till_done()
    state = self.hass.states.get('light.test')
    self.assertEqual(STATE_ON, state.state)
    self.assertEqual([255, 255, 255], state.attributes.get('rgb_color'))
    self.assertEqual(255, state.attributes.get('brightness'))
    self.assertEqual(255, state.attributes.get('white_value'))
    fire_mqtt_message(self.hass, 'test_light_rgb', '{"state":"ON","color":{"r":"bad","g":"val","b":"test"}}')
    self.hass.block_till_done()
    state = self.hass.states.get('light.test')
    self.assertEqual(STATE_ON, state.state)
    self.assertEqual([255, 255, 255], state.attributes.get('rgb_color'))
    fire_mqtt_message(self.hass, 'test_light_rgb', '{"state":"ON","brightness":    "badValue"}')
    self.hass.block_till_done()
    state = self.hass.states.get('light.test')
    self.assertEqual(STATE_ON, state.state)
    self.assertEqual(255, state.attributes.get('brightness'))
    fire_mqtt_message(self.hass, 'test_light_rgb', '{"state":"ON","white_value":    "badValue"}')
    self.hass.block_till_done()
    state = self.hass.states.get('light.test')
    self.assertEqual(STATE_ON, state.state)
    self.assertEqual(255, state.attributes.get('white_value'))
