Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <contact@ravaka.dev>"]
license = "MIT"
Expand Down
7 changes: 7 additions & 0 deletions switchbot_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
RGBWLightCommands,
RGBWWLightCommands,
RollerShadeCommands,
SmartRadiatorThermostatCommands,
SpeakerCommands,
Switch2PMCommands,
SwitchCommands,
Expand All @@ -54,6 +55,7 @@
from switchbot_api.models import (
BatteryCirculatorFanMode,
PowerState,
SmartRadiatorThermostatMode,
VacuumCleanMode,
VacuumFanSpeed,
VacuumFanSpeedV2,
Expand All @@ -71,6 +73,7 @@
"CommonCommands",
"CurtainCommands",
"DVDCommands",
"Device",
"DoorBellCommands",
"FanCommands",
"HumidifierCommands",
Expand All @@ -82,9 +85,13 @@
"PowerState",
"RGBWLightCommands",
"RGBWWLightCommands",
"Remote",
"RollerShadeCommands",
"SmartRadiatorThermostatCommands",
"SmartRadiatorThermostatMode",
"SpeakerCommands",
"Switch2PMCommands",
"SwitchBotAPI",
"SwitchCommands",
"T",
"TVCommands",
Expand Down
12 changes: 12 additions & 0 deletions switchbot_api/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
23 changes: 23 additions & 0 deletions switchbot_api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
]
Loading