thermferm/devices.c

changeset 482
68f4468bfc24
parent 437
5664743eaf2f
child 506
cdcd07bbee30
equal deleted inserted replaced
479:0e6a1163e6e3 482:68f4468bfc24
927 piLock(LOCK_DEVICES); 927 piLock(LOCK_DEVICES);
928 #endif 928 #endif
929 if (Config.simulators) { 929 if (Config.simulators) {
930 simulator = Config.simulators; 930 simulator = Config.simulators;
931 if (device->subdevice == 0) { 931 if (device->subdevice == 0) {
932 device->value = (int)(simulator->room_temperature * 1000); 932 device->value = (int)((int)(simulator->room_temperature * 1000) / 500) * 500;
933 device->timestamp = time(NULL); 933 device->timestamp = time(NULL);
934 } else if (device->subdevice == 1) { 934 } else if (device->subdevice == 1) {
935 device->value = (int)(simulator->air_temperature * 1000); 935 device->value = (int)((int)(simulator->air_temperature * 1000) / 125) * 125;
936 device->timestamp = time(NULL); 936 device->timestamp = time(NULL);
937 } else if (device->subdevice == 2) { 937 } else if (device->subdevice == 2) {
938 device->value = (int)(simulator->beer_temperature * 1000); 938 device->value = (int)((int)(simulator->beer_temperature * 1000) / 125) * 125;
939 device->timestamp = time(NULL); 939 device->timestamp = time(NULL);
940 } 940 }
941 } 941 }
942 #ifdef HAVE_WIRINGPI_H 942 #ifdef HAVE_WIRINGPI_H
943 piUnlock(LOCK_DEVICES); 943 piUnlock(LOCK_DEVICES);

mercurial