canonical / matter-pi-gpio-commander

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

Initialize both the stored and actual states to off #23

Closed MonicaisHer closed 11 months ago

MonicaisHer commented 11 months ago

This PR will resolve https://github.com/canonical/matter-pi-gpio-commander/issues/14.

In this matter file, a default value of 0 is set for the onOff attribute, ensuring that the LED remains off upon initialization. This PR aligns the application's behavior with the default setting.

Testing

Install and setup matter-pigpio-commander:

sudo snap install ./matter-pi-gpio-commander_0.3.0+sync-gpio_arm64.snap --dangerous
sudo snap set matter-pi-gpio-commander gpio=26
sudo snap connect matter-pi-gpio-commander:avahi-control
sudo snap connect matter-pi-gpio-commander:gpio-memory-control
sudo snap start matter-pi-gpio-commander

Commission and control via chip-tool:

The first chip-tool onoff on command can turn the LED on. Here is the log when the on command sent:


$ journalctl -f | grep matter-pi-gpio-commander
CHIP:DMG: AccessControl: allowed
CHIP:DMG: Received command for Endpoint=1 Cluster=0x0000_0006 Command=0x0000_0001
CHIP:ZCL: Toggle ep1 on/off from state 0 to 1