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)
    client_id = util.convert(conf.get(CONF_CLIENT_ID), str)

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: 4

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: 0527760e9bd7760c0c441aad09f70b246e08ac11
Time: 2014-12-06
Author: Paulus@PaulusSchoutsen.nl
File Name: homeassistant/components/switch/__init__.py
Class Name:
Method Name: setup


Project Name: home-assistant/home-assistant
Commit Name: 35489998dfeff583067e14896a9e27ed7636089d
Time: 2015-08-23
Author: paulus@paulusschoutsen.nl
File Name: homeassistant/components/device_tracker/netgear.py
Class Name:
Method Name: get_scanner


Project Name: home-assistant/home-assistant
Commit Name: 169f054c6c038a8b6e51d8ede81db56f7b6b6b62
Time: 2016-09-17
Author: kellerza@gmail.com
File Name: homeassistant/components/device_tracker/tplink.py
Class Name:
Method Name: get_scanner