diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 7c8d907..86d218f 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.9 +FROM python:3.10 RUN apt-get update \ && apt-get install -y --no-install-recommends \ @@ -7,7 +7,7 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* RUN python -m pip install --upgrade colorlog black pylint python-language-server -RUN python -m pip install --upgrade git+git://github.com/home-assistant/home-assistant.git@dev +RUN python -m pip install --upgrade homeassistant RUN cd && mkdir -p /config/custom_components diff --git a/.devcontainer/custom_component_helper b/.devcontainer/custom_component_helper index 39b0d92..cd4f448 100644 --- a/.devcontainer/custom_component_helper +++ b/.devcontainer/custom_component_helper @@ -13,7 +13,7 @@ function StartHomeAssistant { } function UpdgradeHomeAssistantDev { - python -m pip install --upgrade git+git://github.com/home-assistant/home-assistant.git@dev + python -m pip install --upgrade homeassistant } function SetHomeAssistantVersion { diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 69a38a8..aed0b90 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,6 +1,6 @@ // See https://aka.ms/vscode-remote/devcontainer.json for format details. { - "name": "ESXI Stats dev", + "name": "ynab dev", "context": "..", "dockerFile": "Dockerfile", "appPort": "8124:8123", diff --git a/custom_components/ynab/__init__.py b/custom_components/ynab/__init__.py index 97d43ca..e9378a8 100644 --- a/custom_components/ynab/__init__.py +++ b/custom_components/ynab/__init__.py @@ -104,6 +104,12 @@ def __init__(self, hass, config): self.categories = config[DOMAIN].get("categories") self.accounts = config[DOMAIN].get("accounts") + self.ynab = None + self.all_budgets = None + self.get_all_budgets = None + self.raw_budget = None + self.get_data = None + @Throttle(MIN_TIME_BETWEEN_UPDATES) async def update_data(self): """Update data.""" @@ -235,10 +241,10 @@ async def update_data(self): async def check_files(hass): """Return bool that indicates if all files are present.""" - base = "{}/custom_components/{}/".format(hass.config.path(), DOMAIN) + base = f"{hass.config.path()}/custom_components/{DOMAIN}/" missing = [] for file in REQUIRED_FILES: - fullpath = "{}{}".format(base, file) + fullpath = f"{base}{file}" if not os.path.exists(fullpath): missing.append(file) diff --git a/custom_components/ynab/const.py b/custom_components/ynab/const.py index 13b331c..edcee33 100644 --- a/custom_components/ynab/const.py +++ b/custom_components/ynab/const.py @@ -1,10 +1,10 @@ """Constants for YNAB integration.""" DOMAIN = "ynab" -DOMAIN_DATA = "{}_data".format(DOMAIN) +DOMAIN_DATA = f"{DOMAIN}_data" PLATFORMS = ["sensor"] REQUIRED_FILES = ["const.py", "manifest.json", "sensor.py"] -VERSION = "0.1.10" +VERSION = "0.1.12" ISSUE_URL = "https://github.com/wxt9861/ynab/issues" STARTUP = """ diff --git a/custom_components/ynab/manifest.json b/custom_components/ynab/manifest.json index 234dcf1..d66c984 100644 --- a/custom_components/ynab/manifest.json +++ b/custom_components/ynab/manifest.json @@ -5,6 +5,6 @@ "issue_tracker": "https://github.com/wxt9861/ynab/issues", "dependencies": [], "codeowners": ["@wxt9861"], - "requirements": ["ynab-sdk==0.2.5"], - "version": "0.1.11" + "requirements": ["ynab-sdk==0.4.0"], + "version": "0.1.12" }