mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
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
@ -141,16 +141,9 @@ class WorxLandroidSensor(Entity):
|
|||||||
state = self.get_error(obj)
|
state = self.get_error(obj)
|
||||||
|
|
||||||
if state is None:
|
if state is None:
|
||||||
state_obj = obj["settaggi"]
|
if obj["batteryChargerState"] == "charging":
|
||||||
|
return obj["batteryChargerState"]
|
||||||
|
|
||||||
if state_obj[14] == 1:
|
return obj["state"]
|
||||||
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 state
|
return state
|
||||||
|
Loading…
x
Reference in New Issue
Block a user