homebridge-xiaomi-roborock-vacuum
Version:
Xiaomi Vacuum Cleaner - 1st (Mi Robot), 2nd (Roborock S50 + S55), 3rd Generation (Roborock S6) and S5 Max - plugin for Homebridge.
81 lines (60 loc) • 1.27 kB
Markdown
- **Devices**: Mi Robot Vacuum
- **Model identifiers**: `rockrobo.vacuum.v1`
Robot vacuums are mapped into a device of type [`vacuum`][vacuum]. The device
will support many different capabilities, such as autonomous cleaning, getting
the cleaning state and more.
```javascript
if (device.matches("type:vacuum")) {
/*
* This device is a vacuum.
*/
}
```
```javascript
// Get the current cleaning state
device.cleaning()
.then(isCleaning => ...)
.catch(...);
// With async/wait
const isCleaning = await device.cleaning();
```
```javascript
// Request cleaning
device.clean()
.then(...)
.catch(...);
// With async/await
await device.clean();
```
```javascript
// Stop cleaning
device.stop()
.then(...)
.catch(...);
// With async/await
await device.stop();
```
```javascript
// Spot clean
device.spotClean()
.then(...)
.catch(...);
// With async/await
await device.spotClean();
```
```javascript
// Get the battery level
device.batteryLevel()
.then(level => ...)
.catch(...);
// With async/wait
const level = await device.batteryLevel();
```