| 195 | } |
| 196 | |
| 197 | nlohmann::json Sensor::getState() const |
| 198 | { |
| 199 | return state.getValue().at("state"); |
| 200 | } |
| 201 | void Sensor::setStateAttribute(const std::string& key, const nlohmann::json& value) |
| 202 | { |
| 203 | sendPutRequest("/state", nlohmann::json {{key, value}}, CURRENT_FILE_INFO); |