Skip to content

Commit

Permalink
chore: remove get settings
Browse files Browse the repository at this point in the history
  • Loading branch information
kakopappa committed Jul 7, 2024
1 parent f81ba13 commit eb42b83
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
17 changes: 1 addition & 16 deletions src/SinricPro.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ class SinricProClass : public SinricProInterface {
unsigned long getTimestamp() override;
Proxy operator[](const String deviceId);
void onOTAUpdate(OTAUpdateCallbackHandler cb);
void onSetSetting(SetSettingCallbackHandler cb);
void onGetSetting(GetSettingCallbackHandler cb);
void onSetSetting(SetSettingCallbackHandler cb);

protected:
template <typename DeviceType>
Expand Down Expand Up @@ -519,20 +518,6 @@ void SinricProClass::onSetSetting(SetSettingCallbackHandler cb) {
_moduleCommandHandler.onSetSetting(cb);
}

/**
* @brief Set callback function for retrieving a module setting.
*
* This method registers a callback function that will be called when a request to get
* the current value of a module setting is received.
*
* @param cb A function pointer or lambda of type GetSettingCallbackHandler.
* The callback should return a boolean indicating whether the setting was successfully retrieved.
*
*/
void SinricProClass::onGetSetting(GetSettingCallbackHandler cb) {
_moduleCommandHandler.onGetSetting(cb);
}

/**
* @brief Set callback function for websocket connected event
*
Expand Down
7 changes: 0 additions & 7 deletions src/SinricProModuleCommandHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ FSTR(SETTINGS, value); // "value"

using OTAUpdateCallbackHandler = std::function<bool(const String& url, int major, int minor, int patch)>;
using SetSettingCallbackHandler = std::function<bool(const String& id, const String& value)>;
using GetSettingCallbackHandler = std::function<bool(const String& id, String& value)>;

class SinricProModuleCommandHandler {
public:
Expand All @@ -35,12 +34,10 @@ class SinricProModuleCommandHandler {
bool handleRequest(SinricProRequest &request);
void onOTAUpdate(OTAUpdateCallbackHandler callback);
void onSetSetting(SetSettingCallbackHandler callback);
void onGetSetting(GetSettingCallbackHandler callback);

private:
OTAUpdateCallbackHandler _otaUpdateCallbackHandler;
SetSettingCallbackHandler _setSettingCallbackHandler;
GetSettingCallbackHandler _getSettingCallbackHandler;
};

SinricProModuleCommandHandler::SinricProModuleCommandHandler()
Expand All @@ -57,10 +54,6 @@ void SinricProModuleCommandHandler::onOTAUpdate(OTAUpdateCallbackHandler callbac
void SinricProModuleCommandHandler::onSetSetting(SetSettingCallbackHandler callback) {
_setSettingCallbackHandler = callback;
}

void SinricProModuleCommandHandler::onGetSetting(GetSettingCallbackHandler callback) {
_getSettingCallbackHandler = callback;
}

bool SinricProModuleCommandHandler::handleRequest(SinricProRequest &request) {
if (strcmp(FSTR_OTA_otaUpdateAvailable, request.action.c_str()) == 0 && _otaUpdateCallbackHandler) {
Expand Down

0 comments on commit eb42b83

Please sign in to comment.