mirror of
https://github.com/sudoxnym/roomba_rest980.git
synced 2026-04-14 11:37:46 +00:00
Test
This commit is contained in:
parent
6812721c47
commit
b52ecf6e33
3 changed files with 39 additions and 2 deletions
|
|
@ -8,7 +8,9 @@ from .const import (
|
|||
cycleMappings,
|
||||
errorMappings,
|
||||
jobInitiatorMappings,
|
||||
mopRanks,
|
||||
notReadyMappings,
|
||||
padMappings,
|
||||
phaseMappings,
|
||||
yesNoMappings,
|
||||
)
|
||||
|
|
@ -130,7 +132,7 @@ def createExtendedAttributes(self) -> dict[str, any]:
|
|||
else:
|
||||
robotCleanMode = "n-a"
|
||||
|
||||
return {
|
||||
robotObject = {
|
||||
"extendedStatus": extv,
|
||||
"notready_msg": notReadyMappings.get(notReady, notReady),
|
||||
"error_msg": errorMappings.get(err, err),
|
||||
|
|
@ -157,3 +159,27 @@ def createExtendedAttributes(self) -> dict[str, any]:
|
|||
"maint_due": False,
|
||||
"pmap0_id": pmap0id,
|
||||
}
|
||||
|
||||
if data.get("padWetness"):
|
||||
# It's a mop
|
||||
# TODO: Make sure this works! I don't own a mop, so I'm just re-using what jeremywillans has written.
|
||||
robotCleanMode = data.get("padWetness")["disposable"]
|
||||
mopRankOverlap = data.get("rankOverlap")
|
||||
detectedPad = data.get("detectedPad")
|
||||
tankPresent = data.get("tankPresent")
|
||||
lidOpen = data.get("lidOpen")
|
||||
if mopRankOverlap:
|
||||
robotObject["mop_behavior"] = mopRanks.get(mopRankOverlap, mopRankOverlap)
|
||||
if detectedPad:
|
||||
robotObject["pad"] = padMappings.get(detectedPad)
|
||||
if tankPresent:
|
||||
if notReady == 31: # Fill Tank
|
||||
robotObject["tank"] = "Fill Tank"
|
||||
elif not lidOpen:
|
||||
robotObject["tank"] = "Ready"
|
||||
elif lidOpen:
|
||||
robotObject["tank"] = "Lid Open"
|
||||
else:
|
||||
robotObject["tank"] = "Tank Missing"
|
||||
|
||||
return robotObject
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ notReadyMappings = {
|
|||
0: "n-a",
|
||||
2: "Uneven Ground",
|
||||
15: "Low Battery",
|
||||
31: "Fill Tank",
|
||||
39: "Pending",
|
||||
48: "Path Blocked",
|
||||
68: "Updating Map",
|
||||
|
|
@ -154,6 +155,16 @@ jobInitiatorMappings = {
|
|||
"none": "None", # Added for RoombaJobInitiator
|
||||
}
|
||||
|
||||
mopRanks = {25: "Extended", 67: "Standard", 85: "Deep"}
|
||||
|
||||
padMappings = {
|
||||
"reusableDry": "Dry",
|
||||
"reusableWet": "Wet",
|
||||
"dispDry": "Single Dry",
|
||||
"dispWet": "Single Wet",
|
||||
"invalid": "No Pad",
|
||||
}
|
||||
|
||||
regionTypeMappings = {
|
||||
"default": "mdi:map-marker",
|
||||
"custom": "mdi:face-agent",
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
"requirements": [
|
||||
"aiofiles==24.1.0"
|
||||
],
|
||||
"version": "1.12.0",
|
||||
"version": "1.13.0",
|
||||
"zeroconf": [
|
||||
{
|
||||
"type": "_amzn-alexa._tcp.local.",
|
||||
|
|
|
|||
Loading…
Reference in a new issue