Skip to content
Closed
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: 2 additions & 0 deletions docs/supported.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
| Switcher Mini | [product][switcher-mini] | 1.x.x | No |
| Switcher Touch (V3) | [product][switcher-touch] | 1.x.x | No |
| Switcher V4 | [product][switcher-v4] | 1.x.x | No |
| Switcher On Wall | [product][switcher-on-wall] | 6.1.x | Yes |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# First, let's find where DeviceType.ON_WALL is defined and check the token requirement
find . -type f -name "*.py" | head -20

Repository: TomerFi/aioswitcher

Length of output: 699


🏁 Script executed:

# Search for ON_WALL in the codebase
rg "ON_WALL" --type py

Repository: TomerFi/aioswitcher

Length of output: 370


🏁 Script executed:

# Also search for the supported.md file to check the current state
cat docs/supported.md

Repository: TomerFi/aioswitcher

Length of output: 3884


🏁 Script executed:

# Let's examine the DeviceType definition to understand what that False parameter means
sed -n '1,100p' src/aioswitcher/device/__init__.py | head -50

Repository: TomerFi/aioswitcher

Length of output: 1983


🏁 Script executed:

# Search for token_needed in the codebase to understand the parameter meaning
rg "token_needed" --type py -B 2 -A 2

Repository: TomerFi/aioswitcher

Length of output: 12453


🏁 Script executed:

# Let's verify if there's any special handling for ON_WALL token requirements
rg "ON_WALL" --type py -B 5 -A 5

Repository: TomerFi/aioswitcher

Length of output: 2952


Update documentation to reflect that Switcher On Wall doesn't require a token.

The code defines DeviceType.ON_WALL with token_needed=False, and tests confirm this requirement, but the supported devices table lists "Requires token: Yes". This should be corrected.

Suggested fix
-| Switcher On Wall         |    [product][switcher-on-wall]      |         6.1.x         |         Yes        |
+| Switcher On Wall         |    [product][switcher-on-wall]      |         6.1.x         |         No         |

Also applies to: 28-28

🤖 Prompt for AI Agents
In `@docs/supported.md` at line 7, The supported devices table incorrectly states
"Requires token: Yes" for Switcher On Wall; update the docs/supported.md table
row(s) for "Switcher On Wall" to show "No" under the "Requires token" column to
match the code symbol DeviceType.ON_WALL (token_needed=False) and the tests;
search for any other occurrences of "Switcher On Wall" in docs/supported.md
(including the noted second occurrence) and change their "Yes" to "No" so the
documentation aligns with the implementation.

| Switcher Power Plug | [product][switcher-power-plug] | 2.x.x | No |
| Switcher Breeze | [product][switcher-breeze] | 3.x.x | No |
| Switcher Runner | [product][switcher-runner] | 3.x.x | No |
Expand All @@ -24,6 +25,7 @@
[switcher-mini]: https://switcher.co.il/%D7%9E%D7%95%D7%A6%D7%A8/switcher-mini/
[switcher-touch]: https://switcher.co.il/%D7%9E%D7%95%D7%A6%D7%A8/%D7%A1%D7%95%D7%95%D7%99%D7%A6%D7%A8-touch/
[switcher-v4]: https://switcher.co.il/%D7%9E%D7%95%D7%A6%D7%A8/switcher-v4/
[switcher-on-wall]: https://switcher.co.il/%D7%9E%D7%95%D7%A6%D7%A8/switcher-on-wall/
[switcher-power-plug]: https://switcher.co.il/%D7%9E%D7%95%D7%A6%D7%A8/%d7%a1%d7%95%d7%95%d7%99%d7%a6%d7%a8-smart-plug/
[switcher-breeze]: https://switcher.co.il/%D7%9E%D7%95%D7%A6%D7%A8/switcher-breeze/
[switcher-runner]: https://switcher.co.il/%D7%9E%D7%95%D7%A6%D7%A8/switcher-runner/
Expand Down
1 change: 1 addition & 0 deletions docs/usage_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ asyncio.run(control_water_heater(DeviceType.TOUCH, "111.222.11.22", "ab1c2d" , "
asyncio.run(control_water_heater(DeviceType.V2_ESP, "111.222.11.22", "ab1c2d" , "00"))
asyncio.run(control_water_heater(DeviceType.V2_QCA, "111.222.11.22", "ab1c2d" , "00"))
asyncio.run(control_water_heater(DeviceType.V4, "111.222.11.22", "ab1c2d" , "00"))
asyncio.run(control_water_heater(DeviceType.ON_WALL, "111.222.11.22", "ab1c2d" , "00"))
```

## Runner device excerpt
Expand Down
1 change: 1 addition & 0 deletions scripts/control_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@

DEVICES = {
"mini": DeviceType.MINI,
"onwall": DeviceType.ON_WALL,
"plug": DeviceType.POWER_PLUG,
"touch": DeviceType.TOUCH,
"v2esp": DeviceType.V2_ESP,
Expand Down
1 change: 1 addition & 0 deletions src/aioswitcher/bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@ def is_switcher_originator(self) -> bool:
len(self.message) == 165
or len(self.message) == 168 # Switcher Breeze
or len(self.message) == 159 # Switcher Runner and RunnerMini
or len(self.message) == 170 # Switcher On Wall
or len(self.message) == 203 # Switcher Runner S11 and Switcher Runner S12
or len(self.message)
== 207 # Switcher Light SL01, Switcher Light SL01 Mini,
Expand Down
1 change: 1 addition & 0 deletions src/aioswitcher/device/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class DeviceType(Enum):
V2_ESP = "Switcher V2 (esp)", "01a7", 1, DeviceCategory.WATER_HEATER, False
V2_QCA = "Switcher V2 (qualcomm)", "01a1", 1, DeviceCategory.WATER_HEATER, False
V4 = "Switcher V4", "0317", 1, DeviceCategory.WATER_HEATER, False
ON_WALL = "Switcher On Wall", "0321", 1, DeviceCategory.WATER_HEATER, False
BREEZE = "Switcher Breeze", "0e01", 2, DeviceCategory.THERMOSTAT, False
RUNNER = "Switcher Runner", "0c01", 2, DeviceCategory.SHUTTER, False
RUNNER_MINI = "Switcher Runner Mini", "0c02", 2, DeviceCategory.SHUTTER, False
Expand Down
1 change: 1 addition & 0 deletions tests/test_device_enum_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
False,
),
(DeviceType.V4, "Switcher V4", "0317", 1, DeviceCategory.WATER_HEATER, False),
(DeviceType.ON_WALL, "Switcher On Wall", "0321", 1, DeviceCategory.WATER_HEATER, False),
(DeviceType.BREEZE, "Switcher Breeze", "0e01", 2, DeviceCategory.THERMOSTAT, False),
(DeviceType.RUNNER, "Switcher Runner", "0c01", 2, DeviceCategory.SHUTTER, False),
(DeviceType.RUNNER_MINI, "Switcher Runner Mini", "0c02", 2, DeviceCategory.SHUTTER, False),
Expand Down