'Check if code receiving via pilight daemon works.'

@patch('pilight.pilight.Client', PilightDaemonSim)
@patch('homeassistant.core._LOGGER.info')
def test_receive_code(self, mock_info):

    with assert_setup_component(4):
        self.assertTrue(setup_component(self.hass, pilight.DOMAIN, {pilight.DOMAIN: {}}))
        self.hass.start()
        self.hass.block_till_done()
        expected_message = dict({'protocol': PilightDaemonSim.test_message['protocol'], 'uuid': PilightDaemonSim.test_message['uuid']}, **PilightDaemonSim.test_message['message'])
        error_log_call = mock_info.call_args_list[(-1)]
        for (key, value) in expected_message.items():
            self.assertTrue((str(key) in str(error_log_call)))
            self.assertTrue((str(value) in str(error_log_call)))
