java.io.Serializablepublic class Vacuum extends Device implements java.io.Serializable
| Constructor | Description |
|---|---|
Vacuum(java.net.InetAddress ip,
Token token,
int timeout,
int retries) |
Create an object for communicating with the Mi Robot an the Roborock.
|
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
addTimer(VacuumTimer timer) |
Add a new scheduled cleanup.
|
boolean |
cleanArea(float x0,
float y0,
float x1,
float y1,
int passes) |
Clean the specified area on the map.
|
boolean |
cleanArea(int[] bottomLeft,
int[] topRight,
int passes) |
Clean the specified area on the map.
|
boolean |
cleanAreaFromMap(int x0,
int y0,
int x1,
int y1,
int passes) |
Clean the specified area on the map.
|
VacuumConsumableStatus |
consumableStatus() |
Get the vacuums consumables status.
|
boolean |
disableDoNotDisturb() |
Disable the do not disturb timer.
|
boolean |
findMe() |
Make the vacuum make a sound to find it
|
VacuumCleanup[] |
getAllCleanups() |
Get an array with the details of all cleanups.
|
org.json.JSONObject |
getCarpetModeState() |
Get the current carpet cleaning settings.
|
VacuumDoNotDisturb |
getDoNotDisturb() |
Get the current do not disturb settings from the device
|
int |
getFanSpeed() |
Get the vacuums current fan speed setting.
|
java.lang.String |
getSerialnumber() |
Get the vacuums serial number.
|
int |
getSoundVolume() |
Get the current volume.
|
VacuumTimer[] |
getTimers() |
Get all stored scheduled cleanups.
|
java.util.TimeZone |
getTimezone() |
Get the vacuums current timezone.
|
long |
getTotalCleanedArea() |
Get the vacuums total cleaned area.
|
long |
getTotalCleaningTime() |
Get the total time the vacuum has been cleaning.
|
long |
getTotalCleans() |
Get the total number of cleanups the vacuum has performed.
|
boolean |
goTo(float x,
float y) |
Go to the specified position on the map.
|
boolean |
goTo(int[] p) |
Go to the specified position on the map.
|
boolean |
goToMapPosition(int x,
int y) |
Go to the specified position on the map.
|
boolean |
home() |
Send the vacuum to its docking station.
|
VacuumSounpackInstallState |
installSoundpack(java.lang.String url,
java.lang.String md5,
int soundId) |
Install a new soundpack to the device.
|
boolean |
manualControlMove(float rotationSpeed,
float speed,
int runDuration) |
Manually control the robot
|
boolean |
manualControlStart() |
Enable manual remote controls.
|
boolean |
manualControlStop() |
Disable manual remote controls.
|
boolean |
pause() |
Pause the cleanup.
|
boolean |
removeTimer(VacuumTimer timer) |
Delete a scheduled cleanup.
|
boolean |
resetConsumable(VacuumConsumableStatus.Names consumable) |
Reset a vacuums consumable.
|
boolean |
setCarpetMode(boolean enabled,
int high,
int low,
int integral,
int stallTime) |
Change the carped cleaning settings.
|
boolean |
setDoNotDisturb(VacuumDoNotDisturb dnd) |
Set the do not disturb timer.
|
boolean |
setFanSpeed(int speed) |
Set the vacuums fan speed setting.
|
boolean |
setSoundVolume(int volume) |
Set the vacuums volume.
|
boolean |
setTimerEnabled(VacuumTimer timer) |
Enable or disable a scheduled cleanup.
|
boolean |
setTimezone(java.util.TimeZone zone) |
Set the vacuums timezone
|
VacuumSounpackInstallState |
soundpackInstallStatus() |
Get the current soundpack installation status.
|
boolean |
spotCleaning() |
Clean the area around the vacuums current position
|
boolean |
start() |
Start the cleanup.
|
VacuumStatus |
status() |
Get the vacuums status.
|
boolean |
stop() |
Stop the cleanup.
|
boolean |
testSoundVolume() |
Make the vacuum produce a test sound.
|
configureRouter, configureRouter, discover, firmware, getAcceptableModels, getIp, getRetries, getTimeout, getToken, info, model, send, send, sendOk, sendOk, sendToArray, sendToArray, sendToObject, sendToObject, update, updateProgress, updateStatuspublic Vacuum(java.net.InetAddress ip,
Token token,
int timeout,
int retries)
ip - The IP address of the device to connect to. If the address is null the first device that is an acceptableModel will be chosen.token - The token for that device. If the token is null the token will be extracted from unprovisioned devices.timeout - The timeout for the communicationretries - The number of retries after a failed communicationpublic VacuumStatus status() throws CommandExecutionException
CommandExecutionException - When there has been a error during the communication or the response was invalid.public java.util.TimeZone getTimezone()
throws CommandExecutionException
CommandExecutionException - When there has been a error during the communication or the response was invalid.public boolean setTimezone(java.util.TimeZone zone)
throws CommandExecutionException
zone - The new timezone to set.CommandExecutionException - When there has been a error during the communication or the response was invalid.public VacuumConsumableStatus consumableStatus() throws CommandExecutionException
CommandExecutionException - When there has been a error during the communication or the response was invalid.public boolean resetConsumable(VacuumConsumableStatus.Names consumable) throws CommandExecutionException
consumable - The consumable to resetCommandExecutionException - When there has been a error during the communication or the response was invalid.public boolean start()
throws CommandExecutionException
CommandExecutionException - When there has been a error during the communication or the response was invalid.public boolean pause()
throws CommandExecutionException
CommandExecutionException - When there has been a error during the communication or the response was invalid.public boolean stop()
throws CommandExecutionException
CommandExecutionException - When there has been a error during the communication or the response was invalid.public boolean home()
throws CommandExecutionException
CommandExecutionException - When there has been a error during the communication or the response was invalid.public boolean spotCleaning()
throws CommandExecutionException
CommandExecutionException - When there has been a error during the communication or the response was invalid.public boolean findMe()
throws CommandExecutionException
CommandExecutionException - When there has been a error during the communication or the response was invalid.public int getFanSpeed()
throws CommandExecutionException
CommandExecutionException - When there has been a error during the communication or the response was invalid.public boolean setFanSpeed(int speed)
throws CommandExecutionException
speed - The new speed to set.CommandExecutionException - When there has been a error during the communication or the response was invalid.public VacuumTimer[] getTimers() throws CommandExecutionException
CommandExecutionException - When there has been a error during the communication or the response was invalid.public boolean addTimer(VacuumTimer timer) throws CommandExecutionException
timer - The new timer to set.CommandExecutionException - When there has been a error during the communication or the response was invalid.public boolean setTimerEnabled(VacuumTimer timer) throws CommandExecutionException
timer - The timer to update.CommandExecutionException - When there has been a error during the communication or the response was invalid.public boolean removeTimer(VacuumTimer timer) throws CommandExecutionException
timer - The timer to remove.CommandExecutionException - When there has been a error during the communication or the response was invalid.public VacuumDoNotDisturb getDoNotDisturb() throws CommandExecutionException
CommandExecutionException - When there has been a error during the communication or the response was invalid.public boolean setDoNotDisturb(VacuumDoNotDisturb dnd) throws CommandExecutionException
dnd - The new settings to set.CommandExecutionException - When there has been a error during the communication or the response was invalid.public boolean disableDoNotDisturb()
throws CommandExecutionException
CommandExecutionException - When there has been a error during the communication or the response was invalid.public boolean goToMapPosition(int x,
int y)
throws CommandExecutionException
x - The x position to move to in pixel. 512 pixel is the center of the map.y - The y position to move to in pixel. 512 pixel is the center of the map.CommandExecutionException - When there has been a error during the communication or the response was invalid.public boolean goTo(float x,
float y)
throws CommandExecutionException
x - The x position to move to in meters. 25.6 meters is the center of the map.y - The y position to move to in meters. 25.6 meters is the center of the map.CommandExecutionException - When there has been a error during the communication or the response was invalid.public boolean goTo(int[] p)
throws CommandExecutionException
p - The position to move to in millimeters. 25600 millimeter both in x and y is the center of the map. The origin of the map is 0 millimeters in x and y.CommandExecutionException - When there has been a error during the communication or the response was invalid.public boolean cleanAreaFromMap(int x0,
int y0,
int x1,
int y1,
int passes)
throws CommandExecutionException
x0 - The x position of the first point defining the area in pixel. 512 pixel is the center of the map.y0 - The y position of the first point defining the area in pixel. 512 pixel is the center of the map.x1 - The x position of the second point defining the area in pixel. 512 pixel is the center of the map.y1 - The y position of the second point defining the area in pixel. 512 pixel is the center of the map.passes - The number of times to clean this area.CommandExecutionException - When there has been a error during the communication or the response was invalid.public boolean cleanArea(float x0,
float y0,
float x1,
float y1,
int passes)
throws CommandExecutionException
x0 - The x position of the first point defining the area in meters. 25.6 meters is the center of the map.y0 - The y position of the first point defining the area in meters. 25.6 meters is the center of the map.x1 - The x position of the second point defining the area in meters. 25.6 meters is the center of the map.y1 - The y position of the second point defining the area in meters. 25.6 meters is the center of the map.passes - The number of times to clean this area.CommandExecutionException - When there has been a error during the communication or the response was invalid.public boolean cleanArea(int[] bottomLeft,
int[] topRight,
int passes)
throws CommandExecutionException
bottomLeft - The bottom left position of the area in millimeters. 25600 millimeter both in x and y is the center of the map. The origin of the map is 0 millimeters in x and y.topRight - The top right position of the area in millimeters. 25600 millimeter both in x and y is the center of the map. The origin of the map is 0 millimeters in x and y.passes - The number of times to clean this area.CommandExecutionException - When there has been a error during the communication or the response was invalid.public long getTotalCleaningTime()
throws CommandExecutionException
CommandExecutionException - When there has been a error during the communication or the response was invalid.public long getTotalCleanedArea()
throws CommandExecutionException
CommandExecutionException - When there has been a error during the communication or the response was invalid.public long getTotalCleans()
throws CommandExecutionException
CommandExecutionException - When there has been a error during the communication or the response was invalid.public VacuumCleanup[] getAllCleanups() throws CommandExecutionException
CommandExecutionException - When there has been a error during the communication or the response was invalid.public int getSoundVolume()
throws CommandExecutionException
CommandExecutionException - When there has been a error during the communication or the response was invalid.public boolean setSoundVolume(int volume)
throws CommandExecutionException
volume - The volume between 0 and 100.CommandExecutionException - When there has been a error during the communication or the response was invalid.public boolean testSoundVolume()
throws CommandExecutionException
CommandExecutionException - When there has been a error during the communication or the response was invalid.public boolean manualControlStart()
throws CommandExecutionException
CommandExecutionException - When there has been a error during the communication or the response was invalid.public boolean manualControlStop()
throws CommandExecutionException
CommandExecutionException - When there has been a error during the communication or the response was invalid.public boolean manualControlMove(float rotationSpeed,
float speed,
int runDuration)
throws CommandExecutionException
rotationSpeed - The speed of rotation in deg/s.speed - The speed of the robot in m/s. Must be greater then -0.3 and less then 0.3.runDuration - The time to run the command in ms. Values less than 0 will be replaced by a default value of 1000ms.CommandExecutionException - When there has been a error during the communication or the response was invalid.public VacuumSounpackInstallState installSoundpack(java.lang.String url, java.lang.String md5, int soundId) throws CommandExecutionException
url - The url the soundpack should be downloaded from.md5 - The md5 checksum of the new soundpack.soundId - The ID of the soundpacks language.CommandExecutionException - When there has been a error during the communication or the response was invalid.public VacuumSounpackInstallState soundpackInstallStatus() throws CommandExecutionException
CommandExecutionException - When there has been a error during the communication or the response was invalid.public org.json.JSONObject getCarpetModeState()
throws CommandExecutionException
CommandExecutionException - When there has been a error during the communication or the response was invalid.public boolean setCarpetMode(boolean enabled,
int high,
int low,
int integral,
int stallTime)
throws CommandExecutionException
enabled - Weather the carped cleanup mode should be enabled.high - The high parameter of the carped cleanup.low - The low parameter of the carped cleanup.integral - The integral parameter of the carped cleanup.stallTime - The stall time parameter of the carped cleanup.CommandExecutionException - When there has been a error during the communication or the response was invalid.public java.lang.String getSerialnumber()
throws CommandExecutionException
CommandExecutionException - When there has been a error during the communication or the response was invalid.Copyright © 2018. All rights reserved.