Skip to content

Commit

Permalink
Send init message when peripheral is initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
lptr committed Jan 3, 2024
1 parent 2fbd534 commit 7d99c5f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/devices/Peripheral.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ class PeripheralFactory : public PeripheralFactoryBase {
deviceConfig.loadFromString(jsonConfig);
unique_ptr<Peripheral<TConfig>> peripheral = createPeripheral(name, deviceConfig, mqttRoot);
peripheral->configure(configFile->config);
mqttRoot->publish("init", [&configFile](JsonObject& json) {
auto config = json.createNestedObject("config");
configFile->config.store(config, false);
});
return peripheral;
}

Expand Down

0 comments on commit 7d99c5f

Please sign in to comment.