-
Notifications
You must be signed in to change notification settings - Fork 279
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
device: Expose "sleepy" configuration #453
Conversation
An earlier implementation of this embedded the heuristic for enabling sleepy mode (battery-powered end device), but I thought it made sense to merge the manual version first - we want to be able to overrule regardless. |
f7f43b1
to
4a51f88
Compare
I guess this changes after we choose to go for #445 (comment) ? |
We can have the interview flip this setting for all the endpoints. Is it guaranteed that a device object will go through interview after being created/read from database? If so, we could remove the database record and just have interview be responsible for flipping the bit. |
|
The opposite. genPollCtrl is the zigbee-official way of powering a sendWhenActive behavior, by having the end device actively call us specifically to empty any request or configuration queues. As it specifically controls sleepy end device behavior, it should be pretty safe to use as indicator for a device being sleepy.
Will do.
Indeed, known sleepy devices without genPollCtrl may wish to manually set it in configure. However, we could add the end device + battery powered heuristic as fallback when genPollCtrl isn't there. Not sure if we'll end up needing any overrides in that case. |
84a3977
to
eb91c70
Compare
Not sure about that, I know that e.g. many Xiaomi end devices like the smoke detector and vibration sensor can be send messages to without |
I believe that is a good example of where sendWhenActive is necessary, but where chance probably make things work often enough to not notice. The parent will keep 1 packet for the device for 7.68 seconds. If the device long polls at 30s intervals, then delivery failure is guaranteed if:
Occasional fast poll sessions drop the risk a bit depending on how often they happen, so maybe 1/4th average risk of failure due to request timing. So I believe that those Xiaomi end devices should be using sendWhenActive. The updated version that tries a plain send first is very unintrusive though, and effectively only changes behavior it is needed. |
eb91c70
to
54752b3
Compare
Added tests for having interview respect a user setting - we'll probably need the user setting regardless of whether we add a fallback heuristic later. Ready for review. |
When set, all endpoints sends will default to sendWhenActive: true, avoiding the need for manually setting this for every request.
54752b3
to
8a79846
Compare
@kennylevinsen sounds good indeed |
When set, all endpoints sends will default to sendWhenActive: true,
avoiding the need for manually setting this for every request.