Change state values for Worx Landroid sensor (#27453)
The obj["state"] contains already several named return states as following: "grass cutting", "trapped recovery", "searching wire", "following wire", "searching home", "home", "idle" And with the batteryChargerState also the "charging" Fixes #455
This commit is contained in:
parent
55559f3e30
commit
3d25ed7994
1 changed files with 3 additions and 10 deletions
|
@ -141,16 +141,9 @@ class WorxLandroidSensor(Entity):
|
|||
state = self.get_error(obj)
|
||||
|
||||
if state is None:
|
||||
state_obj = obj["settaggi"]
|
||||
if obj["batteryChargerState"] == "charging":
|
||||
return obj["batteryChargerState"]
|
||||
|
||||
if state_obj[14] == 1:
|
||||
return "manual-stop"
|
||||
if state_obj[5] == 1 and state_obj[13] == 0:
|
||||
return "charging"
|
||||
if state_obj[5] == 1 and state_obj[13] == 1:
|
||||
return "charging-complete"
|
||||
if state_obj[15] == 1:
|
||||
return "going-home"
|
||||
return "mowing"
|
||||
return obj["state"]
|
||||
|
||||
return state
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue