You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With following changes I could get the ha-constant-modifier to work with HA 2023.10:
Updated imports:
from homeassistant.core import HomeAssistant
from homeassistant.config import load_yaml_config_file, YAML_CONFIG_FILE
from homeassistant.__main__ import get_arguments
from homeassistant.util.yaml import SECRET_YAML, Secrets, load_yaml
here is the updated def get_ha_config() to use the required config file parameter and the secrets parameter.
PS: From the code it appears that Secret is optional and defaults to Null, but since I use Secrets includes in my config I guess this must be specified as well when you want to duplicate the changed HA startup sequence
def get_ha_config():
"""
Duplicate enough of the HA startup sequence to extract the config *really* early.
"""
args = get_arguments()
try:
hass = HomeAssistant() # pylint: disable=no-value-for-parameter
hass.config.config_dir = os.path.abspath(os.path.join(os.getcwd(), args.config))
except TypeError:
hass = HomeAssistant(os.path.abspath(os.path.join(os.getcwd(), args.config))) # pylint: disable=too-many-function-args
return load_yaml_config_file(hass.config.path(YAML_CONFIG_FILE),Secrets(hass.config.path(hass.config.config_dir)))
The text was updated successfully, but these errors were encountered:
Seems the last change to this is quite old and it causes configuration load exceptions for the home assistant object since it has now mandatory arguments as described here:
https://developers.home-assistant.io/blog/2023/08/29/homeassistant-changed-signature?_highlight=homeassistant%28
With following changes I could get the ha-constant-modifier to work with HA 2023.10:
Updated imports:
here is the updated def get_ha_config() to use the required config file parameter and the secrets parameter.
PS: From the code it appears that Secret is optional and defaults to Null, but since I use Secrets includes in my config I guess this must be specified as well when you want to duplicate the changed HA startup sequence
The text was updated successfully, but these errors were encountered: