canonical / matter-pi-gpio-commander

Matter Raspberry Pi GPIO Commander - Turn your Pi into a Matter lighting device!
Apache License 2.0
94 stars 2 forks source link

Overwrite lighting-app.zap to remove occupancy sensor #35

Closed MonicaisHer closed 10 months ago

MonicaisHer commented 10 months ago

This PR will resolve #30. This PR depends on the SDK update(https://github.com/canonical/matter-pi-gpio-commander/pull/33) to be merged first.

The lighting-app.zap and .matter files are partially generated from: https://github.com/project-chip/connectedhomeip/blob/v1.2.0.1/examples/lighting-app/lighting-common/, with the occupancy sensor part removed.

Reference: flow for updating an application zap file

The snap built from this PR could be install by running:

snap install matter-pi-gpio-commander --channel=latest/edge/pr-35
farshidtz commented 10 months ago

33 has been merged.

MonicaisHer commented 10 months ago

I have tested and confirmed that the occupancy sensor no longer exists in the snap. Below is a comparison result of reading the occupancy sensor from channels edge and edge/pr-35.

Logs of chip-tool controlling commander snap from edge (occupancy sensor exists):

$ sudo snap install matter-pi-gpio-commander --channel=latest/edge
$ sudo chip-tool occupancysensing read occupancy 110 1
...
CHIP:TOO:   Occupancy: 0

Logs of chip-tool controlling commander snap from edge/pr-35 (occupancy sensor removed):

$ sudo snap install matter-pi-gpio-commander --channel=latest/edge/pr-35
$ sudo chip-tool occupancysensing read occupancy 110 1
...
CHIP:TOO: Response Failure: IM Error 0x000005C3: General error: 0xc3 (UNSUPPORTED_CLUSTER)
CHIP:TOO: Run command failure: IM Error 0x000005C3: General error: 0xc3 (UNSUPPORTED_CLUSTER)