| 85 | sendPutRequest("/config", nlohmann::json {{"battery", percent}}, CURRENT_FILE_INFO); |
| 86 | } |
| 87 | bool Sensor::hasAlert() const |
| 88 | { |
| 89 | return state.getValue().at("config").count("alert") != 0; |
| 90 | } |
| 91 | Alert Sensor::getLastAlert() const |
| 92 | { |
| 93 | std::string alert = state.getValue().at("config").at("alert").get<std::string>(); |