()
return installed_addons
Get the git hash to save with data to ensure reproducibility.
Get the git hash to save with data to ensure reproducibility.
Get the git hash to save with data to ensure reproducibility .
def get_addons():
    """Get the git hash to save with data to ensure reproducibility."""
    try:
        output = subprocess.check_output(["ha", "addons", "--raw-json"])
    except FileNotFoundError:
        # the 'ha' program isn't available in the host image, I can only
        # run it from the 'SSH & Web Terminal' Add-on.
        return None
    raw = output.decode("utf-8")
    addons = json.loads(raw)["data"]
    installed_addons = [addon for addon in addons["addons"] if addon["installed"]]
    return installed_addons
def get_addons ( ) : try : output = subprocess . check_output ( [ "ha" , "addons" , "--raw-json" ] ) except FileNotFoundError : # the 'ha' program isn't available in the host image, I can only # run it from the 'SSH & Web Terminal' Add-on. return None raw = output . decode ( "utf-8" ) addons = json . loads ( raw ) [ "data" ] installed_addons = [ addon for addon in addons [ "addons" ] if addon [ "installed" ] ] return installed_addons