diff --git a/src/log_statistics/agent.py b/src/log_statistics/agent.py index e8b3f9a..cdf6f2a 100644 --- a/src/log_statistics/agent.py +++ b/src/log_statistics/agent.py @@ -30,6 +30,7 @@ from volttron import utils from volttron.client.vip.agent import RPC, Agent, Core +from volttron.utils import ClientContext as cc from volttron.utils.time import get_aware_utc_now utils.setup_logging() @@ -71,8 +72,7 @@ def __init__(self, config: dict, **kwargs): self.last_std_dev_time = get_aware_utc_now() - # Getting volttron home env variable or using user/name as backup - volttron_home = os.getenv('VOLTTRON_HOME', os.path.expanduser("~") + '/volttron_home/') + volttron_home = cc.get_volttron_home() self.default_config = { "file_path": f"{volttron_home}/volttron.log",