Skip to content
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

Add xml GetError #369

Merged
merged 5 commits into from
Jan 11, 2024
Merged

Add xml GetError #369

merged 5 commits into from
Jan 11, 2024

Conversation

edenhaus
Copy link
Contributor

@sandervankasteel To go on with adding the xml commands, I think the best would be to split the PR #288 into smaller pieces. I have extracted the GetError command into this PR. Could you please test it?

edenhaus and others added 2 commits December 12, 2023 16:25
@edenhaus edenhaus added the pr: new-feature PR, which adds a new feature label Dec 12, 2023
Copy link

codecov bot commented Dec 12, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (422b51a) 78.60% compared to head (c772dfd) 82.08%.
Report is 16 commits behind head on dev.

Files Patch % Lines
deebot_client/message.py 84.61% 1 Missing and 1 partial ⚠️
deebot_client/commands/xml/common.py 95.65% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #369      +/-   ##
==========================================
+ Coverage   78.60%   82.08%   +3.47%     
==========================================
  Files          64       68       +4     
  Lines        2618     2768     +150     
  Branches      475      504      +29     
==========================================
+ Hits         2058     2272     +214     
+ Misses        516      447      -69     
- Partials       44       49       +5     

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

@lukakama
Copy link
Contributor

lukakama commented Jan 4, 2024

@edenhaus Just tested the PR successfully on both newer T20 Omni (json) and older Ozmo 900 (xml). For the latter I had to define a device class named "y79a7u" with no capabilities except the error one, but it worked.
For both i checked the "no errors", "off the floor" and "removed bin" statuses. They should be enough for the T20 Omni to assert no regressions.
For more advanced tests on the Ozmo 900 I need more time. Let me know if they are needed.

@edenhaus
Copy link
Contributor Author

edenhaus commented Jan 4, 2024

@lukakama Thanks for testing and you need only to test this command on the 900 as it is a XML command. It should never be used for a json model like the new bots.

Can you please share me the capabilities file of the 900, so I will add it directly with this PR :)

@lukakama
Copy link
Contributor

lukakama commented Jan 4, 2024

For T20 I tested the JSON version of GetError command, as I noticed that it has been impacted by refactors needed to support the XML version (the externalization of error constants). It was just to assert absence of (imho very unlikely) regressions :P .

The capability file instead is just a sort of placeholder to perform a local test, which also does not honor type hints... Anyway, here it is:

y79a7u.py

"""Deebot Ozmo 900 Capabilities."""

from deebot_client.capabilities import (
    Capabilities,
    CapabilityEvent,
)
from deebot_client.const import DataType
from deebot_client.events import (
    ErrorEvent,
)
from deebot_client.models import StaticDeviceInfo
from deebot_client.util import short_name

from . import DEVICES

DEVICES[short_name(__name__)] = StaticDeviceInfo(
    DataType.XML,
    Capabilities(
        availability=None,
        battery=None,
        charge=None,
        clean=None,
        custom=None,
        error=CapabilityEvent(ErrorEvent, [GetError()]),
        fan_speed=None,
        life_span=None,
        map=None,
        network=None,
        play_sound=None,
        settings=None,
        state=None,
        stats=None,
        water=None,
    ),
)

@edenhaus edenhaus merged commit 6714834 into dev Jan 11, 2024
8 checks passed
@edenhaus edenhaus deleted the xml-getError branch January 11, 2024 19:04
edenhaus added a commit that referenced this pull request Jan 16, 2024
Co-authored-by: Sander van Kasteel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: new-feature PR, which adds a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants