-
-
Notifications
You must be signed in to change notification settings - Fork 91
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
Add xml GetError #369
Conversation
Co-authored-by: Sander van Kasteel <[email protected]>
Codecov ReportAttention:
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. |
@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. |
@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 :) |
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:
"""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,
),
) |
Co-authored-by: Sander van Kasteel <[email protected]>
@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?