Skip to content

Commit

Permalink
fix(matter): problems found after pressing reset
Browse files Browse the repository at this point in the history
  • Loading branch information
SuGlider committed Oct 18, 2024
1 parent 8d6575a commit 966ae0d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ const char *ssid = "your-ssid"; // Change this to your WiFi SSID
const char *password = "your-password"; // Change this to your WiFi password

void setup() {
// Initializa the USER BUTTON (Boot button) GPIO that will act as a toggle switch
pinMode(buttonPin, INPUT_PULLUP);

Serial.begin(115200);
while (!Serial) {
delay(100);
Expand Down Expand Up @@ -89,8 +92,6 @@ void loop() {
Serial.println("Matter Node not commissioned yet. Waiting for commissioning.");
}
}
// Initializa the USER BUTTON (Boot button) GPIO that will act as a toggle switch
pinMode(buttonPin, INPUT_PULLUP);
// Initialize the LED (light) GPIO and Matter End Point
pinMode(ledPin, OUTPUT);
Serial.printf("Initial state: %s\r\n", OnOffLight.getOnOff() ? "ON" : "OFF");
Expand Down
7 changes: 3 additions & 4 deletions libraries/Matter/src/Matter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,12 @@ static esp_err_t app_attribute_update_cb(
{
esp_err_t err = ESP_OK;
MatterEndPoint *ep = (MatterEndPoint *) priv_data; // endpoint pointer to base class
if (ep == NULL) {
return err;
}
switch(type) {
case PRE_UPDATE: // Callback before updating the value in the database
log_i("Attribute update callback: PRE_UPDATE");
err = ep->attributeChangeCB(endpoint_id, cluster_id, attribute_id, val) ? ESP_OK : ESP_FAIL;
if (ep != NULL) {
err = ep->attributeChangeCB(endpoint_id, cluster_id, attribute_id, val) ? ESP_OK : ESP_FAIL;
}
break;
case POST_UPDATE: // Callback after updating the value in the database
log_i("Attribute update callback: POST_UPDATE");
Expand Down

0 comments on commit 966ae0d

Please sign in to comment.