Browse Source

[conf] added API configuration parameters

Maxime Alves LIRMM@home 3 years ago
parent
commit
d94318dc50
1 changed files with 7 additions and 0 deletions
  1. 7
    0
      pyheatpump/conf.py

+ 7
- 0
pyheatpump/conf.py View File

@@ -26,6 +26,10 @@ default_config = {
26 26
         'auth': 'None',
27 27
         'initialization': str(datetime.now()),
28 28
         'heatpump_id': 'None'
29
+    },
30
+    'api': {
31
+        'host': '127.0.0.1',
32
+        'port': 80
29 33
     }
30 34
 }
31 35
 
@@ -38,6 +42,9 @@ config = ConfigParser(
38 42
 config.read_dict(default_config)
39 43
 config.read(filenames=CONFIG_FILES)
40 44
 
45
+API_HOST=conf.get('api', 'host')
46
+API_PORT=conf.get('api', 'port')
47
+
41 48
 async def get_config(request):
42 49
     items = dict([ (
43 50
         section, dict([ (key, config.get(section, key)) for key in items ])

Loading…
Cancel
Save