| 165 | } |
| 166 | |
| 167 | std::vector<std::string> Sensor::getPendingConfig() const |
| 168 | { |
| 169 | const nlohmann::json& config = state.getValue().at("config"); |
| 170 | const auto pendingIt = config.find("pending"); |
| 171 | if (pendingIt == config.end() || !pendingIt->is_array()) |
| 172 | { |
| 173 | return {}; |
| 174 | } |
| 175 | std::vector<std::string> result; |
| 176 | result.reserve(pendingIt->size()); |
| 177 | for (const nlohmann::json& pending : *pendingIt) |
| 178 | { |
| 179 | result.push_back(pending.get<std::string>()); |
| 180 | } |
| 181 | return result; |
| 182 | } |
| 183 | |
| 184 | bool Sensor::hasLEDIndication() const |
| 185 | { |