Skip to content

Fix is_on docstring wording on binary sensors - #823

Merged
TheJulianJES merged 1 commit into
devfrom
zigpy-bot/fix-binary-sensor-is-on-docstring
Jul 29, 2026
Merged

Fix is_on docstring wording on binary sensors#823
TheJulianJES merged 1 commit into
devfrom
zigpy-bot/fix-binary-sensor-is-on-docstring

Conversation

@TheJulianJES

Copy link
Copy Markdown
Contributor

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.

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

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.27%. Comparing base (c38e03e) to head (3af39aa).
⚠️ Report is 9 commits behind head on dev.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zigpy-review-bot zigpy-review-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

@TheJulianJES
TheJulianJES marked this pull request as ready for review July 29, 2026 02:09
Copilot AI review requested due to automatic review settings July 29, 2026 02:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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_on docstring from “switch” to “binary sensor”.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@TheJulianJES
TheJulianJES merged commit 5adc2aa into dev Jul 29, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants