-
-
Notifications
You must be signed in to change notification settings - Fork 143
Add new API endpoint via DeviceAuthenticator #987
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces an initial API endpoint for IoT control and updates the existing command infrastructure to support the new changes.
- Added a new constant PATH_API_IOT_CONTROL to define the new endpoint.
- Introduced CleanV3 and GetCleanInfoV3 command classes to use the new API endpoint.
- Updated the API request execution logic in command.py to include a new branch for the IoT control endpoint.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
deebot_client/const.py | Added new constant for the IoT control API endpoint. |
deebot_client/commands/json/clean.py | Added new command classes (CleanV3, GetCleanInfoV3) and updated CleanAreaV3 accordingly. |
deebot_client/commands/json/init.py | Updated exports to include the new CleanV3 and GetCleanInfoV3 commands. |
deebot_client/command.py | Updated API request logic to branch based on the new PATH_API_IOT_CONTROL endpoint. |
deebot_client/command.py
Outdated
headers=REQUEST_HEADERS, | ||
) | ||
|
||
elif self._api_path == PATH_API_IOT_CONTROL: |
Copilot
AI
May 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The branch for handling PATH_API_IOT_CONTROL contains placeholder values ('body = ...' and 'query_params = ...'). Please implement the actual payload and query parameters to ensure correct functionality.
Copilot uses AI. Check for mistakes.
This reverts commit eb3e1ea.
I maybe found better solution, I need to test it next week |
"Calling api(%d/%d): %s", | ||
i + 1, | ||
MAX_RETRIES, | ||
logger_request_params, |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
sensitive data (password)
_LOGGER.debug( | ||
"Error calling api %s, response=%s", logger_request_params, res | ||
"Success calling api %s, response=%s", | ||
logger_request_params, |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
sensitive data (password)
return response_data | ||
|
||
_LOGGER.debug( | ||
"Error calling api %s, response=%s", logger_request_params, res |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
sensitive data (password)
_LOGGER.debug("Timeout (%d) reached on path: %s", _TIMEOUT, url) | ||
raise ApiTimeoutError(path=url, timeout=_TIMEOUT) from ex | ||
except ClientResponseError as ex: | ||
_LOGGER.debug("Error: %s", logger_request_params, exc_info=True) |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
sensitive data (password)
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #987 +/- ##
==========================================
- Coverage 93.78% 93.26% -0.53%
==========================================
Files 132 133 +1
Lines 5072 5140 +68
Branches 332 332
==========================================
+ Hits 4757 4794 +37
- Misses 252 284 +32
+ Partials 63 62 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
23f1880
to
da7a42c
Compare
CodSpeed Performance ReportMerging #987 will not alter performanceComparing Summary
|
fb5bc0b
to
e582689
Compare
Can you test if your mower is working with this PR? |
im not sure if I did something wrong copying deebot_client over
I replaced the following 3 with deebot_client from this PR |
Please delete the following folders completely:
For a few months, HA has required Python 3.13, so you can delete any dependencies installed for 3.11 and 3.12 Copying over will not work as you need to properly install it as this repo does also include native code (rust) |
changed from
changed to
![]()
has something changed? |
Shit forgotten that you need also HA changes. Will send them to you soon as I'm currently out |
Don't forget to send when you can :) |
@alec-pinson Sorry for the delay but my life is currently chaotic with a broken leg diff --git a/homeassistant/components/ecovacs/config_flow.py b/homeassistant/components/ecovacs/config_flow.py
index 2637dbbddf8..25911c8a810 100644
--- a/homeassistant/components/ecovacs/config_flow.py
+++ b/homeassistant/components/ecovacs/config_flow.py
@@ -9,7 +9,7 @@ from typing import Any
from urllib.parse import urlparse
from aiohttp import ClientError
-from deebot_client.authentication import Authenticator, create_rest_config
+from deebot_client.authentication import UserAuthenticator, create_rest_config
from deebot_client.const import UNDEFINED, UndefinedType
from deebot_client.exceptions import InvalidAuthenticationError, MqttError
from deebot_client.mqtt_client import MqttClient, create_mqtt_config
@@ -77,7 +77,7 @@ async def _validate_input(
override_rest_url=rest_url,
)
- authenticator = Authenticator(
+ authenticator = UserAuthenticator(
rest_config,
user_input[CONF_USERNAME],
md5(user_input[CONF_PASSWORD]),
diff --git a/homeassistant/components/ecovacs/controller.py b/homeassistant/components/ecovacs/controller.py
index 69dd0f0813f..0225d6e2876 100644
--- a/homeassistant/components/ecovacs/controller.py
+++ b/homeassistant/components/ecovacs/controller.py
@@ -9,7 +9,7 @@ import ssl
from typing import Any
from deebot_client.api_client import ApiClient
-from deebot_client.authentication import Authenticator, create_rest_config
+from deebot_client.authentication import UserAuthenticator, create_rest_config
from deebot_client.const import UNDEFINED, UndefinedType
from deebot_client.device import Device
from deebot_client.exceptions import DeebotError, InvalidAuthenticationError
@@ -47,7 +47,7 @@ class EcovacsController:
country = config[CONF_COUNTRY]
self._continent = get_continent(country)
- self._authenticator = Authenticator(
+ self._authenticator = UserAuthenticator(
create_rest_config(
aiohttp_client.async_get_clientsession(self._hass),
device_id=self._device_id,
diff --git a/homeassistant/components/ecovacs/strings.json b/homeassistant/components/ecovacs/strings.json
index 1be81ab1292..04d7ee3d5f7 100644
--- a/homeassistant/components/ecovacs/strings.json
+++ b/homeassistant/components/ecovacs/strings.json
@@ -152,8 +152,10 @@
"station_state": {
"name": "Station state",
"state": {
+ "drying": "Drying mop",
"idle": "[%key:common::state::idle%]",
- "emptying_dustbin": "Emptying dustbin"
+ "emptying_dustbin": "Emptying dustbin",
+ "washing": "Washing mop"
}
},
"stats_area": { |
bf94983
to
ed03dbd
Compare
No description provided.