- Create a class extending the Transformer base class in the transformers folder.
- Overload the transform function and don't forget to call the Transformer constructor.
- Include the header file in the
SensorFactory.hfile. - Write a
createThisTransformerFromStrfunction in theSensorFactory.hfile. This function is expected to parse the key-value pairs from the config file and match them to the parameters with the same name. It should return astd::shared_ptr<Transformer>result or a nullptr if the parsing failed. - Add an if statement for your Transformer to the
transformerFromConfigStrfunction inSensorFactory.hwhich calls your create function.
- Create a class extending the Sensor base class in the sensors folder.
- Overload the
readSensorRawfunction and don't forget to call the Sensor constructor. - Include the header file in the
SensorFactory.hfile. - Write a
createThisSensorfunction in theSensorFactory.hfile which dynamically allocates your sensor and returns it as a pointer. - Write a
createThisSensorFromStrfunction in theSensorFactory.hfile. This function is expected to parse the key-value pairs from the config file and match them to the parameters with the same name and calls the function you wrote in step 4 with those parameters. It should also call theparseTransformerChainFromConfigStrfunction to read possible transformers added to your sensor. - Add an if statement to the
sensorFromConfigStringfunction in theSensorFactory.hfile which calls your function from step 5 with the config string.
The webinterface design was stolen and modified from the Jarolift_MQTT project by madmartin because I suck at webinterfaces.