-
-
Notifications
You must be signed in to change notification settings - Fork 197
Add support for OZMO 905 (2pv572) and 900 (ls1ok3) #934
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
Merged
edenhaus
merged 6 commits into
DeebotUniverse:dev
from
nanomad:feature/2pv572-hardware-definition
Apr 30, 2025
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4e3f527
Add definition for 2pv572
nanomad 199084b
refactor
edenhaus ea76824
format
edenhaus c625f55
Add ls1ok3 as an alias of 2pv572 since we have no mopping support yet
nanomad 0cadba4
Merge branch 'dev' into feature/2pv572-hardware-definition
edenhaus 7b51a86
Use model name
edenhaus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,126 @@ | ||
| """OZMO 905 Capabilities.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from deebot_client.capabilities import ( | ||
| Capabilities, | ||
| CapabilityClean, | ||
| CapabilityCleanAction, | ||
| CapabilityCustomCommand, | ||
| CapabilityEvent, | ||
| CapabilityExecute, | ||
| CapabilityLifeSpan, | ||
| CapabilityMap, | ||
| CapabilitySettings, | ||
| CapabilitySetTypes, | ||
| CapabilityStats, | ||
| DeviceType, | ||
| ) | ||
| from deebot_client.commands.json import GetNetInfoLegacy | ||
| from deebot_client.commands.json.custom import CustomCommand | ||
| from deebot_client.commands.xml import ( | ||
| Charge, | ||
| Clean, | ||
| CleanArea, | ||
| GetBatteryInfo, | ||
| GetChargerPos, | ||
| GetCleanLogs, | ||
| GetCleanSpeed, | ||
| GetCleanState, | ||
| GetError, | ||
| GetLifeSpan, | ||
| GetMapM, | ||
| GetMapSt, | ||
| GetPos, | ||
| GetTrM, | ||
| PlaySound, | ||
| PullMP, | ||
| ResetLifeSpan, | ||
| SetCleanSpeed, | ||
| ) | ||
| from deebot_client.commands.xml.charge_state import GetChargeState | ||
| from deebot_client.commands.xml.stats import GetCleanSum | ||
| from deebot_client.const import DataType | ||
| from deebot_client.events import ( | ||
| AvailabilityEvent, | ||
| BatteryEvent, | ||
| CleanLogEvent, | ||
| CustomCommandEvent, | ||
| ErrorEvent, | ||
| FanSpeedEvent, | ||
| FanSpeedLevel, | ||
| LifeSpan, | ||
| LifeSpanEvent, | ||
| NetworkInfoEvent, | ||
| ReportStatsEvent, | ||
| RoomsEvent, | ||
| StateEvent, | ||
| StatsEvent, | ||
| TotalStatsEvent, | ||
| ) | ||
| from deebot_client.events.map import ( | ||
| CachedMapInfoEvent, | ||
| MajorMapEvent, | ||
| MapChangedEvent, | ||
| MapTraceEvent, | ||
| PositionsEvent, | ||
| ) | ||
| 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=CapabilityEvent(AvailabilityEvent, []), | ||
| battery=CapabilityEvent(BatteryEvent, [GetBatteryInfo()]), | ||
| charge=CapabilityExecute(Charge), | ||
| clean=CapabilityClean( | ||
| action=CapabilityCleanAction(command=Clean, area=CleanArea), | ||
| log=CapabilityEvent(CleanLogEvent, [GetCleanLogs()]), | ||
| ), | ||
| custom=CapabilityCustomCommand( | ||
| event=CustomCommandEvent, get=[], set=CustomCommand | ||
| ), | ||
| device_type=DeviceType.VACUUM, | ||
| error=CapabilityEvent(ErrorEvent, [GetError()]), | ||
| fan_speed=CapabilitySetTypes( | ||
| event=FanSpeedEvent, | ||
| get=[GetCleanSpeed()], | ||
| set=SetCleanSpeed, | ||
| types=( | ||
| FanSpeedLevel.NORMAL, | ||
| FanSpeedLevel.MAX, | ||
| ), | ||
| ), | ||
| life_span=CapabilityLifeSpan( | ||
| types=(LifeSpan.BRUSH, LifeSpan.SIDE_BRUSH, LifeSpan.DUST_CASE_HEAP), | ||
| event=LifeSpanEvent, | ||
| get=[ | ||
| GetLifeSpan(LifeSpan.BRUSH), | ||
| GetLifeSpan(LifeSpan.SIDE_BRUSH), | ||
| GetLifeSpan(LifeSpan.DUST_CASE_HEAP), | ||
| ], | ||
| reset=ResetLifeSpan, | ||
| ), | ||
| map=CapabilityMap( | ||
| cached_info=CapabilityEvent(CachedMapInfoEvent, [GetMapSt()]), | ||
| changed=CapabilityEvent(MapChangedEvent, []), | ||
| major=CapabilityEvent(MajorMapEvent, [GetMapM()]), | ||
| minor=CapabilityExecute(PullMP), | ||
| position=CapabilityEvent(PositionsEvent, [GetPos(), GetChargerPos()]), | ||
| rooms=CapabilityEvent(RoomsEvent, [GetMapSt()]), | ||
| trace=CapabilityEvent(MapTraceEvent, [GetTrM()]), | ||
| ), | ||
| network=CapabilityEvent(NetworkInfoEvent, [GetNetInfoLegacy()]), | ||
| play_sound=CapabilityExecute(PlaySound), | ||
| state=CapabilityEvent(StateEvent, [GetChargeState(), GetCleanState()]), | ||
| stats=CapabilityStats( | ||
| clean=CapabilityEvent(StatsEvent, []), | ||
| report=CapabilityEvent(ReportStatsEvent, []), | ||
| total=CapabilityEvent(TotalStatsEvent, [GetCleanSum()]), | ||
| ), | ||
| settings=CapabilitySettings(), | ||
| ), | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 2pv572.py |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.