-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
⬆️ Upgrades AppDaemon to 4.2.0 (#183)
* ⬆️ Upgrades AppDaemon to 4.2.0 * Update patch
- Loading branch information
Showing
2 changed files
with
7 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
appdaemon==4.1.0 | ||
appdaemon==4.2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | ||
|