Skip to content

Commit

Permalink
Merge pull request #3 from jbouwh/bug-fix
Browse files Browse the repository at this point in the history
Bug fix
  • Loading branch information
jbouwh authored Oct 27, 2021
2 parents 5cb87d9 + 89f2585 commit b0ada37
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ EXPOSE 10004

ENTRYPOINT ["omnikloggerproxy.py"]

CMD ["--config", "/config.yaml", "--settings", "/config.ini"]
CMD ["--settings", "/config.yaml", "--config", "/config.ini"]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ The supporting files are installed at the folder */usr/local/share/omnikdatalogg
### Command line
```
usage: omnikloggerproxy.py [-h] --serialnumber SERIALNUMBER [SERIALNUMBER ...]
[--config FILE Path to .yaml configuration file]
[--settings FILE Path to .yaml configuration file]
[--section Section to .yaml configuration file to use. Defaults to the first section found.]
[--settings FILE Path to configuration file (ini) (DECREPATED!)]
[--config FILE Path to configuration file (ini) (DECREPATED!)]
[--loglevel LOGLEVEL]
[--listenaddress LISTENADDRESS]
[--listenport LISTENPORT]
Expand Down
6 changes: 3 additions & 3 deletions omnikloggerproxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import datetime
import time

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

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

0 comments on commit b0ada37

Please sign in to comment.