Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combined cleaninfo+waterinfo #80

Merged
merged 2 commits into from
May 9, 2021
Merged

Conversation

dbochicchio
Copy link
Contributor

Hey @mrbungle64 I've added a new event to combine cleaning status with waterinfo. This makes easier in my MQTT bridge to get the real status (ie: mopping or cleaning) in a central and unique place.

Copy link
Owner

@mrbungle64 mrbungle64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Implement method for duplicate code

@mrbungle64 mrbungle64 merged commit a2ed79f into mrbungle64:master May 9, 2021
@mrbungle64
Copy link
Owner

Hey @mrbungle64 I've added a new event to combine cleaning status with waterinfo. This makes easier in my MQTT bridge to get the real status (ie: mopping or cleaning) in a central and unique place.

Hi @dbochicchio

I thinkk we have to rename the "CleanReportDetails" event because some models don't have a mopping system.

Which name do you prefer?

  • CleanReportWaterbox
  • CleanReportWaterInfo
  • CleanReportWaterboxInfo

@mrbungle64
Copy link
Owner

@dbochicchio

Do we still need the "Waterinfo" event? I think we can remove it ...

this.emit("WaterInfo", {
    'enabled': this.bot.waterboxInfo,
    'level': this.bot.waterLevel
});

@mrbungle64
Copy link
Owner

@dbochicchio

I also would like to convert waterboxInfo (enabled attribute) to boolean:

{
  "status": "idle",
  "waterInfo": {
    "enabled": false,
    "level": 4
  }
}

@mrbungle64
Copy link
Owner

mrbungle64 commented May 9, 2021

@dbochicchio

I want to use the event name MoppingSystemInfo and rename the status attribute to cleanStatus (see commit 60aeab5)
I think it represents that better.

{
  "cleanStatus": "idle",
  "waterInfo": {
    "enabled": false,
    "level": 4
  }
}
emitMoppingSystemReport() {
    if (this.bot.hasMoppingSystem() && this.bot.waterLevel && (this.bot.waterboxInfo !== null)) {
        this.emit("MoppingSystemInfo", {
            'cleanStatus': this.bot.cleanReport,
            'waterInfo': {
                'enabled': Boolean(Number(this.bot.waterboxInfo)),
                'level': this.bot.waterLevel
            }
        });
    }
}

@dbochicchio
Copy link
Contributor Author

@mrbungle64 it's ok for me. I'm using this event to understand when it's starting and if it's mopping or just cleaning, by looking at enabled. You're the maintainer, so it's up to you, I'm good with anything you'll pick ;)

@mrbungle64 mrbungle64 mentioned this pull request May 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants