3 Commits 1a02c31c9e ... a5308d2247

Author SHA1 Message Date
  J. Nick Koston a5308d2247 Release 0.68.4 (#385) 9 months ago
  pre-commit-ci[bot] 304bb9ebad chore(pre-commit.ci): pre-commit autoupdate (#383) 9 months ago
  Retha Runolfsson 29cc64ea44 fix evaporative humidifier mode settings (#384) 9 months ago

+ 2 - 2
.pre-commit-config.yaml

@@ -14,7 +14,7 @@ repos:
       - id: commitizen
         stages: [commit-msg]
   - repo: https://github.com/pre-commit/pre-commit-hooks
-    rev: v5.0.0
+    rev: v6.0.0
     hooks:
       - id: debug-statements
       - id: check-builtin-literals
@@ -38,7 +38,7 @@ repos:
       - id: pyupgrade
         args: [--py311-plus]
   - repo: https://github.com/astral-sh/ruff-pre-commit
-    rev: v0.12.7
+    rev: v0.12.8
     hooks:
       - id: ruff
         args: [--fix]

+ 1 - 1
setup.py

@@ -20,7 +20,7 @@ setup(
         "cryptography>=39.0.0",
         "pyOpenSSL>=23.0.0",
     ],
-    version="0.68.3",
+    version="0.68.4",
     description="A library to communicate with Switchbot",
     long_description=long_description,
     long_description_content_type="text/markdown",

+ 4 - 1
switchbot/devices/evaporative_humidifier.py

@@ -149,8 +149,11 @@ class SwitchbotEvaporativeHumidifier(SwitchbotSequenceDevice, SwitchbotEncrypted
         result = await self._send_command(command)
         return self._check_command_result(result, 0, {1})
 
-    def _validate_water_level(self) -> None:
+    def _validate_water_level(self, mode: HumidifierMode | None = None) -> None:
         """Validate that the water level is not empty."""
+        if mode == HumidifierMode.DRYING_FILTER:
+            return
+
         if self.get_water_level() == HumidifierWaterLevel.EMPTY.name.lower():
             raise SwitchbotOperationError(
                 "Cannot perform operation when water tank is empty"

+ 1 - 0
tests/test_evaporative_humidifier.py

@@ -250,6 +250,7 @@ async def test_set_target_humidity():
 async def test_set_mode(mode, command):
     """Test setting mode."""
     device = create_device_for_command_testing()
+    device._validate_water_level(mode)
     device.get_target_humidity = MagicMock(return_value=45)
 
     await device.set_mode(mode)