8386bda4e49a14661d8a9f9020002d1434f83372,homeassistant/components/mqtt/__init__.py,,setup,#Any#Any#,95

Before Change



def setup(hass, config):
    Start the MQTT protocol service.
    if not validate_config(config, {DOMAIN: ["broker"]}, _LOGGER):
        return False

    conf = config[DOMAIN]

    broker = conf[CONF_BROKER]
    port = util.convert(conf.get(CONF_PORT), int, DEFAULT_PORT)

After Change


    broker_config = _setup_server(hass, config)

    // Only auto config if no server config was passed in
    if broker_config and CONF_EMBEDDED not in conf:
        broker, port, username, password, certificate, protocol = broker_config
    elif not broker_config and (CONF_EMBEDDED in conf or
                                CONF_BROKER not in conf):
        _LOGGER.error("Unable to start broker and auto-configure MQTT.")
        return False

    if CONF_BROKER in conf:
        broker = conf[CONF_BROKER]
        port = util.convert(conf.get(CONF_PORT), int, DEFAULT_PORT)
        username = util.convert(conf.get(CONF_USERNAME), str)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: home-assistant/home-assistant
Commit Name: 8386bda4e49a14661d8a9f9020002d1434f83372
Time: 2016-03-12
Author: paulus@paulusschoutsen.nl
File Name: homeassistant/components/mqtt/__init__.py
Class Name:
Method Name: setup


Project Name: home-assistant/home-assistant
Commit Name: 3b3f5fe6fe2092a5071491fafce11b3851d07ce8
Time: 2015-11-08
Author: paulus@paulusschoutsen.nl
File Name: homeassistant/components/notify/pushbullet.py
Class Name:
Method Name: get_service


Project Name: home-assistant/home-assistant
Commit Name: ed05ff6fd93938a77f85a3008b78c28cf1c0e1ad
Time: 2015-01-17
Author: paulus@paulusschoutsen.nl
File Name: homeassistant/components/http/__init__.py
Class Name:
Method Name: setup