Giter VIP home page Giter VIP logo

Comments (3)

ChristophCaina avatar ChristophCaina commented on May 18, 2024

I did some tests with changing the unit_of_measurement - and noticed, that it's looking better when it is like it is right now.
Changing the "hr" to "h" as given in the specs, would change how the Entities List will display the value...

Unfortunately, with the current Setup, the unit of measurement will not be translated, which is looking a bit weired in a translated UI...

:-(

from dreame-vacuum.

ChristophCaina avatar ChristophCaina commented on May 18, 2024

I've searched a bit deeper... and one thing isn't quite clear to me:

why does the integration use different units here?
grafik

I think, it would make sense to implement some calculation logic like:

if value > 24 hrs --> use days
else use hrs.

this is what's given in the core/const.py

TIME_MILLISECONDS: Final = "ms"
"""Deprecated: please use UnitOfTime.MILLISECONDS."""
TIME_SECONDS: Final = "s"
"""Deprecated: please use UnitOfTime.SECONDS."""
TIME_MINUTES: Final = "min"
"""Deprecated: please use UnitOfTime.MINUTES."""
TIME_HOURS: Final = "h"
"""Deprecated: please use UnitOfTime.HOURS."""
TIME_DAYS: Final = "d"
"""Deprecated: please use UnitOfTime.DAYS."""
TIME_WEEKS: Final = "w"
"""Deprecated: please use UnitOfTime.WEEKS."""
TIME_MONTHS: Final = "m"
"""Deprecated: please use UnitOfTime.MONTHS."""
TIME_YEARS: Final = "y"
"""Deprecated: please use UnitOfTime.YEARS."""

So - I think it should be possible to calculate the values not only for days and hours, but for weeks or years...
Or does the robot provide the values in days and hours?

After changing the Unit_of_measurement from "days" to "d" and "hr" to "h"
I am getting this
grafik

before:
grafik

from dreame-vacuum.

Tasshack avatar Tasshack commented on May 18, 2024

I did some tests with changing the unit_of_measurement - and noticed, that it's looking better when it is like it is right now.

I did think the same thing and thats why this is implemented this way.

why does the integration use different units here?

All of the values directly read from the device and some values implemeted as days instead of hours on the device itself for keeping it under 16bit integer (65535). Your suggestion will result losing presicion of the values returning in hours from the device.

from dreame-vacuum.

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.