Skip to content

Commit 55dac2e

Browse files
committed
Fix modules to reload previously active module rather than load it (which will make no change due to cacheing)
1 parent 353177a commit 55dac2e

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Diff for: appdaemon/appdaemon.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -1799,7 +1799,12 @@ def read_app(self, file, reload=False):
17991799
app = self.get_app_from_file(file)
18001800
if app is not None:
18011801
self.log("INFO", "Loading App Module: {}".format(file))
1802-
self.modules[module_name] = importlib.import_module(module_name)
1802+
if module_name not in self.modules:
1803+
self.modules[module_name] = importlib.import_module(module_name)
1804+
else:
1805+
# We previously imported it so we need to reload to pick up any potential changes
1806+
importlib.reload(self.modules[module_name])
1807+
18031808
elif "global_modules" in self.app_config and module_name in self.app_config["global_modules"]:
18041809
self.log("INFO", "Loading Global Module: {}".format(file))
18051810
self.modules[module_name] = importlib.import_module(module_name)

Diff for: docs/HISTORY.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ Change Log
1111
**Fixes**
1212

1313
- Fixed incorrect service call in ``set_value()``
14-
- Enforce domain name in rss feed target
14+
- Enforce domain name in rss feed target to avoid issues with other functions
15+
- Previously deleted modules will now be correctly reloaded to reflect changes
1516

1617
**Breaking Changes**
1718

0 commit comments

Comments
 (0)