From 3d3869c5816461828b91336f11ec058e07585c96 Mon Sep 17 00:00:00 2001 From: elpigeondindo Date: Tue, 10 Dec 2024 17:51:12 +0100 Subject: [PATCH 1/3] Create xco2fc.py Add support for T30S Pro Omni --- deebot_client/hardware/deebot/xco2fc.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 deebot_client/hardware/deebot/xco2fc.py diff --git a/deebot_client/hardware/deebot/xco2fc.py b/deebot_client/hardware/deebot/xco2fc.py new file mode 100644 index 00000000..94a9dbce --- /dev/null +++ b/deebot_client/hardware/deebot/xco2fc.py @@ -0,0 +1 @@ +p1jij8.py From d5b45c41772a3afd773ba0c07ccbe180e0c4d6dc Mon Sep 17 00:00:00 2001 From: elpigeondindo Date: Tue, 10 Dec 2024 18:08:15 +0100 Subject: [PATCH 2/3] Add support for T30S Pro omni Add the config in the file --- deebot_client/hardware/deebot/xco2fc.py | 199 +++++++++++++++++++++++- 1 file changed, 198 insertions(+), 1 deletion(-) diff --git a/deebot_client/hardware/deebot/xco2fc.py b/deebot_client/hardware/deebot/xco2fc.py index 94a9dbce..a9c2094e 100644 --- a/deebot_client/hardware/deebot/xco2fc.py +++ b/deebot_client/hardware/deebot/xco2fc.py @@ -1 +1,198 @@ -p1jij8.py +"""Deebot T20 Omni Capabilities.""" + +from __future__ import annotations + +from deebot_client.capabilities import ( + Capabilities, + CapabilityClean, + CapabilityCleanAction, + CapabilityCustomCommand, + CapabilityEvent, + CapabilityExecute, + CapabilityLifeSpan, + CapabilityMap, + CapabilitySet, + CapabilitySetEnable, + CapabilitySettings, + CapabilitySetTypes, + CapabilityStats, + DeviceType, +) +from deebot_client.commands.json.advanced_mode import GetAdvancedMode, SetAdvancedMode +from deebot_client.commands.json.battery import GetBattery +from deebot_client.commands.json.carpet import ( + GetCarpetAutoFanBoost, + SetCarpetAutoFanBoost, +) +from deebot_client.commands.json.charge import Charge +from deebot_client.commands.json.charge_state import GetChargeState +from deebot_client.commands.json.clean import Clean, CleanArea, 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.clean_preference import ( + GetCleanPreference, + SetCleanPreference, +) +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, GetMapTrace +from deebot_client.commands.json.multimap_state import ( + GetMultimapState, + SetMultimapState, +) +from deebot_client.commands.json.network import GetNetInfo +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.stats import GetStats, GetTotalStats +from deebot_client.commands.json.true_detect import GetTrueDetect, SetTrueDetect +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 ( + AdvancedModeEvent, + AvailabilityEvent, + BatteryEvent, + CachedMapInfoEvent, + CarpetAutoFanBoostEvent, + CleanCountEvent, + CleanLogEvent, + CleanPreferenceEvent, + ContinuousCleaningEvent, + CustomCommandEvent, + ErrorEvent, + FanSpeedEvent, + FanSpeedLevel, + LifeSpan, + LifeSpanEvent, + MajorMapEvent, + MapChangedEvent, + MapTraceEvent, + MultimapStateEvent, + NetworkInfoEvent, + PositionsEvent, + ReportStatsEvent, + RoomsEvent, + StateEvent, + StatsEvent, + TotalStatsEvent, + TrueDetectEvent, + VolumeEvent, + WaterAmount, + WaterInfoEvent, + WorkMode, + WorkModeEvent, +) +from deebot_client.models import StaticDeviceInfo +from deebot_client.util import short_name + +from . import DEVICES + +DEVICES[short_name(__name__)] = 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=Clean, area=CleanArea), + continuous=CapabilitySetEnable( + ContinuousCleaningEvent, + [GetContinuousCleaning()], + SetContinuousCleaning, + ), + count=CapabilitySet(CleanCountEvent, [GetCleanCount()], SetCleanCount), + log=CapabilityEvent(CleanLogEvent, [GetCleanLogs()]), + preference=CapabilitySetEnable( + CleanPreferenceEvent, [GetCleanPreference()], SetCleanPreference + ), + 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.FILTER, LifeSpan.SIDE_BRUSH), + event=LifeSpanEvent, + get=[GetLifeSpan([LifeSpan.BRUSH, LifeSpan.FILTER, LifeSpan.SIDE_BRUSH])], + reset=ResetLifeSpan, + ), + map=CapabilityMap( + cached_info=CapabilityEvent(CachedMapInfoEvent, [GetCachedMapInfo()]), + changed=CapabilityEvent(MapChangedEvent, []), + major=CapabilityEvent(MajorMapEvent, [GetMajorMap()]), + multi_state=CapabilitySetEnable( + MultimapStateEvent, [GetMultimapState()], SetMultimapState + ), + position=CapabilityEvent(PositionsEvent, [GetPos()]), + relocation=CapabilityExecute(SetRelocationState), + rooms=CapabilityEvent(RoomsEvent, [GetCachedMapInfo()]), + trace=CapabilityEvent(MapTraceEvent, [GetMapTrace()]), + ), + network=CapabilityEvent(NetworkInfoEvent, [GetNetInfo()]), + play_sound=CapabilityExecute(PlaySound), + settings=CapabilitySettings( + advanced_mode=CapabilitySetEnable( + AdvancedModeEvent, [GetAdvancedMode()], SetAdvancedMode + ), + carpet_auto_fan_boost=CapabilitySetEnable( + CarpetAutoFanBoostEvent, + [GetCarpetAutoFanBoost()], + SetCarpetAutoFanBoost, + ), + true_detect=CapabilitySetEnable( + TrueDetectEvent, [GetTrueDetect()], SetTrueDetect + ), + volume=CapabilitySet(VolumeEvent, [GetVolume()], SetVolume), + ), + state=CapabilityEvent(StateEvent, [GetChargeState(), GetCleanInfo()]), + stats=CapabilityStats( + clean=CapabilityEvent(StatsEvent, [GetStats()]), + report=CapabilityEvent(ReportStatsEvent, []), + total=CapabilityEvent(TotalStatsEvent, [GetTotalStats()]), + ), + water=CapabilitySetTypes( + event=WaterInfoEvent, + get=[GetWaterInfo()], + set=SetWaterInfo, + types=( + WaterAmount.LOW, + WaterAmount.MEDIUM, + WaterAmount.HIGH, + WaterAmount.ULTRAHIGH, + ), + ), + ), +) From 72ae88e3d008cd3c78cc5770e3c48748228fc631 Mon Sep 17 00:00:00 2001 From: elpigeondindo Date: Tue, 10 Dec 2024 18:12:51 +0100 Subject: [PATCH 3/3] Update xco2fc.py --- deebot_client/hardware/deebot/xco2fc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deebot_client/hardware/deebot/xco2fc.py b/deebot_client/hardware/deebot/xco2fc.py index a9c2094e..c27af33f 100644 --- a/deebot_client/hardware/deebot/xco2fc.py +++ b/deebot_client/hardware/deebot/xco2fc.py @@ -1,4 +1,4 @@ -"""Deebot T20 Omni Capabilities.""" +"""Deebot T30S Pro Omni Capabilities.""" from __future__ import annotations