mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
Use x,y in roborock action call (#134133)
* Use x,y in roborock action call * Fix description
This commit is contained in:
parent
df7d518f38
commit
4080455c12
@ -9,13 +9,13 @@ set_vacuum_goto_position:
|
||||
integration: roborock
|
||||
domain: vacuum
|
||||
fields:
|
||||
x_coord:
|
||||
x:
|
||||
example: 27500
|
||||
required: true
|
||||
selector:
|
||||
text:
|
||||
type: number
|
||||
y_coord:
|
||||
y:
|
||||
example: 32000
|
||||
required: true
|
||||
selector:
|
||||
|
@ -433,13 +433,13 @@
|
||||
"name": "Go to position",
|
||||
"description": "Send the vacuum to a specific position.",
|
||||
"fields": {
|
||||
"x_coord": {
|
||||
"x": {
|
||||
"name": "X-coordinate",
|
||||
"description": ""
|
||||
"description": "Coordinates are relative to the dock. x=25500,y=25500 is the dock position."
|
||||
},
|
||||
"y_coord": {
|
||||
"y": {
|
||||
"name": "Y-coordinate",
|
||||
"description": ""
|
||||
"description": "[%key:component::roborock::services::set_vacuum_goto_position::fields::x::description%]"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -88,8 +88,8 @@ async def async_setup_entry(
|
||||
SET_VACUUM_GOTO_POSITION_SERVICE_NAME,
|
||||
cv.make_entity_service_schema(
|
||||
{
|
||||
vol.Required("x_coord"): vol.Coerce(int),
|
||||
vol.Required("y_coord"): vol.Coerce(int),
|
||||
vol.Required("x"): vol.Coerce(int),
|
||||
vol.Required("y"): vol.Coerce(int),
|
||||
},
|
||||
),
|
||||
RoborockVacuum.async_set_vacuum_goto_position.__name__,
|
||||
@ -185,9 +185,9 @@ class RoborockVacuum(RoborockCoordinatedEntityV1, StateVacuumEntity):
|
||||
[self._device_status.get_fan_speed_code(fan_speed)],
|
||||
)
|
||||
|
||||
async def async_set_vacuum_goto_position(self, x_coord: int, y_coord: int) -> None:
|
||||
async def async_set_vacuum_goto_position(self, x: int, y: int) -> None:
|
||||
"""Send vacuum to a specific target point."""
|
||||
await self.send(RoborockCommand.APP_GOTO_TARGET, [x_coord, y_coord])
|
||||
await self.send(RoborockCommand.APP_GOTO_TARGET, [x, y])
|
||||
|
||||
async def async_send_command(
|
||||
self,
|
||||
|
@ -197,7 +197,7 @@ async def test_goto(
|
||||
vacuum = hass.states.get(ENTITY_ID)
|
||||
assert vacuum
|
||||
|
||||
data = {ATTR_ENTITY_ID: ENTITY_ID, "x_coord": 25500, "y_coord": 25500}
|
||||
data = {ATTR_ENTITY_ID: ENTITY_ID, "x": 25500, "y": 25500}
|
||||
with patch(
|
||||
"homeassistant.components.roborock.coordinator.RoborockLocalClientV1.send_command"
|
||||
) as mock_send_command:
|
||||
|
Loading…
x
Reference in New Issue
Block a user