Giter VIP home page Giter VIP logo

battery-status's People

Contributors

anarcat avatar petterreinholdtsen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

battery-status's Issues

old python graphing script broken

the python script i wrote is still in the package, but not the default and worse, it's actually broken now:

$ battery-log | ./src/battery-stats-graph
loading CSV file <open file '<stdin>', mode 'r' at 0x7f11f0fe10c0> with builtin CSV module
building data array
guessing expiry
Traceback (most recent call last):
  File "./src/battery-stats-graph", line 190, in <module>
    death = guess_expiry(data[full], data['timestamp'], zero)
  File "./src/battery-stats-graph", line 162, in guess_expiry
    fit = np.polyfit(data[full], data['timestamp'], 1)
  File "/usr/lib/python2.7/dist-packages/numpy/lib/polynomial.py", line 581, in polyfit
    c, resids, rank, s = lstsq(lhs, rhs, rcond)
  File "/usr/lib/python2.7/dist-packages/numpy/linalg/linalg.py", line 1867, in lstsq
    0, work, lwork, iwork, 0)
ValueError: On entry to DLASCL parameter number 4 had an illegal value

my guess is that it wasn't adapted to the new CSV structure, or not correctly. it fails at guessing the death of the battery, above...

cron mail clutter when no batteries connected

/usr/share/battery-stats/collect-csv prints errors when no batteries are connected, resulting in cron mail clutter like

-----8<------
Subject: Cron root@localhost if [ -x /usr/share/battery-stats/collect-csv ]; then /usr/share/battery-stats/collect-csv ; fi (failed)

/usr/share/battery-stats/collect-csv: line 86: cd: BAT*: No such file or directory
-----8<------

Support multiple batteries in battery-status-graph

battery-status-collect will collect statistics for all batteries that are present on the system, however battery-status-graph assumes that there is only one battery in the log file.

It would be great if battery-status-graph was able to generate separate graphs for each different battery.

cannot read old CSV files

for some reason, this software cannot read the files created from the older "battery-status" version. i get this error:

$ /usr/share/battery-stats/battery-stats-graph /var/log/hjemmenett-battery-status.log
loading CSV file <open file '/var/log/hjemmenett-battery-status.log', mode 'r' at 0x7fba9dc6e420> with builtin CSV module
Traceback (most recent call last):
  File "/usr/share/battery-stats/battery-stats-graph", line 171, in <module>
    data = parse_csv()
  File "/usr/share/battery-stats/battery-stats-graph", line 74, in parse_csv_builtin
    if '' == row[f]:
KeyError: 'charge_now'

is there a way to convert the files over? my original python version still works:

$ ~/src/battery-status/battery-status-graph.py /var/log/hjemmenett-battery-status.log
loading CSV file <open file '/var/log/hjemmenett-battery-status.log', mode 'r' at 0x7fe9238b6420> with builtin CSV module
building data array
guessing expiry
this battery will reach end of life (5%) in 904 days, 23:22:16.832222, on 2018-09-15 16:08:27.770046
building graph
drawing on tty

... and crap, it looks like my battery is already at 80% effective capacity!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.