Fix PTZ bugs with unsupported & unchanged fields - #3192
Conversation
|
Invitation URL: |
Test Results 73 files 541 suites 0s ⏱️ Results for commit 80a3dce. |
|
matter-switch_coverage.xml
Minimum allowed coverage is Generated by 🐒 cobertura-action against 80a3dce |
|
One related PTZ issue remains in Single-axis commands still depend on the cached values of the other axes: For Matter's optional PTZ fields, this should instead be: This is not only relevant for cameras without one of the mechanical features. On the G350, all three axes are supported, but we observed a valid state where So a |
Description of Change
Issue # 1
The attribute handler and device config used
MPAN/MTILT/MZOOM/MPRESETS(based on "feature code" from spec), which don't exist in the generated files in lua libs (CameraAvSettingsUserLevelManagement/types/Feature.luaonly definesMECHANICAL_PAN/TILT/ZOOM/PRESETSbased on "feature name" in SDK XML).In Lua, indexing an undefined table field returns nil rather than erroring, so every feature-support check silently evaluated to "supported," and
MatterDevice:get_endpoints'sopts.feature_bitmap == nilshort-circuit treated any device with the cluster as having all PTZ features. On a device whose FeatureMap excludes zoom, this caused the driver to read a zoom field that the device never sends, crashing withattempt to index a nil value (field 'zoom').Fixed by using the correct
MECHANICAL_*names everywhere.Issue # 2
Separately,
ptz_relative_move_factoryalways sent all three deltas toMPTZRelativeMove, defaulting unused axes to 0 instead of omitting them. Per spec, each delta's conformance is tied to its own feature bit, so an explicit 0 isn't the same as an omitted field and essentially a zoom-less device rejected the command withINVALID_COMMAND.Fixed by only setting the delta for the axis being moved and leaving the others nil.
Summary of Completed Tests