Fix is_on docstring wording on binary sensors - #823
Conversation
The `BinarySensor.is_on` docstring described a "switch" rather than a binary sensor, which is confusing in logs/docs. Reworded to "binary sensor". Reported by Copilot on #821.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #823 +/- ##
=======================================
Coverage 97.27% 97.27%
=======================================
Files 55 55
Lines 10930 10930
=======================================
Hits 10632 10632
Misses 298 298 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
zigpy-review-bot
left a comment
There was a problem hiding this comment.
Docstring-only fix, correct and complete.
The old wording was a copy-paste leftover from switch.py (which has six variants of "Return if the switch is on..."). The method it documents lives on BinarySensor(BaseBinarySensor), so "binary sensor" is right, and the new text now lines up with the abstract BaseBinarySensor.is_on docstring at zha/application/platforms/binary_sensor/__init__.py:80 ("Return True if the binary sensor is on.").
Checked for stragglers: git grep "the switch is on" finds no remaining switch phrasing anywhere under binary_sensor/ — the other hits are all in switch.py, where they're accurate. No behavior change, no tests needed.
Marked as draft — flagging that only in case it was unintentional, since there's nothing here left to finish.
There was a problem hiding this comment.
Pull request overview
This PR corrects the BinarySensor.is_on docstring to refer to a “binary sensor” instead of a “switch”, improving clarity and consistency in documentation/log output for the binary sensor platform.
Changes:
- Reworded
BinarySensor.is_ondocstring from “switch” to “binary sensor”.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The
BinarySensor.is_ondocstring described a "switch" rather than a binary sensor, which is confusing in logs/docs. Reworded to "binary sensor". Reported by Copilot on #821.