Allow sensors to re-present themselves on request from controller. All
presentations actions moved to their own function in the examples.
This commit is contained in:
@@ -54,16 +54,20 @@ void setup()
|
||||
{
|
||||
dht.setup(HUMIDITY_SENSOR_DIGITAL_PIN);
|
||||
|
||||
metric = getConfig().isMetric;
|
||||
}
|
||||
|
||||
void presentation()
|
||||
{
|
||||
// Send the Sketch Version Information to the Gateway
|
||||
sendSketchInfo("Humidity", "1.0");
|
||||
|
||||
// Register all sensors to gw (they will be created as child devices)
|
||||
present(CHILD_ID_HUM, S_HUM);
|
||||
present(CHILD_ID_TEMP, S_TEMP);
|
||||
|
||||
metric = getConfig().isMetric;
|
||||
}
|
||||
|
||||
|
||||
void loop()
|
||||
{
|
||||
delay(dht.getMinimumSamplingPeriod());
|
||||
|
||||
Reference in New Issue
Block a user