#include <FanMqttSettingsService.h>

FanMqttSettingsService::FanMqttSettingsService(AsyncWebServer* server, FS* fs, SecurityManager* securityManager) :
    _httpEndpoint(FanMqttSettings::read,
                  FanMqttSettings::update,
                  this,
                  server,
                  LIGHT_BROKER_SETTINGS_PATH,
                  securityManager,
                  AuthenticationPredicates::IS_AUTHENTICATED),
    _fsPersistence(FanMqttSettings::read, FanMqttSettings::update, this, fs, LIGHT_BROKER_SETTINGS_FILE) {
}

void FanMqttSettingsService::begin() {
  _fsPersistence.readFromFS();
}
