Skip to content

Add support for presence sensor#410

Merged
bdraco merged 4 commits into
sblibs:masterfrom
zerzhang:feature/presence_sensor
Nov 10, 2025
Merged

Add support for presence sensor#410
bdraco merged 4 commits into
sblibs:masterfrom
zerzhang:feature/presence_sensor

Conversation

@zerzhang
Copy link
Copy Markdown
Collaborator

@zerzhang zerzhang commented Nov 6, 2025

  • Add presence sensor

@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
switchbot/adv_parser.py 94.39% <100.00%> (+0.05%) ⬆️
switchbot/adv_parsers/presence_sensor.py 100.00% <100.00%> (ø)
switchbot/const/__init__.py 100.00% <100.00%> (ø)
switchbot/const/presence_sensor.py 100.00% <100.00%> (ø)
switchbot/devices/device.py 63.35% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bdraco
Copy link
Copy Markdown
Member

bdraco commented Nov 7, 2025

@zerzhang Would you please resolve conflicts

@borgqueenx
Copy link
Copy Markdown

If this is complete, does it mean the presence sensor is supported by switchbot bluetooth integration in home assistant in the next release? @zerzhang

@zerzhang zerzhang force-pushed the feature/presence_sensor branch from e920820 to 8646925 Compare November 10, 2025 12:56
@zerzhang
Copy link
Copy Markdown
Collaborator Author

If this is complete, does it mean the presence sensor is supported by switchbot bluetooth integration in home assistant in the next release? @zerzhang

After this review is completed, I need to create a pull request for the precensor sensor on HA Core and wait for it to be merged.

@zerzhang
Copy link
Copy Markdown
Collaborator Author

@zerzhang Would you please resolve conflicts

fixed

Comment thread switchbot/adv_parsers/presence_sensor.py
Copy link
Copy Markdown
Member

@bdraco bdraco left a comment

Choose a reason for hiding this comment

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

Thanks @zerzhang

@bdraco bdraco merged commit 3d82e43 into sblibs:master Nov 10, 2025
4 checks passed
@lukasmalkmus
Copy link
Copy Markdown

I did some attempt of creating a PR in HomeAssistant but I've never contributed to it, so far. So there might be developers more suited for that :)

But I wonder if in this PR the presence sensor exposes led_state when it should probably expose is_light?

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