Skip to content

Conversation

JNickson
Copy link

No description provided.

@Copilot Copilot AI review requested due to automatic review settings May 23, 2025 11:51
@JNickson JNickson closed this May 23, 2025
@JNickson JNickson reopened this May 23, 2025
Copy link
Contributor

@Copilot Copilot AI left a 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.

headers=REQUEST_HEADERS,
)

elif self._api_path == PATH_API_IOT_CONTROL:
Copy link
Preview

Copilot AI May 23, 2025

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.

@JNickson JNickson marked this pull request as draft May 23, 2025 11:52
@JNickson JNickson closed this May 23, 2025
@JNickson JNickson reopened this May 23, 2025
@JNickson JNickson changed the title added initial api endpoint execute request change Ecovacs GOAT - RTK O800 updated api endpoint request changes May 23, 2025
@@ -34,6 +38,12 @@ def _handle_body_data_dict(

error: int | None = 0

if 505 in codes:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you doing this??

Please add the error to the ERROR_CODES

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added.
I'm not quite sure what the error means but the android app did this when pressing start:-

  1. send start mowing
  2. get error 505
  3. send remove error 505
  4. send resume

I've added an error to the codes list

Comment on lines 137 to 147
if (
state.state == State.DOCKED
and self._args["act"] == CleanAction.RESUME.value
):
# if docked and resume, send resume...
self._args = self._get_args(CleanAction.RESUME)
elif (
state.state == State.DOCKED
and self._args["act"] == CleanAction.START.value
):
self._args = self._get_args(CleanAction.START)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are not changing the clean action in these two chases, so why have you added it here?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed this - it was to try fix an issue which you can replicate by:-

  1. click start
  2. click return to dock
  3. bot returns to dock
  4. click start, nothing happens

Reason: bot is docked but paused, so need to send resume or end the current job.

If bot finishes the job and returns to dock, it automatically ends current job and you can press start again.

I think we should get this PR merged for now as a base and other bugs can be fixed later.

@edenhaus
Copy link
Member

edenhaus commented Aug 7, 2025

I maybe found better solution, I need to test it next week

@edenhaus edenhaus changed the title Ecovacs GOAT - RTK O800 updated api endpoint request changes Add new API endpoint via DeviceAuthenticator Aug 11, 2025
@edenhaus edenhaus added the pr: enhancement PR with Improve something label Aug 11, 2025
"Calling api(%d/%d): %s",
i + 1,
MAX_RETRIES,
logger_request_params,

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

This expression logs
sensitive data (password)
as clear text.
_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

This expression logs
sensitive data (password)
as clear text.
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

This expression logs
sensitive data (password)
as clear text.
_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

This expression logs
sensitive data (password)
as clear text.
Copy link

codecov bot commented Aug 11, 2025

Codecov Report

❌ Patch coverage is 39.28571% with 51 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.10%. Comparing base (5bff22b) to head (da7a42c).
⚠️ Report is 1 commits behind head on dev.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
deebot_client/authentication.py 33.76% 51 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #987      +/-   ##
==========================================
- Coverage   93.72%   93.10%   -0.63%     
==========================================
  Files         131      131              
  Lines        5020     5060      +40     
  Branches      327      326       -1     
==========================================
+ Hits         4705     4711       +6     
- Misses        252      287      +35     
+ Partials       63       62       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@edenhaus edenhaus force-pushed the CleanV3-new-api-endpoint branch from 23f1880 to da7a42c Compare August 11, 2025 20:02
Copy link

codspeed-hq bot commented Aug 11, 2025

CodSpeed Performance Report

Merging #987 will not alter performance

Comparing JNickson:CleanV3-new-api-endpoint (da7a42c) with dev (5bff22b)

Summary

✅ 6 untouched benchmarks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: enhancement PR with Improve something
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants