From b81640ec7437ea60a195034ba0394cab63b5dd45 Mon Sep 17 00:00:00 2001 From: XiaoLing-git Date: Mon, 15 Sep 2025 21:03:55 +0800 Subject: [PATCH 01/10] add Smart_Radiator_ThermostatCommands --- switchbot_api/__init__.py | 3 +++ switchbot_api/commands.py | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/switchbot_api/__init__.py b/switchbot_api/__init__.py index 60cb9b4..0bdad31 100644 --- a/switchbot_api/__init__.py +++ b/switchbot_api/__init__.py @@ -60,6 +60,9 @@ ) __all__ = [ + "Device", + "Remote", + "SwitchBotAPI", "AirConditionerCommands", "AirPurifierCommands", "BatteryCirculatorFanCommands", diff --git a/switchbot_api/commands.py b/switchbot_api/commands.py index 580ee7b..2ed1247 100644 --- a/switchbot_api/commands.py +++ b/switchbot_api/commands.py @@ -383,5 +383,16 @@ class LightCommands(Commands): BRIGHTNESS_UP = "brightnessUp" BRIGHTNESS_DOWN = "brightnessDown" +class Smart_Radiator_ThermostatCommands(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) From e24120e260553e0aa37d866e51e8d63a36ac136a Mon Sep 17 00:00:00 2001 From: XiaoLing-git Date: Mon, 15 Sep 2025 21:10:44 +0800 Subject: [PATCH 02/10] add SmartRadiatorThermostatMode --- switchbot_api/__init__.py | 3 ++- switchbot_api/commands.py | 2 +- switchbot_api/models.py | 11 +++++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/switchbot_api/__init__.py b/switchbot_api/__init__.py index 0bdad31..149e5ed 100644 --- a/switchbot_api/__init__.py +++ b/switchbot_api/__init__.py @@ -44,7 +44,7 @@ TVCommands, VacuumCleanerV2Commands, VacuumCleanerV3Commands, - VacuumCommands, + VacuumCommands, SmartRadiatorThermostatCommands, ) from switchbot_api.exceptions import ( SwitchBotAuthenticationError, @@ -97,6 +97,7 @@ "VacuumCommands", "VacuumFanSpeed", "VacuumFanSpeedV2", + "SmartRadiatorThermostatCommands", ] _API_HOST = "https://api.switch-bot.com" diff --git a/switchbot_api/commands.py b/switchbot_api/commands.py index 2ed1247..274fd29 100644 --- a/switchbot_api/commands.py +++ b/switchbot_api/commands.py @@ -383,7 +383,7 @@ class LightCommands(Commands): BRIGHTNESS_UP = "brightnessUp" BRIGHTNESS_DOWN = "brightnessDown" -class Smart_Radiator_ThermostatCommands(Commands): +class SmartRadiatorThermostatCommands(Commands): """Smart Radiator Thermostat commands.""" SET_MODE = "setMode" diff --git a/switchbot_api/models.py b/switchbot_api/models.py index 93bfd57..1871018 100644 --- a/switchbot_api/models.py +++ b/switchbot_api/models.py @@ -45,3 +45,14 @@ class VacuumCleanMode(StrEnum): SWEEP = "sweep" MOP = "mop" SWEEP_MOP = "sweep_mop" + + +class SmartRadiatorThermostatMode(Enum): + """mode for Smart Radiator Thermostat .""" + + SCHEDULE = 0 + MANUEL = 1 + OFF = 2 + ENERGY_SAVING = 3 + COMFORT = 4 + FAST_HEARTING = 5 From 00d43fabaf1a4a252dac161c66eeda18cdce8244 Mon Sep 17 00:00:00 2001 From: XiaoLing-git Date: Mon, 15 Sep 2025 21:11:42 +0800 Subject: [PATCH 03/10] format code --- switchbot_api/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/switchbot_api/__init__.py b/switchbot_api/__init__.py index 149e5ed..904c4c3 100644 --- a/switchbot_api/__init__.py +++ b/switchbot_api/__init__.py @@ -44,7 +44,8 @@ TVCommands, VacuumCleanerV2Commands, VacuumCleanerV3Commands, - VacuumCommands, SmartRadiatorThermostatCommands, + VacuumCommands, + SmartRadiatorThermostatCommands, ) from switchbot_api.exceptions import ( SwitchBotAuthenticationError, @@ -57,6 +58,7 @@ VacuumCleanMode, VacuumFanSpeed, VacuumFanSpeedV2, + SmartRadiatorThermostatMode, ) __all__ = [ @@ -98,6 +100,7 @@ "VacuumFanSpeed", "VacuumFanSpeedV2", "SmartRadiatorThermostatCommands", + "SmartRadiatorThermostatMode" ] _API_HOST = "https://api.switch-bot.com" From 226e3e4343e1abd018b3bd69185ca2a63d51719c Mon Sep 17 00:00:00 2001 From: XiaoLing-git Date: Mon, 15 Sep 2025 21:14:16 +0800 Subject: [PATCH 04/10] update version to 2.7.1 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index fd195d3..07e6406 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "switchbot_api" -version = "2.7.0" +version = "2.7.1" description = "An asynchronous library to use Switchbot API" authors = ["Ravaka Razafimanantsoa "] license = "MIT" From c320239f69ddeb0e9c5da9fdab0b46046d78389d Mon Sep 17 00:00:00 2001 From: XiaoLing-git Date: Mon, 15 Sep 2025 21:25:41 +0800 Subject: [PATCH 05/10] format code --- switchbot_api/__init__.py | 14 +++++++------- switchbot_api/commands.py | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/switchbot_api/__init__.py b/switchbot_api/__init__.py index 904c4c3..3717f77 100644 --- a/switchbot_api/__init__.py +++ b/switchbot_api/__init__.py @@ -37,6 +37,7 @@ RGBWLightCommands, RGBWWLightCommands, RollerShadeCommands, + SmartRadiatorThermostatCommands, SpeakerCommands, Switch2PMCommands, SwitchCommands, @@ -45,7 +46,6 @@ VacuumCleanerV2Commands, VacuumCleanerV3Commands, VacuumCommands, - SmartRadiatorThermostatCommands, ) from switchbot_api.exceptions import ( SwitchBotAuthenticationError, @@ -55,16 +55,13 @@ from switchbot_api.models import ( BatteryCirculatorFanMode, PowerState, + SmartRadiatorThermostatMode, VacuumCleanMode, VacuumFanSpeed, VacuumFanSpeedV2, - SmartRadiatorThermostatMode, ) __all__ = [ - "Device", - "Remote", - "SwitchBotAPI", "AirConditionerCommands", "AirPurifierCommands", "BatteryCirculatorFanCommands", @@ -76,6 +73,7 @@ "CommonCommands", "CurtainCommands", "DVDCommands", + "Device", "DoorBellCommands", "FanCommands", "HumidifierCommands", @@ -87,9 +85,13 @@ "PowerState", "RGBWLightCommands", "RGBWWLightCommands", + "Remote", "RollerShadeCommands", + "SmartRadiatorThermostatCommands", + "SmartRadiatorThermostatMode", "SpeakerCommands", "Switch2PMCommands", + "SwitchBotAPI", "SwitchCommands", "T", "TVCommands", @@ -99,8 +101,6 @@ "VacuumCommands", "VacuumFanSpeed", "VacuumFanSpeedV2", - "SmartRadiatorThermostatCommands", - "SmartRadiatorThermostatMode" ] _API_HOST = "https://api.switch-bot.com" diff --git a/switchbot_api/commands.py b/switchbot_api/commands.py index 274fd29..4738f95 100644 --- a/switchbot_api/commands.py +++ b/switchbot_api/commands.py @@ -383,6 +383,7 @@ class LightCommands(Commands): BRIGHTNESS_UP = "brightnessUp" BRIGHTNESS_DOWN = "brightnessDown" + class SmartRadiatorThermostatCommands(Commands): """Smart Radiator Thermostat commands.""" From 8b2d0a301e2662422f21a0f1d3dcbdfc7b15d4ba Mon Sep 17 00:00:00 2001 From: XiaoLing-git Date: Tue, 16 Sep 2025 15:32:29 +0800 Subject: [PATCH 06/10] add get_all_modes --- switchbot_api/models.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/switchbot_api/models.py b/switchbot_api/models.py index 1871018..6fec37e 100644 --- a/switchbot_api/models.py +++ b/switchbot_api/models.py @@ -56,3 +56,15 @@ class SmartRadiatorThermostatMode(Enum): ENERGY_SAVING = 3 COMFORT = 4 FAST_HEARTING = 5 + + @classmethod + def get_all_modes(cls) -> list[SmartRadiatorThermostatMode]: + """Get all modes as a list.""" + return [ + cls.SCHEDULE, + cls.MANUEL, + cls.OFF, + cls.ENERGY_SAVING, + cls.COMFORT, + cls.FAST_HEARTING, + ] From ff8e17761bfdce3275e161d1a642ffc21a5aae93 Mon Sep 17 00:00:00 2001 From: Samuel Xiao <40679757+XiaoLing-git@users.noreply.github.com> Date: Wed, 17 Sep 2025 20:32:18 +0800 Subject: [PATCH 07/10] Update pyproject.toml Co-authored-by: Ravaka Razafimanantsoa <3774520+SeraphicRav@users.noreply.github.com> --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 07e6406..553096f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "switchbot_api" -version = "2.7.1" +version = "2.8.0" description = "An asynchronous library to use Switchbot API" authors = ["Ravaka Razafimanantsoa "] license = "MIT" From 8d630143b3e8bbc9921ab988c96f9b04244f96c5 Mon Sep 17 00:00:00 2001 From: Samuel Xiao <40679757+XiaoLing-git@users.noreply.github.com> Date: Wed, 17 Sep 2025 20:32:39 +0800 Subject: [PATCH 08/10] Update switchbot_api/models.py Co-authored-by: Ravaka Razafimanantsoa <3774520+SeraphicRav@users.noreply.github.com> --- switchbot_api/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/switchbot_api/models.py b/switchbot_api/models.py index 6fec37e..4f43f06 100644 --- a/switchbot_api/models.py +++ b/switchbot_api/models.py @@ -51,7 +51,7 @@ class SmartRadiatorThermostatMode(Enum): """mode for Smart Radiator Thermostat .""" SCHEDULE = 0 - MANUEL = 1 + MANUAL = 1 OFF = 2 ENERGY_SAVING = 3 COMFORT = 4 From 9eed0d3d9613db964a387abe29dfa97d9f179b18 Mon Sep 17 00:00:00 2001 From: Samuel Xiao <40679757+XiaoLing-git@users.noreply.github.com> Date: Wed, 17 Sep 2025 20:32:50 +0800 Subject: [PATCH 09/10] Update switchbot_api/models.py Co-authored-by: Ravaka Razafimanantsoa <3774520+SeraphicRav@users.noreply.github.com> --- switchbot_api/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/switchbot_api/models.py b/switchbot_api/models.py index 4f43f06..2eff164 100644 --- a/switchbot_api/models.py +++ b/switchbot_api/models.py @@ -55,7 +55,7 @@ class SmartRadiatorThermostatMode(Enum): OFF = 2 ENERGY_SAVING = 3 COMFORT = 4 - FAST_HEARTING = 5 + FAST_HEATING = 5 @classmethod def get_all_modes(cls) -> list[SmartRadiatorThermostatMode]: From 57b961a09acf0da29b72de67f1e9ddd3c59eb8ab Mon Sep 17 00:00:00 2001 From: XiaoLing-git Date: Wed, 17 Sep 2025 20:34:13 +0800 Subject: [PATCH 10/10] update code --- switchbot_api/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/switchbot_api/models.py b/switchbot_api/models.py index 2eff164..0c52eaa 100644 --- a/switchbot_api/models.py +++ b/switchbot_api/models.py @@ -62,9 +62,9 @@ def get_all_modes(cls) -> list[SmartRadiatorThermostatMode]: """Get all modes as a list.""" return [ cls.SCHEDULE, - cls.MANUEL, + cls.MANUAL, cls.OFF, cls.ENERGY_SAVING, cls.COMFORT, - cls.FAST_HEARTING, + cls.FAST_HEATING, ]