瀏覽代碼

reload config file when hitting a config route

Maxime Alves LIRMM@home 3 年之前
父節點
當前提交
897093e27a
共有 1 個檔案被更改,包括 2 行新增0 行删除
  1. 2
    0
      pyheatpump/config.py

+ 2
- 0
pyheatpump/config.py 查看文件

@@ -103,6 +103,7 @@ async def set_config(request):
103 103
     return PlainTextResponse('OK')
104 104
 
105 105
 async def config_route(request, *args, **kwargs):
106
+    config.read(filenames=CONFIG_FILES)
106 107
     if request['method'] == 'GET':
107 108
         return await get_config(request)
108 109
     elif request['method'] == 'POST':
@@ -114,6 +115,7 @@ def get_mac():
114 115
 
115 116
 
116 117
 async def mac_route(request, *args, **kwargs):
118
+    config.read(filenames=CONFIG_FILES)
117 119
     if request['method'] == 'GET':
118 120
         return PlainTextResponse(get_mac())
119 121
     elif request['method'] == 'POST':

Loading…
取消
儲存