fix(centurion): route sub-device notifications via sub_inverse in get_feature
Bridge MessageEvents arrive with sub_feat_idx + 0x100 as the notification sub_id. get_feature() only checked self.inverse (parent features), so sub- device feature notifications (including CENTURION_BATTERY_SOC charging changes) were silently dropped with 'invalid feature index'. Check sub_inverse at index - 0x100 for any index >= 0x100 so spontaneous notifications from the headset (e.g. charging status change) are correctly dispatched to the feature notification handler.
This commit is contained in:
parent
2e039cf63a
commit
f1864fd211
|
|
@ -301,6 +301,8 @@ class FeaturesArray(dict):
|
|||
feature = self.inverse.get(index)
|
||||
if feature is not None:
|
||||
return feature
|
||||
if index >= 0x100:
|
||||
return self.sub_inverse.get(index - 0x100)
|
||||
elif self._check():
|
||||
feature = self.inverse.get(index)
|
||||
if feature is not None:
|
||||
|
|
|
|||
Loading…
Reference in New Issue