Skip to content

feat(matter) adds Identification callback to all matter endpoints #10734

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Dec 16, 2024
Merged
Prev Previous commit
Next Next commit
Merge branch 'release/v3.1.x' into matter_identify_callback
  • Loading branch information
SuGlider authored Dec 16, 2024
commit ba8d04eff2c7d992b2bd4e91bddd4aa1fa50c5b1
10 changes: 0 additions & 10 deletions libraries/Matter/src/MatterEndpoints/MatterDimmableLight.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,6 @@ class MatterDimmableLight : public MatterEndPoint {
bool setBrightness(uint8_t newBrightness); // returns true if successful
uint8_t getBrightness(); // returns current brightness

// used to update the state of the light using the current Matter Light internal state
// It is necessary to set a user callback function using onChange() to handle the physical light state
void updateAccessory();

operator bool(); // returns current on/off light state
void operator=(bool state); // turns light on or off

// this function is called by Matter internal event processor. It could be overwritten by the application, if necessary.
bool attributeChangeCB(uint16_t endpoint_id, uint32_t cluster_id, uint32_t attribute_id, esp_matter_attr_val_t *val);

// User Callback for whenever the Light On/Off state is changed by the Matter Controller
using EndPointOnOffCB = std::function<bool(bool)>;
void onChangeOnOff(EndPointOnOffCB onChangeCB) {
Expand Down
9 changes: 0 additions & 9 deletions libraries/Matter/src/MatterEndpoints/MatterOnOffLight.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,6 @@ class MatterOnOffLight : public MatterEndPoint {
// this function is called by Matter internal event processor. It could be overwritten by the application, if necessary.
bool attributeChangeCB(uint16_t endpoint_id, uint32_t cluster_id, uint32_t attribute_id, esp_matter_attr_val_t *val);

// User Callback for whenever the Light state is changed by the Matter Controller
using EndPointCB = std::function<bool(bool)>;
void onChange(EndPointCB onChangeCB) {
_onChangeCB = onChangeCB;
}
void onChangeOnOff(EndPointCB onChangeCB) {
_onChangeOnOffCB = onChangeCB;
}

protected:
bool started = false;
bool onOffState = false; // default initial state is off, but it can be changed by begin(bool)
Expand Down
9 changes: 0 additions & 9 deletions libraries/Matter/src/MatterEndpoints/MatterOnOffPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,6 @@ class MatterOnOffPlugin : public MatterEndPoint {
// this function is called by Matter internal event processor. It could be overwritten by the application, if necessary.
bool attributeChangeCB(uint16_t endpoint_id, uint32_t cluster_id, uint32_t attribute_id, esp_matter_attr_val_t *val);

// User Callback for whenever the Plugin state is changed by the Matter Controller
using EndPointCB = std::function<bool(bool)>;
void onChange(EndPointCB onChangeCB) {
_onChangeCB = onChangeCB;
}
void onChangeOnOff(EndPointCB onChangeCB) {
_onChangeOnOffCB = onChangeCB;
}

protected:
bool started = false;
bool onOffState = false; // default initial state is off, but it can be changed by begin(bool)
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.