Browse Source

reload config file when hitting a config route

Maxime Alves LIRMM@home 3 years ago
parent
commit
897093e27a
1 changed files with 2 additions and 0 deletions
  1. 2
    0
      pyheatpump/config.py

+ 2
- 0
pyheatpump/config.py View File

@@ -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…
Cancel
Save