Repository navigation
DEEBOT T90 PRO functions. Only map has bugs like rooms. #1701
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
Open
zhyf0610
wants to merge
14
commits into
DeebotUniverse:dev
Choose a base branch
from
zhyf0610:dev
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
c04e370
Add files via upload
zhyf0610 c3a1260
Merge pull request #1 from zhyf0610/add-T30-PRO-PLUS
zhyf0610 4d7a318
Merge branch 'dev' into dev
zhyf0610 6be305d
Update deebot_client/hardware/n9f2g8.py
edenhaus b4685ff
Apply suggestion from @edenhaus
edenhaus 6a0e656
Merge branch 'dev' into dev
zhyf0610 825fcc6
Merge branch 'DeebotUniverse:dev' into dev
zhyf0610 2ce71c7
Add files via upload
zhyf0610 c6f21ae
Update cr8hry.py
zhyf0610 7be28c0
Update cr8hry.py
zhyf0610 04fbca1
Update cr8hry.py
zhyf0610 540c515
Merge branch 'DeebotUniverse:dev' into dev
zhyf0610 02cd277
Merge branch 'dev' into dev
zhyf0610 b9162a0
Merge branch 'dev' into dev
zhyf0610 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,282 @@ | ||
| """Deebot T90 Pro Capabilities.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from deebot_client.capabilities import ( | ||
| Capabilities, | ||
| CapabilityClean, | ||
| CapabilityCleanAction, | ||
| CapabilityCustomCommand, | ||
| CapabilityEvent, | ||
| CapabilityExecute, | ||
| CapabilityExecuteTypes, | ||
| CapabilityLifeSpan, | ||
| CapabilityMap, | ||
| CapabilityNumber, | ||
| CapabilitySet, | ||
| CapabilitySetEnable, | ||
| CapabilitySettings, | ||
| CapabilitySetTypes, | ||
| CapabilityStation, | ||
| CapabilityStats, | ||
| CapabilityWater, | ||
| DeviceType, | ||
| ) | ||
| from deebot_client.commands import StationAction | ||
| from deebot_client.commands.json import station_action | ||
| from deebot_client.commands.json.auto_empty import GetAutoEmpty, SetAutoEmpty | ||
| from deebot_client.commands.json.battery import GetBattery | ||
| from deebot_client.commands.json.charge import Charge | ||
| from deebot_client.commands.json.charge_state import GetChargeState | ||
| from deebot_client.commands.json.child_lock import GetChildLock, SetChildLock | ||
| from deebot_client.commands.json.clean import CleanAreaV2, CleanV2, GetCleanInfo | ||
| from deebot_client.commands.json.clean_count import GetCleanCount, SetCleanCount | ||
| from deebot_client.commands.json.clean_logs import GetCleanLogs | ||
| from deebot_client.commands.json.continuous_cleaning import ( | ||
| GetContinuousCleaning, | ||
| SetContinuousCleaning, | ||
| ) | ||
| from deebot_client.commands.json.custom import CustomCommand | ||
| from deebot_client.commands.json.error import GetError | ||
| from deebot_client.commands.json.fan_speed import GetFanSpeed, SetFanSpeed | ||
| from deebot_client.commands.json.life_span import GetLifeSpan, ResetLifeSpan | ||
| from deebot_client.commands.json.map import ( | ||
| GetCachedMapInfo, | ||
| GetMajorMap, | ||
| GetMapInfoV2, | ||
| GetMapSetV2, | ||
| GetMapTrace, | ||
| GetMinorMap, | ||
| SetMajorMap, | ||
| ) | ||
| from deebot_client.commands.json.mop_auto_wash_frequency import ( | ||
| GetMopAutoWashFrequency, | ||
| SetMopAutoWashFrequency, | ||
| ) | ||
| from deebot_client.commands.json.multimap_state import ( | ||
| GetMultimapState, | ||
| SetMultimapState, | ||
| ) | ||
| from deebot_client.commands.json.network import GetNetInfo | ||
| from deebot_client.commands.json.ota import GetOta, SetOta | ||
| from deebot_client.commands.json.play_sound import PlaySound | ||
| from deebot_client.commands.json.pos import GetPos | ||
| from deebot_client.commands.json.relocation import SetRelocationState | ||
| from deebot_client.commands.json.station_state import GetStationState | ||
| from deebot_client.commands.json.stats import GetStats, GetTotalStats | ||
| from deebot_client.commands.json.sweep_mode import GetSweepMode, SetSweepMode | ||
| from deebot_client.commands.json.true_detect import GetTrueDetect, SetTrueDetect | ||
| from deebot_client.commands.json.voice_assistant_state import ( | ||
| GetVoiceAssistantState, | ||
| SetVoiceAssistantState, | ||
| ) | ||
| from deebot_client.commands.json.volume import GetVolume, SetVolume | ||
| from deebot_client.commands.json.water_info import GetWaterInfo, SetWaterInfo | ||
| from deebot_client.commands.json.work_mode import GetWorkMode, SetWorkMode | ||
| from deebot_client.const import DataType | ||
| from deebot_client.events import ( | ||
| AutoEmptyEvent, | ||
| AvailabilityEvent, | ||
| BatteryEvent, | ||
| CachedMapInfoEvent, | ||
| ChildLockEvent, | ||
| CleanCountEvent, | ||
| CleanLogEvent, | ||
| ContinuousCleaningEvent, | ||
| CustomCommandEvent, | ||
| ErrorEvent, | ||
| FanSpeedEvent, | ||
| FanSpeedLevel, | ||
| LifeSpan, | ||
| LifeSpanEvent, | ||
| MajorMapEvent, | ||
| MapChangedEvent, | ||
| MapTraceEvent, | ||
| MultimapStateEvent, | ||
| NetworkInfoEvent, | ||
| OtaEvent, | ||
| PositionsEvent, | ||
| ReportStatsEvent, | ||
| RoomsEvent, | ||
| StateEvent, | ||
| StationEvent, | ||
| StatsEvent, | ||
| SweepModeEvent, | ||
| TotalStatsEvent, | ||
| TrueDetectEvent, | ||
| VoiceAssistantStateEvent, | ||
| VolumeEvent, | ||
| WorkMode, | ||
| WorkModeEvent, | ||
| auto_empty, | ||
| water_info, | ||
| ) | ||
| from deebot_client.events.mop_auto_wash_frequency import MopAutoWashFrequencyEvent | ||
| from deebot_client.models import StaticDeviceInfo | ||
|
|
||
|
|
||
| def get_device_info() -> StaticDeviceInfo: | ||
| """Get device info for this model.""" | ||
| return StaticDeviceInfo( | ||
| DataType.JSON, | ||
| Capabilities( | ||
| device_type=DeviceType.VACUUM, | ||
| availability=CapabilityEvent( | ||
| AvailabilityEvent, [GetBattery(is_available_check=True)] | ||
| ), | ||
| battery=CapabilityEvent(BatteryEvent, [GetBattery()]), | ||
| charge=CapabilityExecute(Charge), | ||
| clean=CapabilityClean( | ||
| action=CapabilityCleanAction(command=CleanV2, area=CleanAreaV2), | ||
| continuous=CapabilitySetEnable( | ||
| ContinuousCleaningEvent, | ||
| [GetContinuousCleaning()], | ||
| SetContinuousCleaning, | ||
| ), | ||
| count=CapabilitySet(CleanCountEvent, [GetCleanCount()], SetCleanCount), | ||
| log=CapabilityEvent(CleanLogEvent, [GetCleanLogs()]), | ||
| work_mode=CapabilitySetTypes( | ||
| event=WorkModeEvent, | ||
| get=[GetWorkMode()], | ||
| set=SetWorkMode, | ||
| types=( | ||
| WorkMode.MOP, | ||
| WorkMode.MOP_AFTER_VACUUM, | ||
| WorkMode.VACUUM, | ||
| WorkMode.VACUUM_AND_MOP, | ||
| ), | ||
| ), | ||
| ), | ||
| custom=CapabilityCustomCommand( | ||
| event=CustomCommandEvent, get=[], set=CustomCommand | ||
| ), | ||
| error=CapabilityEvent(ErrorEvent, [GetError()]), | ||
| fan_speed=CapabilitySetTypes( | ||
| event=FanSpeedEvent, | ||
| get=[GetFanSpeed()], | ||
| set=SetFanSpeed, | ||
| types=( | ||
| FanSpeedLevel.QUIET, | ||
| FanSpeedLevel.NORMAL, | ||
| FanSpeedLevel.MAX, | ||
| FanSpeedLevel.MAX_PLUS, | ||
| ), | ||
| ), | ||
| life_span=CapabilityLifeSpan( | ||
| types=( | ||
| LifeSpan.BRUSH, | ||
| LifeSpan.CLEANING_SOLUTION, | ||
| LifeSpan.DUST_BAG, | ||
| LifeSpan.DUST_BUCKET, | ||
| LifeSpan.DUST_CONTAINER_FILTER, | ||
| LifeSpan.FILTER, | ||
| LifeSpan.HEAVY_DUTY_CLEANING_SOLUTION, | ||
| LifeSpan.MOP_WASHING_TRAY, | ||
| LifeSpan.ROUND_MOP, | ||
| LifeSpan.SIDE_BRUSH, | ||
| LifeSpan.STRAINER, | ||
| LifeSpan.UNIT_CARE, | ||
| ), | ||
| event=LifeSpanEvent, | ||
| get=[ | ||
| GetLifeSpan( | ||
| [ | ||
| LifeSpan.BRUSH, | ||
| LifeSpan.CLEANING_SOLUTION, | ||
| LifeSpan.DUST_BAG, | ||
| LifeSpan.DUST_BUCKET, | ||
| LifeSpan.DUST_CONTAINER_FILTER, | ||
| LifeSpan.FILTER, | ||
| LifeSpan.HEAVY_DUTY_CLEANING_SOLUTION, | ||
| LifeSpan.MOP_WASHING_TRAY, | ||
| LifeSpan.ROUND_MOP, | ||
| LifeSpan.SIDE_BRUSH, | ||
| LifeSpan.STRAINER, | ||
| LifeSpan.UNIT_CARE, | ||
| ] | ||
| ) | ||
| ], | ||
| reset=ResetLifeSpan, | ||
| ), | ||
| map=CapabilityMap( | ||
| cached_info=CapabilityEvent(CachedMapInfoEvent, [GetCachedMapInfo()]), | ||
| changed=CapabilityEvent(MapChangedEvent, []), | ||
| info=CapabilityExecute(GetMapInfoV2), | ||
| major=CapabilitySet(MajorMapEvent, [GetMajorMap()], SetMajorMap), | ||
| minor=CapabilityExecute(GetMinorMap), | ||
| multi_state=CapabilitySetEnable( | ||
| MultimapStateEvent, [GetMultimapState()], SetMultimapState | ||
| ), | ||
| position=CapabilityEvent(PositionsEvent, [GetPos()]), | ||
| relocation=CapabilityExecute(SetRelocationState), | ||
| rooms=CapabilityEvent(RoomsEvent, [GetCachedMapInfo()]), | ||
| set=CapabilityExecute(GetMapSetV2), | ||
| trace=CapabilityEvent(MapTraceEvent, [GetMapTrace()]), | ||
| ), | ||
| network=CapabilityEvent(NetworkInfoEvent, [GetNetInfo()]), | ||
| play_sound=CapabilityExecute(PlaySound), | ||
| settings=CapabilitySettings( | ||
| sweep_mode=CapabilitySetEnable( | ||
| SweepModeEvent, [GetSweepMode()], SetSweepMode | ||
| ), | ||
| child_lock=CapabilitySetEnable( | ||
| ChildLockEvent, [GetChildLock()], SetChildLock | ||
| ), | ||
| volume=CapabilitySet(VolumeEvent, [GetVolume()], SetVolume), | ||
| true_detect=CapabilitySetEnable( | ||
| TrueDetectEvent, [GetTrueDetect()], SetTrueDetect | ||
| ), | ||
| mop_auto_wash_frequency=CapabilityNumber( | ||
| event=MopAutoWashFrequencyEvent, | ||
| get=[GetMopAutoWashFrequency()], | ||
| set=SetMopAutoWashFrequency, | ||
| min=0, | ||
| max=60, | ||
| ), | ||
| ota=CapabilitySetEnable(OtaEvent, [GetOta()], SetOta), | ||
| voice_assistant=CapabilitySetEnable( | ||
| VoiceAssistantStateEvent, | ||
| [GetVoiceAssistantState()], | ||
| SetVoiceAssistantState, | ||
| ), | ||
| ), | ||
| state=CapabilityEvent(StateEvent, [GetChargeState(), GetCleanInfo()]), | ||
| station=CapabilityStation( | ||
| action=CapabilityExecuteTypes( | ||
| station_action.StationAction, | ||
| types=( | ||
| StationAction.EMPTY_DUSTBIN, | ||
| StationAction.DRY_MOP, | ||
| StationAction.WASH_MOP, | ||
| ), | ||
| ), | ||
| auto_empty=CapabilitySetTypes( | ||
| event=AutoEmptyEvent, | ||
| get=[GetAutoEmpty()], | ||
| set=SetAutoEmpty, | ||
| types=( | ||
| auto_empty.Frequency.AUTO, | ||
| auto_empty.Frequency.SMART, | ||
| ), | ||
| ), | ||
| state=CapabilityEvent(StationEvent, [GetStationState()]), | ||
| ), | ||
| stats=CapabilityStats( | ||
| clean=CapabilityEvent(StatsEvent, [GetStats()]), | ||
| report=CapabilityEvent(ReportStatsEvent, []), | ||
| total=CapabilityEvent(TotalStatsEvent, [GetTotalStats()]), | ||
| ), | ||
| water=CapabilityWater( | ||
| amount=CapabilityNumber( | ||
| event=water_info.WaterCustomAmountEvent, | ||
| get=[GetWaterInfo()], | ||
| set=lambda custom_amount: SetWaterInfo(custom_amount=custom_amount), | ||
| min=0, | ||
| max=50, | ||
| ), | ||
| mop_attached=CapabilityEvent( | ||
| water_info.MopAttachedEvent, [GetWaterInfo()] | ||
| ), | ||
| ), | ||
| ), | ||
| ) | ||
Oops, something went wrong.
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.
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.
as the map is not working from your PR description we should not set it.
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.
Well , map works. But room function doesn't work.


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.
ah okay then pls just fix the CI :)
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.
CI fixed.