Skip to content

Commit

Permalink
⬆️ Upgrades AppDaemon to 4.2.0 (#183)
Browse files Browse the repository at this point in the history
* ⬆️ Upgrades AppDaemon to 4.2.0

* Update patch
  • Loading branch information
frenck authored Jan 7, 2022
1 parent a7b2055 commit ecf046d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion appdaemon/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
appdaemon==4.1.0
appdaemon==4.2.0
15 changes: 6 additions & 9 deletions appdaemon/rootfs/patches/hassio.patch
Original file line number Diff line number Diff line change
@@ -1,30 +1,27 @@
diff --git a/appdaemon/plugins/hass/hassplugin.py b/appdaemon/plugins/hass/hassplugin.py
index 702d0f14..be41de18 100644
--- a/appdaemon/plugins/hass/hassplugin.py
+++ b/appdaemon/plugins/hass/hassplugin.py
@@ -9,6 +9,7 @@ from deepdiff import DeepDiff
import datetime
@@ -11,6 +11,7 @@ import datetime
from urllib.parse import quote
from urllib.parse import urlencode
from typing import Union
+import os

import appdaemon.utils as utils
from appdaemon.appdaemon import AppDaemon
@@ -63,11 +64,17 @@ class HassPlugin(PluginBase):
@@ -65,11 +66,17 @@ class HassPlugin(PluginBase):

if "token" in args:
self.token = args["token"]
+ elif "SUPERVISOR_TOKEN" in os.environ:
+ self.token = os.environ.get('SUPERVISOR_TOKEN')
+ self.AD.config["plugins"][name]["token"] = self.token
else:
self.token = None

if "ha_url" in args:
self.ha_url = args["ha_url"]
+ elif "SUPERVISOR_TOKEN" in os.environ:
+ self.ha_url = "http://supervisor/core"
+ self.AD.config["plugins"][name]["ha_url"] = self.ha_url
else:
self.logger.warning("ha_url not found in HASS configuration - module not initialized")

0 comments on commit ecf046d

Please sign in to comment.