diff --git a/pyproject.toml b/pyproject.toml index fd195d3..553096f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "switchbot_api" -version = "2.7.0" +version = "2.8.0" description = "An asynchronous library to use Switchbot API" authors = ["Ravaka Razafimanantsoa "] license = "MIT" diff --git a/switchbot_api/__init__.py b/switchbot_api/__init__.py index 60cb9b4..3717f77 100644 --- a/switchbot_api/__init__.py +++ b/switchbot_api/__init__.py @@ -37,6 +37,7 @@ RGBWLightCommands, RGBWWLightCommands, RollerShadeCommands, + SmartRadiatorThermostatCommands, SpeakerCommands, Switch2PMCommands, SwitchCommands, @@ -54,6 +55,7 @@ from switchbot_api.models import ( BatteryCirculatorFanMode, PowerState, + SmartRadiatorThermostatMode, VacuumCleanMode, VacuumFanSpeed, VacuumFanSpeedV2, @@ -71,6 +73,7 @@ "CommonCommands", "CurtainCommands", "DVDCommands", + "Device", "DoorBellCommands", "FanCommands", "HumidifierCommands", @@ -82,9 +85,13 @@ "PowerState", "RGBWLightCommands", "RGBWWLightCommands", + "Remote", "RollerShadeCommands", + "SmartRadiatorThermostatCommands", + "SmartRadiatorThermostatMode", "SpeakerCommands", "Switch2PMCommands", + "SwitchBotAPI", "SwitchCommands", "T", "TVCommands", diff --git a/switchbot_api/commands.py b/switchbot_api/commands.py index 580ee7b..4738f95 100644 --- a/switchbot_api/commands.py +++ b/switchbot_api/commands.py @@ -384,4 +384,16 @@ class LightCommands(Commands): BRIGHTNESS_DOWN = "brightnessDown" +class SmartRadiatorThermostatCommands(Commands): + """Smart Radiator Thermostat commands.""" + + SET_MODE = "setMode" + SET_MANUAL_MODE_TEMPERATURE = "setManualModeTemperature" + + @classmethod + def get_supported_devices(cls) -> list[str]: + """Get supported devices.""" + return ["Smart Radiator Thermostat"] + + T = TypeVar("T", bound=CommonCommands) diff --git a/switchbot_api/models.py b/switchbot_api/models.py index 93bfd57..0c52eaa 100644 --- a/switchbot_api/models.py +++ b/switchbot_api/models.py @@ -45,3 +45,26 @@ class VacuumCleanMode(StrEnum): SWEEP = "sweep" MOP = "mop" SWEEP_MOP = "sweep_mop" + + +class SmartRadiatorThermostatMode(Enum): + """mode for Smart Radiator Thermostat .""" + + SCHEDULE = 0 + MANUAL = 1 + OFF = 2 + ENERGY_SAVING = 3 + COMFORT = 4 + FAST_HEATING = 5 + + @classmethod + def get_all_modes(cls) -> list[SmartRadiatorThermostatMode]: + """Get all modes as a list.""" + return [ + cls.SCHEDULE, + cls.MANUAL, + cls.OFF, + cls.ENERGY_SAVING, + cls.COMFORT, + cls.FAST_HEATING, + ]