'Test tilt by updating status via MQTT.'

def test_tilt_via_topic(self):

    self.assertTrue(setup_component(self.hass, cover.DOMAIN, {cover.DOMAIN: {'platform': 'mqtt', 'name': 'test', 'state_topic': 'state-topic', 'command_topic': 'command-topic', 'qos': 0, 'payload_open': 'OPEN', 'payload_close': 'CLOSE', 'payload_stop': 'STOP', 'tilt_command_topic': 'tilt-command-topic', 'tilt_status_topic': 'tilt-status-topic', 'tilt_opened_value': 400, 'tilt_closed_value': 125}}))
    fire_mqtt_message(self.hass, 'tilt-status-topic', '0')
    self.hass.block_till_done()
    current_cover_tilt_position = self.hass.states.get('cover.test').attributes['current_tilt_position']
    self.assertEqual(0, current_cover_tilt_position)
    fire_mqtt_message(self.hass, 'tilt-status-topic', '50')
    self.hass.block_till_done()
    current_cover_tilt_position = self.hass.states.get('cover.test').attributes['current_tilt_position']
    self.assertEqual(50, current_cover_tilt_position)
