Skip to content

Commit

Permalink
Fix online state and mowing border state
Browse files Browse the repository at this point in the history
  • Loading branch information
Sdahl1234 authored Mar 12, 2024
1 parent f8e902c commit 7731350
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 11 deletions.
1 change: 1 addition & 0 deletions custom_components/sunseeker/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
SUNSEEKER_GOING_HOME = "On the way home"
SUNSEEKER_CHARGING = "Charging"
SUNSEEKER_MOWING_BORDER = "Mowing border"
SUNSEEKER_UNKNOWN_4 = "Unknown4"
SUNSEEKER_UNKNOWN = "Unknown"

SUNSEEKER_DRY = "Dry"
Expand Down
5 changes: 3 additions & 2 deletions custom_components/sunseeker/lawn_mower.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
SUNSEEKER_MOWING_BORDER,
SUNSEEKER_STANDBY,
SUNSEEKER_UNKNOWN,
SUNSEEKER_UNKNOWN_4,
)
from .entity import SunseekerEntity

Expand Down Expand Up @@ -101,9 +102,9 @@ def state(self) -> str | None:
elif ival == 3:
val = SUNSEEKER_CHARGING
elif ival == 4:
val = SUNSEEKER_MOWING_BORDER
val = SUNSEEKER_UNKNOWN_4
elif ival == 7:
val = SUNSEEKER_UNKNOWN
val = SUNSEEKER_MOWING_BORDER
else:
val = SUNSEEKER_UNKNOWN
return val
Expand Down
2 changes: 1 addition & 1 deletion custom_components/sunseeker/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"integration_type": "device",
"iot_class": "cloud_push",
"config_flow": true,
"version": "1.0.5"
"version": "1.0.6"
}
5 changes: 3 additions & 2 deletions custom_components/sunseeker/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
SUNSEEKER_MOWING_BORDER,
SUNSEEKER_STANDBY,
SUNSEEKER_UNKNOWN,
SUNSEEKER_UNKNOWN_4,
SUNSEEKER_WET,
)
from .entity import SunseekerEntity
Expand Down Expand Up @@ -344,9 +345,9 @@ def state(self): # noqa: C901
elif ival == 3:
val = SUNSEEKER_CHARGING
elif ival == 4:
val = SUNSEEKER_MOWING_BORDER
val = SUNSEEKER_UNKNOWN_4
elif ival == 7:
val = SUNSEEKER_UNKNOWN
val = SUNSEEKER_MOWING_BORDER
else:
val = SUNSEEKER_UNKNOWN
elif self._valuepair == "wifi_lv":
Expand Down
3 changes: 2 additions & 1 deletion custom_components/sunseeker/sunseeker.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ def InitValues(self) -> None:
self.rain_en = self.devicedata["data"].get("rainFlag")
self.rain_delay_set = int(self.devicedata["data"].get("rainDelayDuration"))
self.rain_delay_left = self.devicedata["data"].get("rainDelayLeft")
self.deviceOnlineFlag = self.devicedata["data"].get("onlineFlag")
if self.devicedata["data"].get("onlineFlag"):
self.deviceOnlineFlag = '{"online":"1"}'
self.zoneOpenFlag = self.settings["data"].get("zoneOpenFlag")
self.mul_en = self.settings["data"].get("zoneOpenFlag")
self.mul_auto = self.settings["data"].get("zoneAutomaticFlag")
Expand Down
2 changes: 1 addition & 1 deletion custom_components/sunseeker/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ async def async_set_value(self, value: str) -> None:
start = value[0:5]
stop = value[8:13]
trim = False
if "Trim" or "trim" in value:
if "Trim" in value or "trim" in value:
trim = True

retval2 = {
Expand Down
7 changes: 5 additions & 2 deletions custom_components/sunseeker/translations/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"On the way home": "På vej hjem",
"Charging": "Oplader",
"Mowing border": "Klipper kant",
"Unknown": "Ukendt"
"Unknown": "Ukendt",
"Unknown4": "Mode 4"
}
},
"sunseeker_battery": {
Expand Down Expand Up @@ -114,7 +115,9 @@
"On the way home": "På vej hjem",
"Charging": "Oplader",
"Mowing border": "Klipper kant",
"Unknown": "Ukendt"
"Unknown": "Ukendt",
"Unknown4": "Mode 4"

}
}
},
Expand Down
6 changes: 4 additions & 2 deletions custom_components/sunseeker/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"On the way home": "Going home",
"Charging": "Charging",
"Mowing border": "Border",
"Unknown": "Unknown"
"Unknown": "Unknown",
"Unknown4": "Mode 4"
}
},
"sunseeker_battery": {
Expand Down Expand Up @@ -114,7 +115,8 @@
"On the way home": "Going home",
"Charging": "Charging",
"Mowing border": "Border",
"Unknown": "Unknown"
"Unknown": "Unknown",
"Unknown4": "Mode 4"
}
}
},
Expand Down

0 comments on commit 7731350

Please sign in to comment.