New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for sleepy BTHome devices #92991
Conversation
c0e6aa5
to
d602e6e
Compare
@property
def available(self) -> bool:
"""Return True if entity is available."""
coordinator: BTHomePassiveBluetoothProcessorCoordinator = self.processor.coordinator
return coordinator.device_data.sleepy_device or super().available Leaving as draft until the following can be made |
Looks good. I think we can copy the xiaomi ble test and modify it a bit and than this is good to go |
I’ll take care of Xiaomi-ble in a separate PR |
I think we still need the test that it is treated as sleepy there though. |
Ah, sorry, I wasn't reading right, I thought you said we should copy this change to xiaomi-ble, but you meant copying the tests from xiaomi-ble to bthome for the sleepy_devices. I have added the tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Ernst79
Looks much better now 👍
Proposed change
This PR adds support for "sleepy" BTHome devices. Sleepy devices are sensors that do not send BLE data on a regular basis, but only when e.g. pushing a button or opening a door. BTHome has added a flag in the BLE advertisement that tells the receiver (HA) that the device isn't sending updates on a regular basis. This PR makes sure that these "sleepy" devices remain availalable.
bthome-ble change logs
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: