diff -r 5d09ca728809 -r 47e5109c7f53 thermferm/devices.c --- a/thermferm/devices.c Sat Aug 09 22:48:21 2014 +0200 +++ b/thermferm/devices.c Sat Aug 09 23:13:56 2014 +0200 @@ -474,12 +474,31 @@ addr = NULL; } break; + +#ifdef HAVE_WIRINGPI_H case DEVTYPE_DHT: if (device->subdevice == 0) { + dht11_pin = device->gpiopin; + dht11Read(); + if (dht11_valid) { + device->value = dht11_temperature * 1000; + device->timestamp = time(NULL); + device->present = DEVPRESENT_YES; + } else { + device->present = DEVPRESENT_ERROR; + } } else if (device->subdevice == 1) { - + if (dht11_valid) { + device->value = dht11_humidity * 1000; + device->timestamp = time(NULL); + device->present = DEVPRESENT_YES; + } else { + device->present = DEVPRESENT_ERROR; + } } break; +#endif + default: break; }