Giter Site home page Giter Site logo

Comments (4)

dbochicchio avatar dbochicchio commented on July 16, 2024 1

| but you agreed to my proposed change, right 🤔

you know, it looked good in theory, but then I discovered it won't work for my edge case. no problem, I'm not complaining at all. Thanks for the hard work ;)

from ecovacs-deebot.js.

mrbungle64 avatar mrbungle64 commented on July 16, 2024

Hi @dbochicchio

the latest iteration of the lib has broken my code, since I was watching for MoppingSystemInfo to get the status, even when not mopping.

but you agreed to my proposed change, right 🤔
#80 (comment)

The idea behind it is to carry both water info (if present) and clean info (I'm calling it from cleanspeed as well and maybe the function name is not fitting anymore). What do you think?

It's ok for me. I will change it later today.

from ecovacs-deebot.js.

mrbungle64 avatar mrbungle64 commented on July 16, 2024

@dbochicchio

Please check if this fits for your use case:

emitMoppingSystemReport() {
    const vacuumPowerAdjustmentOk = !this.bot.hasVacuumPowerAdjustment() || (this.bot.cleanSpeed !== null);
    const moppingSystemOk = !this.bot.hasMoppingSystem() || (this.bot.waterLevel !== null);
    if (vacuumPowerAdjustmentOk && moppingSystemOk) {
        let r = {
            'cleanStatus': this.bot.cleanReport
        };
        if (this.bot.hasVacuumPowerAdjustment() && (this.bot.cleanSpeed !== null)) {
            r['cleanInfo'] = {
                'level': this.bot.cleanSpeed
            }
        }
        if (this.bot.hasMoppingSystem() && (this.bot.waterLevel !== null)) {
            r['waterInfo'] = {
                'enabled': Boolean(Number(this.bot.waterboxInfo || 0)),
                'level': this.bot.waterLevel
            }
        }
        this.emit("MoppingSystemInfo", r);
    }
}

from ecovacs-deebot.js.

mrbungle64 avatar mrbungle64 commented on July 16, 2024

@dbochicchio

I just made a commit based on my proposal from yesterday.

from ecovacs-deebot.js.

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.