void CWakeOnAccess::OnSettingsSaved() { bool enabled = CSettings::GetInstance().GetBool(CSettings::SETTING_POWERMANAGEMENT_WAKEONACCESS); if (enabled != IsEnabled()) { SetEnabled(enabled); if (enabled) QueueMACDiscoveryForAllRemotes(); } }
void CWakeOnAccess::OnSettingChanged(std::shared_ptr<const CSetting> setting) { if (setting == nullptr) return; const std::string& settingId = setting->GetId(); if (settingId == CSettings::SETTING_POWERMANAGEMENT_WAKEONACCESS) { bool enabled = std::static_pointer_cast<const CSettingBool>(setting)->GetValue(); SetEnabled(enabled); if (enabled) QueueMACDiscoveryForAllRemotes(); } }