Skip to content
Snippets Groups Projects
Commit 760bf337 authored by Hannes Feldt's avatar Hannes Feldt
Browse files

fix

parent 7ed695a3
Branches
No related tags found
No related merge requests found
Pipeline #94959 failed
...@@ -78,7 +78,7 @@ def main(): ...@@ -78,7 +78,7 @@ def main():
opcuaserv.AddVarR("TR_software_version_R",git_hash+"_"+args.config,[],False) opcuaserv.AddVarR("TR_software_version_R",git_hash+"_"+args.config,[],False)
for i,name in enumerate(I2Cports): for i,name in enumerate(I2Cports):
RCU_I2C=I2Cclients[i] RCU_I2C=I2Cclients[i]
RCU_conf=yamlreader.yamlreader(RCU_I2C,yamlfile=f"/etc/hwtr/{name}.yaml") RCU_conf=yamlreader.yamlreader(RCU_I2C,yamlfile=name)
RCU_conf.AddVars(opcuaserv.AddVarR,opcuaserv.AddVarW) RCU_conf.AddVars(opcuaserv.AddVarR,opcuaserv.AddVarW)
RCU_conf.AddMethod(opcuaserv.Addmethod) RCU_conf.AddMethod(opcuaserv.Addmethod)
RCU_conf.CallInit(); RCU_conf.CallInit();
......
...@@ -32,8 +32,7 @@ class yamlconfig(): ...@@ -32,8 +32,7 @@ class yamlconfig():
if yamlfile.split('.')[-1]=='yaml': if yamlfile.split('.')[-1]=='yaml':
self.conf=yaml.load(open(yamlfile), Loader=yaml.FullLoader) self.conf=yaml.load(open(yamlfile), Loader=yaml.FullLoader)
else: else:
pkg = importlib_resources.files("pypcc") pkg_data_file = "/etc/hwtr/" + (yamlfile+'.yaml')
pkg_data_file = pkg / "config" / (yamlfile+'.yaml')
self.conf=yaml.load(pkg_data_file.open(), Loader=yaml.FullLoader) self.conf=yaml.load(pkg_data_file.open(), Loader=yaml.FullLoader)
self.expand_variables() self.expand_variables()
# print([[v['name'],v.get('devreg')] for v in var1]) # print([[v['name'],v.get('devreg')] for v in var1])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment