feat: add support for Switcher On Wall device - #847
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #847 +/- ##
==========================================
+ Coverage 98.99% 99.05% +0.05%
==========================================
Files 11 11
Lines 1292 1371 +79
==========================================
+ Hits 1279 1358 +79
Misses 13 13 🚀 New features to boost your workflow:
|
|
Hey |
- Add ON_WALL device type with hex code 0321 - Add 170-byte datagram length support in bridge - Add test coverage for new device type - Update supported devices documentation
a12c688 to
f70b103
Compare
|
@YogevBokobza Thanks for you response, I have updated the PR following your last comment. let me know if something still missing. As far as I understand in your PR you added a new Category but in my PR, I'm using WATER_HEATER category there fore it's not a lot as you mention. |
|
@giladtamam |
@YogevBokobza with help from cursor I got the following info:
|
|
Hi @giladtamam, I made some research on the OnWall - mind if I push a couple of my changes to this PR? For reference (ImHex pattern): |
|
Thank you @giladtamam @YogevBokobza and @ewino! |
Signed-off-by: YogevBokobza <yogevbokobza12@gmail.com>
📝 WalkthroughWalkthroughThis pull request adds support for a new device type, "Switcher On Wall" (ON_WALL), by introducing its enum definition, device mappings, datagram protocol detection, documentation updates, and corresponding test coverage across the codebase. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
|
Now that #835 is merged I will take over this PR and continue to implement the rest. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@docs/supported.md`:
- 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 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 | |
There was a problem hiding this comment.
🧩 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 -20Repository: TomerFi/aioswitcher
Length of output: 699
🏁 Script executed:
# Search for ON_WALL in the codebase
rg "ON_WALL" --type pyRepository: TomerFi/aioswitcher
Length of output: 370
🏁 Script executed:
# Also search for the supported.md file to check the current state
cat docs/supported.mdRepository: 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 -50Repository: 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 2Repository: 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 5Repository: 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.
Great, let me know if want me to test it |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
On Wall TCP control protocol analysisI've done extensive protocol analysis on my On Wall device (0321) and found that the device firmware does not support the standard TCP control command ( What works
What doesn't work
Key findings
Login2 response (132 bytes) contains
Questions
Device info: IP |
Didn't they used to have a Local Only option in thier app? |
Unfortunatly we have an issue.. I spoke with my contact Switcher guy and he said that they put some different hardware in this device and it behaves very differently.. |
Let's close this PR then. We can open an issue or a discussion for tracking this. |
@YogevBokobza any news from Switcher?
@TomerFi I missed this comment, I agree with you. I think it is better to close this PR, create an issue, collect all the data there and once we know what is needed create a new PR. |
|
Closing this PR in favor of issue #889 to better track the investigation and implementation of support for the Switcher On Wall device. |
Description
Checklist
Additional information
Summary by CodeRabbit
Release Notes
New Features
Documentation
Tests