'Test that invalid values are ignored.'

def test_invalid_values(self):

    with assert_setup_component(1, light.DOMAIN):
        assert setup_component(self.hass, light.DOMAIN, {light.DOMAIN: {'platform': 'mqtt_template', 'name': 'test', 'effect_list': ['rainbow', 'colorloop'], 'state_topic': 'test_light_rgb', 'command_topic': 'test_light_rgb/set', 'command_on_template': 'on,{{    brightness|d    }},{{    color_temp|d    }},{{    red|d    }}-{{    green|d    }}-{{    blue|d    }},{{    effect|d    }}', 'command_off_template': 'off', 'state_template': '{{    value.split(",")[0]    }}', 'brightness_template': '{{    value.split(",")[1]    }}', 'color_temp_template': '{{    value.split(",")[2]    }}', 'white_value_template': '{{    value.split(",")[3]    }}', 'red_template': '{{    value.split(",")[4].split("-")[0]    }}', 'green_template': '{{    value.split(",")[4].split("-")[1]    }}', 'blue_template': '{{    value.split(",")[4].split("-")[2]    }}', 'effect_template': '{{    value.split(",")[5]    }}'}})
    state = self.hass.states.get('light.test')
    self.assertEqual(STATE_OFF, state.state)
    self.assertIsNone(state.attributes.get('rgb_color'))
    self.assertIsNone(state.attributes.get('brightness'))
    self.assertIsNone(state.attributes.get('color_temp'))
    self.assertIsNone(state.attributes.get('effect'))
    self.assertIsNone(state.attributes.get('white_value'))
    self.assertFalse(state.attributes.get(ATTR_ASSUMED_STATE))
    fire_mqtt_message(self.hass, 'test_light_rgb', 'on,255,215,222,255-255-255,rainbow')
    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'))
    self.assertEqual(215, state.attributes.get('color_temp'))
    self.assertEqual([255, 255, 255], state.attributes.get('rgb_color'))
    self.assertEqual(222, state.attributes.get('white_value'))
    self.assertEqual('rainbow', state.attributes.get('effect'))
    fire_mqtt_message(self.hass, 'test_light_rgb', 'offf')
    self.hass.block_till_done()
    state = self.hass.states.get('light.test')
    self.assertEqual(STATE_ON, state.state)
    fire_mqtt_message(self.hass, 'test_light_rgb', 'on,off,255-255-255')
    self.hass.block_till_done()
    state = self.hass.states.get('light.test')
    self.assertEqual(255, state.attributes.get('brightness'))
    fire_mqtt_message(self.hass, 'test_light_rgb', 'on,,off,255-255-255')
    self.hass.block_till_done()
    state = self.hass.states.get('light.test')
    self.assertEqual(215, state.attributes.get('color_temp'))
    fire_mqtt_message(self.hass, 'test_light_rgb', 'on,255,a-b-c')
    self.hass.block_till_done()
    state = self.hass.states.get('light.test')
    self.assertEqual([255, 255, 255], state.attributes.get('rgb_color'))
    fire_mqtt_message(self.hass, 'test_light_rgb', 'on,,,off,255-255-255')
    self.hass.block_till_done()
    state = self.hass.states.get('light.test')
    self.assertEqual(222, state.attributes.get('white_value'))
    fire_mqtt_message(self.hass, 'test_light_rgb', 'on,255,a-b-c,white')
    self.hass.block_till_done()
    state = self.hass.states.get('light.test')
    self.assertEqual('rainbow', state.attributes.get('effect'))
