Code Monkey home page Code Monkey logo

Comments (6)

Sapd avatar Sapd commented on July 19, 2024

Its intended. There is a flag inside the battery variable which is set when its charging.
Its probably possible to get the level anyway, but it will most likely deviate/jump extremely (for example you would plug it in, charge will instantly go to 20%, you plug it out it would plumbed).
Thats because (in comparison to for example smartphones), battery value is often just derived from voltage, which is highly inaccurate. Smartphones count it by measuring the amount of energy (ampers cumulated) went through.

from headsetcontrol.

Novattz avatar Novattz commented on July 19, 2024

Its intended. There is a flag inside the battery variable which is set when its charging. Its probably possible to get the level anyway, but it will most likely deviate/jump extremely (for example you would plug it in, charge will instantly go to 20%, you plug it out it would plumbed). Thats because (in comparison to for example smartphones), battery value is often just derived from voltage, which is highly inaccurate. Smartphones count it by measuring the amount of energy (ampers cumulated) went through.

since u mentioned that its possible is it something that could be added? i dont really care if its inaccurate i just want a general percentage so it doesnt just say "charging"

from headsetcontrol.

Sapd avatar Sapd commented on July 19, 2024

since u mentioned that its possible is it something that could be added? i dont really care if its inaccurate i just want a general percentage so it doesnt just say "charging"

Possibly yes. You will have to take a look here:

if (data_read[4] == 0x01)

Problem is a bit, that the function currently can only return one thing (either the level or a status information). I can change that in the next version

from headsetcontrol.

Sapd avatar Sapd commented on July 19, 2024

When looking at it again, you can simply "fix it" for now, by just removing

    if (data_read[4] == 0x01)
        return BATTERY_CHARGING;

I first thought that it is saved as flag, but it is saved in a different byte so just removing that two lines should be sufficient.

from headsetcontrol.

Sapd avatar Sapd commented on July 19, 2024

I implemented it in: #333

Will be released in around two weeks I think

from headsetcontrol.

Sapd avatar Sapd commented on July 19, 2024

Released in latest version

from headsetcontrol.

Related Issues (20)

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.