コード例 #1
0
 def mock_psc(hass, config_input, domain):
     """Mock the prepare_setup_component to capture config."""
     res = prepare_setup_component(hass, config_input, domain)
     config[domain] = None if res is None else res.get(domain)
     _LOGGER.debug('Configuration for %s, Validated: %s, Original %s',
                   domain, config[domain], config_input.get(domain))
     return res
コード例 #2
0
ファイル: common.py プロジェクト: krzynio/home-assistant
 def mock_psc(hass, config_input, domain):
     """Mock the prepare_setup_component to capture config."""
     res = prepare_setup_component(hass, config_input, domain)
     config[domain] = None if res is None else res.get(domain)
     _LOGGER.debug('Configuration for %s, Validated: %s, Original %s',
                   domain, config[domain], config_input.get(domain))
     return res
コード例 #3
0
    def prepare_reload(self):
        """Prepare reloading this entity component."""
        try:
            path = conf_util.find_config_file(self.hass.config.config_dir)
            conf = conf_util.load_yaml_config_file(path)
        except HomeAssistantError as err:
            self.logger.error(err)
            return None

        conf = prepare_setup_component(self.hass, conf, self.domain)

        if conf is None:
            return None

        self.reset()
        return conf
コード例 #4
0
    def prepare_reload(self):
        """Prepare reloading this entity component."""
        try:
            path = conf_util.find_config_file(self.hass.config.config_dir)
            conf = conf_util.load_yaml_config_file(path)
        except HomeAssistantError as err:
            self.logger.error(err)
            return None

        conf = prepare_setup_component(self.hass, conf, self.domain)

        if conf is None:
            return None

        self.reset()
        return conf