Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello - I get your great code and try to make it working for more than 1 device. I did it, so I'd like to share it with you. Unfortunately I don't use git hub from the beginning, so I can't show you the working code, because I broke something at very end, and now it raises segfault - but maybe you can find the little wrong piece.
How it works - I decided not to use one program for all devices, but one program for one device. So if you run the program without any args, it will looks for devices. If it finds only one - it goes further, if finds more - shows serials and exits. In that case you have to run it with -s arg example cm160 -s AA001234 - in that case program finds only one matching device and goes further.
You choose the weekend/week tariff, but it is rather useless because of many different kinds of tariff - so I decided to change the stat tables - I remove column kwh_week_total and kwh_weekend_total and add kwh_0_total,kwh_1_total etc, and I planned to sum columns to get week/weekend or many other tariffs
Sorry for changing {} but this standard is too hard to me.
Now I'm stuck in update_stat_db - the program enters it, executes sqls, but then segfaults and no changes in database...I can't debug it... So maybe you have a little piece of time?