Skip to content

Commit b0ada37

Browse files
authored
Merge pull request #3 from jbouwh/bug-fix
Bug fix
2 parents 5cb87d9 + 89f2585 commit b0ada37

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ EXPOSE 10004
2323

2424
ENTRYPOINT ["omnikloggerproxy.py"]
2525

26-
CMD ["--config", "/config.yaml", "--settings", "/config.ini"]
26+
CMD ["--settings", "/config.yaml", "--config", "/config.ini"]

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ The supporting files are installed at the folder */usr/local/share/omnikdatalogg
1414
### Command line
1515
```
1616
usage: omnikloggerproxy.py [-h] --serialnumber SERIALNUMBER [SERIALNUMBER ...]
17-
[--config FILE Path to .yaml configuration file]
17+
[--settings FILE Path to .yaml configuration file]
1818
[--section Section to .yaml configuration file to use. Defaults to the first section found.]
19-
[--settings FILE Path to configuration file (ini) (DECREPATED!)]
19+
[--config FILE Path to configuration file (ini) (DECREPATED!)]
2020
[--loglevel LOGLEVEL]
2121
[--listenaddress LISTENADDRESS]
2222
[--listenport LISTENPORT]

omnikloggerproxy.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import datetime
2727
import time
2828

29-
__version__ = '1.4.0'
29+
__version__ = '1.4.1'
3030
listenaddress = b'127.0.0.1' # Default listenaddress
3131
listenport = 10004 # Make sure your firewall enables you listening at this port
3232
# There is no need to change this if this proxy must log your data directly to the Omnik/SolarmanPV servers
@@ -437,7 +437,7 @@ def get_yaml_setting(settings, section, key, default):
437437
"CRITICAL": logging.CRITICAL
438438
}
439439

440-
if os.path.isfile(args.config):
440+
if os.path.isfile(args.settings):
441441
settings = get_yaml_settings(args)
442442
args.mqtt_host = get_yaml_setting(settings, 'output.mqtt', 'host', args.mqtt_host)
443443
args.mqtt_port = get_yaml_setting(settings, 'output.mqtt', 'port', args.mqtt_port)
@@ -461,7 +461,7 @@ def get_yaml_setting(settings, section, key, default):
461461
args.listenport = get_yaml_setting(settings, 'proxy', 'listenport', args.listenport)
462462
args.omniklogger = get_yaml_setting(settings, 'proxy', 'omniklogger', args.omniklogger)
463463
args.omnikloggerport = get_yaml_setting(settings, 'proxy', 'omnikloggerport', args.omnikloggerport)
464-
elif os.path.isfile(args.settings):
464+
elif os.path.isfile(args.config):
465465
c = configparser.ConfigParser(converters={'list': lambda x: [i.strip() for i in x.split(',')]})
466466
c.read([args.config], encoding='utf-8')
467467
args.mqtt_host = c.get('output.mqtt', 'host', fallback=args.mqtt_host)

0 commit comments

Comments
 (0)