From 76e0cd546b77fec2a333afc504d76118cb9b6c21 Mon Sep 17 00:00:00 2001 From: riley206 Date: Mon, 18 Mar 2024 13:26:24 -0700 Subject: [PATCH] getting volttron home uasing clientContext --- src/log_statistics/agent.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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",