Skip to content

Commit

Permalink
* (Apollon77) Add support for additional MAP100 air purifier data
Browse files Browse the repository at this point in the history
  • Loading branch information
Apollon77 committed Sep 19, 2022
1 parent cc1e0bc commit bec5f27
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ see example folder
The library is partially based on the Python project https://github.com/albertogeniola/MerossIot, Thank you for this great basic work on how to connect to the Meross Cloud Servers

## Changelog

### __WORK IN PROGRESS__
* (Apollon77) Add support for additional MAP100 air purifier data

### 2.2.0 (2022-09-04)
* (Apollon77) Add support for FilterMaintenance data of MAP100 air purifier
* (Apollon77) Fix typings: messageId returned by many calls is a string and not a number
Expand Down
4 changes: 4 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ declare module 'meross-cloud' {
getRollerShutterState(callback: Callback<any>): MessageId
getRollerShutterPosition(callback: Callback<any>): MessageId
getFilterMaintenance(callback: Callback<any>): MessageId
getPhysicalLockState(callback: Callback<any>): MessageId
getFanState(callback: Callback<any>): MessageId

controlToggle(onoff: boolean, callback: Callback<any>): MessageId
controlToggleX(channel: number, onoff: boolean, callback: Callback<any>): MessageId
Expand All @@ -140,6 +142,8 @@ declare module 'meross-cloud' {
controlDiffusorSpray(type: string, channel: number, mode: number, callback: Callback<any>): MessageId
controlDiffusorLight(type: string, light: LightData, callback: Callback<any>): MessageId
controlThermostatMode(channel: number, modeData: ThermostatModeData, callback: Callback<any>): MessageId
controlPhysicalLock(channel: number, locked: boolean, callback: Callback<any>): MessageId
controlFan(channel: number, speed: number, maxSpeed: number, callback: Callback<any>): MessageId
setSystemDNDMode(onoff: boolean, callback: Callback<any>): MessageId
}

Expand Down
20 changes: 19 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -636,12 +636,30 @@ class MerossCloudDevice extends EventEmitter {
return this.publishMessage("GET", "Appliance.Control.FilterMaintenance", {}, callback);
}

getPhysicalLockState(callback) {
return this.publishMessage("GET", "Appliance.Control.PhysicalLock", {}, callback);
}

controlPhysicalLock(channel, locked, callback) {
const payload = {"lock": {"channel": channel, "onoff": locked ? 1 : 0, "uuid": this.dev.uuid}};
return this.publishMessage("SET", "Appliance.GarageDoor.State", payload, callback);
}

getFanState(callback) {
return this.publishMessage("GET", "Appliance.Control.Fan", {}, callback);
}

controlFan(channel, speed, maxSpeed, callback) {
const payload = {"fan": [{"channel": channel, "speed": speed, "maxSpeed": maxSpeed, "uuid": this.dev.uuid}]};
return this.publishMessage("SET", "Appliance.Control.Fan", payload, callback);
}

getRollerShutterPosition(callback) {
return this.publishMessage("GET", "Appliance.RollerShutter.Position", {}, callback);
}

controlGarageDoor(channel, open, callback) {
const payload = {"state": {"channel": channel, "open": open ? 1 : 0, "uuid": this.dev.uuid}};
const payload = {"state": [{"channel": channel, "mode": mode || 0, "uuid": this.dev.uuid}]};
return this.publishMessage("SET", "Appliance.GarageDoor.State", payload, callback);
}

Expand Down

0 comments on commit bec5f27

Please sign in to comment.