PySwitchbot 3.1.0__tar.gz → 3.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/PKG-INFO +1 -1
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/pyproject.toml +1 -1
- pyswitchbot-3.2.0/switchbot/__version__.py +1 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/devices/bot.py +17 -0
- pyswitchbot-3.1.0/switchbot/__version__.py +0 -1
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/LICENSE +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/README.md +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/__init__.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/adv_parser.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/adv_parsers/__init__.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/adv_parsers/_sensor_th.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/adv_parsers/air_purifier.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/adv_parsers/art_frame.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/adv_parsers/blind_tilt.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/adv_parsers/bot.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/adv_parsers/bulb.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/adv_parsers/ceiling_light.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/adv_parsers/climate_panel.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/adv_parsers/contact.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/adv_parsers/curtain.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/adv_parsers/fan.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/adv_parsers/hub2.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/adv_parsers/hub3.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/adv_parsers/hubmini_matter.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/adv_parsers/humidifier.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/adv_parsers/keypad.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/adv_parsers/keypad_vision.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/adv_parsers/leak.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/adv_parsers/light_strip.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/adv_parsers/lock.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/adv_parsers/meter.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/adv_parsers/motion.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/adv_parsers/plug.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/adv_parsers/presence_sensor.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/adv_parsers/relay_switch.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/adv_parsers/remote.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/adv_parsers/roller_shade.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/adv_parsers/smart_thermostat_radiator.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/adv_parsers/vacuum.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/adv_parsers/weather_station.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/api_config.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/const/__init__.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/const/air_purifier.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/const/climate.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/const/evaporative_humidifier.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/const/fan.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/const/hub2.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/const/hub3.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/const/light.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/const/lock.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/const/presence_sensor.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/devices/__init__.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/devices/air_purifier.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/devices/art_frame.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/devices/base_cover.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/devices/base_light.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/devices/blind_tilt.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/devices/bulb.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/devices/ceiling_light.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/devices/contact.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/devices/curtain.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/devices/device.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/devices/evaporative_humidifier.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/devices/fan.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/devices/humidifier.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/devices/keypad.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/devices/keypad_vision.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/devices/light_strip.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/devices/lock.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/devices/meter.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/devices/meter_pro.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/devices/motion.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/devices/plug.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/devices/relay_switch.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/devices/roller_shade.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/devices/smart_thermostat_radiator.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/devices/universal_remote.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/devices/vacuum.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/discovery.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/enum.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/helpers.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/models.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/oauth.py +0 -0
- {pyswitchbot-3.1.0 → pyswitchbot-3.2.0}/switchbot/utils.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "3.2.0"
|
|
@@ -9,6 +9,7 @@ from .device import (
|
|
|
9
9
|
DEVICE_SET_EXTENDED_KEY,
|
|
10
10
|
DEVICE_SET_MODE_KEY,
|
|
11
11
|
SwitchbotDeviceOverrideStateDuringConnection,
|
|
12
|
+
SwitchbotOperationError,
|
|
12
13
|
update_after_operation,
|
|
13
14
|
)
|
|
14
15
|
|
|
@@ -90,6 +91,18 @@ class Switchbot(SwitchbotDeviceOverrideStateDuringConnection):
|
|
|
90
91
|
result = await self._send_command(DEVICE_SET_MODE_KEY + strength_key + mode_key)
|
|
91
92
|
return self._check_command_result(result, 0, {1})
|
|
92
93
|
|
|
94
|
+
async def set_inverse_direction(self, inverse: bool) -> bool:
|
|
95
|
+
"""Set the Bot's inverse direction while preserving its other mode settings."""
|
|
96
|
+
if not (settings := await self.get_basic_info()):
|
|
97
|
+
raise SwitchbotOperationError(
|
|
98
|
+
f"{self.name}: Unable to get current Bot mode settings"
|
|
99
|
+
)
|
|
100
|
+
return await self.set_switch_mode(
|
|
101
|
+
switch_mode=settings["switchMode"],
|
|
102
|
+
strength=settings["strength"],
|
|
103
|
+
inverse=inverse,
|
|
104
|
+
)
|
|
105
|
+
|
|
93
106
|
@update_after_operation
|
|
94
107
|
async def set_long_press(self, duration: int = 0) -> bool:
|
|
95
108
|
"""Set bot long press duration."""
|
|
@@ -121,3 +134,7 @@ class Switchbot(SwitchbotDeviceOverrideStateDuringConnection):
|
|
|
121
134
|
if self._inverse:
|
|
122
135
|
return not value
|
|
123
136
|
return value
|
|
137
|
+
|
|
138
|
+
def inverse_direction(self) -> bool | None:
|
|
139
|
+
"""Return the cached inverse direction setting."""
|
|
140
|
+
return self._get_adv_value("inverseDirection")
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "3.1.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|