- if (is_temp_type(s->type) && cfg->temperature_unit == CELCIUS) {
- s->alarm_high_thresold = p->alarm_high_thresold;
- s->alarm_low_thresold = p->alarm_low_thresold;
+ if (is_temp_type(s->type)
+ && cfg->temperature_unit == FAHRENHEIT) {
+ s->alarm_high_threshold = fahrenheit_to_celcius
+ (p->alarm_high_threshold);
+ s->alarm_low_threshold = fahrenheit_to_celcius
+ (p->alarm_low_threshold);