Giter Club home page Giter Club logo

battery-notify's People

Contributors

cdown avatar dependabot[bot] avatar linsallyzhao avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

battery-notify's Issues

Do checked_sub on duration/intervals

This needs some more thinking, because we also need to handle what to do if Instant::now() is too low. Maybe always just bump it by sleep_backoff?

Check drift behaviour

Seems fairly likely the anti drift isn't working right:

May 05 11:31:05 roujiamo sh[266462]: [2023-05-05T10:31:05Z INFO  battery_notify] Battery status: [Battery { state: NotCharging, now_uwh: 39330000, full_uwh: 56970000 }]
May 05 11:31:05 roujiamo sh[266462]: [2023-05-05T10:31:05Z INFO  battery_notify] Global status: Battery { state: AtThreshold, now_uwh: 39330000, full_uwh: 56970000 }
May 05 11:31:05 roujiamo sh[266462]: [2023-05-05T10:31:05Z INFO  battery_notify] Bluetooth battery status: []
May 05 11:33:05 roujiamo sh[266462]: [2023-05-05T10:33:05Z INFO  battery_notify] Battery status: [Battery { state: NotCharging, now_uwh: 39320000, full_uwh: 56970000 }]
May 05 11:33:05 roujiamo sh[266462]: [2023-05-05T10:33:05Z INFO  battery_notify] Global status: Battery { state: AtThreshold, now_uwh: 39320000, full_uwh: 56970000 }
May 05 11:33:06 roujiamo sh[266462]: [2023-05-05T10:33:05Z INFO  battery_notify] Bluetooth battery status: []
May 05 11:35:06 roujiamo sh[266462]: [2023-05-05T10:35:06Z INFO  battery_notify] Battery status: [Battery { state: NotCharging, now_uwh: 39320000, full_uwh: 56970000 }]
May 05 11:35:06 roujiamo sh[266462]: [2023-05-05T10:35:06Z INFO  battery_notify] Global status: Battery { state: AtThreshold, now_uwh: 39320000, full_uwh: 56970000 }
May 05 11:35:06 roujiamo sh[266462]: [2023-05-05T10:35:06Z INFO  battery_notify] Bluetooth battery status: []
May 05 11:37:06 roujiamo sh[266462]: [2023-05-05T10:37:06Z INFO  battery_notify] Battery status: [Battery { state: NotCharging, now_uwh: 39320000, full_uwh: 56970000 }]
May 05 11:37:06 roujiamo sh[266462]: [2023-05-05T10:37:06Z INFO  battery_notify] Global status: Battery { state: AtThreshold, now_uwh: 39320000, full_uwh: 56970000 }
May 05 11:37:06 roujiamo sh[266462]: [2023-05-05T10:37:06Z INFO  battery_notify] Bluetooth battery status: []
May 05 11:39:06 roujiamo sh[266462]: [2023-05-05T10:39:06Z INFO  battery_notify] Battery status: [Battery { state: NotCharging, now_uwh: 39320000, full_uwh: 56970000 }]
May 05 11:39:06 roujiamo sh[266462]: [2023-05-05T10:39:06Z INFO  battery_notify] Global status: Battery { state: AtThreshold, now_uwh: 39320000, full_uwh: 56970000 }
May 05 11:39:06 roujiamo sh[266462]: [2023-05-05T10:39:06Z INFO  battery_notify] Bluetooth battery status: []
May 05 11:41:06 roujiamo sh[266462]: [2023-05-05T10:41:06Z INFO  battery_notify] Battery status: [Battery { state: NotCharging, now_uwh: 39320000, full_uwh: 56970000 }]
May 05 11:41:06 roujiamo sh[266462]: [2023-05-05T10:41:06Z INFO  battery_notify] Global status: Battery { state: AtThreshold, now_uwh: 39320000, full_uwh: 56970000 }
May 05 11:41:06 roujiamo sh[266462]: [2023-05-05T10:41:06Z INFO  battery_notify] Bluetooth battery status: []
May 05 11:43:06 roujiamo sh[266462]: [2023-05-05T10:43:06Z INFO  battery_notify] Battery status: [Battery { state: NotCharging, now_uwh: 39320000, full_uwh: 56970000 }]
May 05 11:43:06 roujiamo sh[266462]: [2023-05-05T10:43:06Z INFO  battery_notify] Global status: Battery { state: AtThreshold, now_uwh: 39320000, full_uwh: 56970000 }
May 05 11:43:06 roujiamo sh[266462]: [2023-05-05T10:43:06Z INFO  battery_notify] Bluetooth battery status: []
May 05 11:45:06 roujiamo sh[266462]: [2023-05-05T10:45:06Z INFO  battery_notify] Battery status: [Battery { state: NotCharging, now_uwh: 39320000, full_uwh: 56970000 }]
May 05 11:45:06 roujiamo sh[266462]: [2023-05-05T10:45:06Z INFO  battery_notify] Global status: Battery { state: AtThreshold, now_uwh: 39320000, full_uwh: 56970000 }
May 05 11:45:06 roujiamo sh[266462]: [2023-05-05T10:45:06Z INFO  battery_notify] Bluetooth battery status: []
May 05 11:47:06 roujiamo sh[266462]: [2023-05-05T10:47:06Z INFO  battery_notify] Battery status: [Battery { state: NotCharging, now_uwh: 39320000, full_uwh: 56970000 }]
May 05 11:47:06 roujiamo sh[266462]: [2023-05-05T10:47:06Z INFO  battery_notify] Global status: Battery { state: AtThreshold, now_uwh: 39320000, full_uwh: 56970000 }
May 05 11:47:06 roujiamo sh[266462]: [2023-05-05T10:47:06Z INFO  battery_notify] Bluetooth battery status: []
May 05 11:49:06 roujiamo sh[266462]: [2023-05-05T10:49:06Z INFO  battery_notify] Battery status: [Battery { state: NotCharging, now_uwh: 39320000, full_uwh: 56970000 }]
May 05 11:49:06 roujiamo sh[266462]: [2023-05-05T10:49:06Z INFO  battery_notify] Global status: Battery { state: AtThreshold, now_uwh: 39320000, full_uwh: 56970000 }
May 05 11:49:06 roujiamo sh[266462]: [2023-05-05T10:49:06Z INFO  battery_notify] Bluetooth battery status: []
May 05 11:51:06 roujiamo sh[266462]: [2023-05-05T10:51:06Z INFO  battery_notify] Battery status: [Battery { state: NotCharging, now_uwh: 39320000, full_uwh: 56970000 }]
May 05 11:51:06 roujiamo sh[266462]: [2023-05-05T10:51:06Z INFO  battery_notify] Global status: Battery { state: AtThreshold, now_uwh: 39320000, full_uwh: 56970000 }
May 05 11:51:06 roujiamo sh[266462]: [2023-05-05T10:51:06Z INFO  battery_notify] Bluetooth battery status: []
May 05 11:53:06 roujiamo sh[266462]: [2023-05-05T10:53:06Z INFO  battery_notify] Battery status: [Battery { state: NotCharging, now_uwh: 39320000, full_uwh: 56970000 }]
May 05 11:53:06 roujiamo sh[266462]: [2023-05-05T10:53:06Z INFO  battery_notify] Global status: Battery { state: AtThreshold, now_uwh: 39320000, full_uwh: 56970000 }
May 05 11:53:06 roujiamo sh[266462]: [2023-05-05T10:53:06Z INFO  battery_notify] Bluetooth battery status: []
May 05 11:55:06 roujiamo sh[266462]: [2023-05-05T10:55:06Z INFO  battery_notify] Battery status: [Battery { state: NotCharging, now_uwh: 39320000, full_uwh: 56970000 }]
May 05 11:55:06 roujiamo sh[266462]: [2023-05-05T10:55:06Z INFO  battery_notify] Global status: Battery { state: AtThreshold, now_uwh: 39320000, full_uwh: 56970000 }
May 05 11:55:06 roujiamo sh[266462]: [2023-05-05T10:55:06Z INFO  battery_notify] Bluetooth battery status: []
May 05 11:57:06 roujiamo sh[266462]: [2023-05-05T10:57:06Z INFO  battery_notify] Battery status: [Battery { state: NotCharging, now_uwh: 39320000, full_uwh: 56970000 }]
May 05 11:57:06 roujiamo sh[266462]: [2023-05-05T10:57:06Z INFO  battery_notify] Global status: Battery { state: AtThreshold, now_uwh: 39320000, full_uwh: 56970000 }
May 05 11:57:06 roujiamo sh[266462]: [2023-05-05T10:57:06Z INFO  battery_notify] Bluetooth battery status: []
May 05 11:59:06 roujiamo sh[266462]: [2023-05-05T10:59:06Z INFO  battery_notify] Battery status: [Battery { state: NotCharging, now_uwh: 39320000, full_uwh: 56970000 }]
May 05 11:59:06 roujiamo sh[266462]: [2023-05-05T10:59:06Z INFO  battery_notify] Global status: Battery { state: AtThreshold, now_uwh: 39320000, full_uwh: 56970000 }
May 05 11:59:06 roujiamo sh[266462]: [2023-05-05T10:59:06Z INFO  battery_notify] Bluetooth battery status: []
May 05 12:01:07 roujiamo sh[266462]: [2023-05-05T11:01:07Z INFO  battery_notify] Battery status: [Battery { state: NotCharging, now_uwh: 39300000, full_uwh: 56970000 }]
May 05 12:01:07 roujiamo sh[266462]: [2023-05-05T11:01:07Z INFO  battery_notify] Global status: Battery { state: AtThreshold, now_uwh: 39300000, full_uwh: 56970000 }
May 05 12:01:07 roujiamo sh[266462]: [2023-05-05T11:01:07Z INFO  battery_notify] Bluetooth battery status: []
May 05 12:03:07 roujiamo sh[266462]: [2023-05-05T11:03:07Z INFO  battery_notify] Battery status: [Battery { state: NotCharging, now_uwh: 39300000, full_uwh: 56970000 }]
May 05 12:03:07 roujiamo sh[266462]: [2023-05-05T11:03:07Z INFO  battery_notify] Global status: Battery { state: AtThreshold, now_uwh: 39300000, full_uwh: 56970000 }
May 05 12:03:07 roujiamo sh[266462]: [2023-05-05T11:03:07Z INFO  battery_notify] Bluetooth battery status: []

Go through error handling and validate it make sense

Some general thoughts:

  1. We should make sure connection errors would only error at the point of connection, and terminate the program if failed.
  2. We should make sure transient errors don't just get shoved into an .unwrap_or(), and actually show an error.

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.