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:
Henrik Ekblad
2015-09-27 18:04:05 +02:00
parent aa22a3eaec
commit 415aa29b34
49 changed files with 281 additions and 169 deletions
@@ -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());