From 2183202243ec1d256fcb6fe5a96dd599bf6be601 Mon Sep 17 00:00:00 2001 From: Devendra Tewari Date: Mon, 13 Sep 2021 11:56:24 -0300 Subject: [PATCH] Change temperature delta label to degrees Celsius (#9427) * Change temperature delta label to degrees celsius * Rename Fahrenheit in identifiers to Celsius * Restyled by clang-format Co-authored-by: Restyled.io --- .../TemperatureSensorViewController.m | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/darwin/CHIPTool/CHIPTool/View Controllers/Temperature Sensor/TemperatureSensorViewController.m b/src/darwin/CHIPTool/CHIPTool/View Controllers/Temperature Sensor/TemperatureSensorViewController.m index 56b3ea298ba930..b81ada3eb01bb0 100644 --- a/src/darwin/CHIPTool/CHIPTool/View Controllers/Temperature Sensor/TemperatureSensorViewController.m +++ b/src/darwin/CHIPTool/CHIPTool/View Controllers/Temperature Sensor/TemperatureSensorViewController.m @@ -14,7 +14,7 @@ @interface TemperatureSensorViewController () @property (nonatomic, strong) UILabel * temperatureLabel; @property (nonatomic, strong) UITextField * minIntervalInSecondsTextField; @property (nonatomic, strong) UITextField * maxIntervalInSecondsTextField; -@property (nonatomic, strong) UITextField * deltaInFahrenheitTextField; +@property (nonatomic, strong) UITextField * deltaInCelsiusTextField; @property (nonatomic, strong) UIButton * sendReportingSetup; @end @@ -51,7 +51,7 @@ - (void)dismissKeyboard { [_minIntervalInSecondsTextField resignFirstResponder]; [_maxIntervalInSecondsTextField resignFirstResponder]; - [_deltaInFahrenheitTextField resignFirstResponder]; + [_deltaInCelsiusTextField resignFirstResponder]; } - (void)setupUI @@ -120,15 +120,15 @@ - (void)setupUI [maxIntervalInSecondsView.trailingAnchor constraintEqualToAnchor:stackView.trailingAnchor].active = YES; // Delta - _deltaInFahrenheitTextField = [UITextField new]; - _deltaInFahrenheitTextField.keyboardType = UIKeyboardTypeNumberPad; - UILabel * deltaInFahrenheitLabel = [UILabel new]; - [deltaInFahrenheitLabel setText:@"Delta (F):"]; - UIView * deltaInFahrenheitView = [CHIPUIViewUtils viewWithLabel:deltaInFahrenheitLabel textField:_deltaInFahrenheitTextField]; - [stackView addArrangedSubview:deltaInFahrenheitView]; + _deltaInCelsiusTextField = [UITextField new]; + _deltaInCelsiusTextField.keyboardType = UIKeyboardTypeNumberPad; + UILabel * deltaInCelsiusLabel = [UILabel new]; + [deltaInCelsiusLabel setText:@"Delta (°C):"]; + UIView * deltaInCelsiusView = [CHIPUIViewUtils viewWithLabel:deltaInCelsiusLabel textField:_deltaInCelsiusTextField]; + [stackView addArrangedSubview:deltaInCelsiusView]; - deltaInFahrenheitView.translatesAutoresizingMaskIntoConstraints = false; - [deltaInFahrenheitView.trailingAnchor constraintEqualToAnchor:stackView.trailingAnchor].active = YES; + deltaInCelsiusView.translatesAutoresizingMaskIntoConstraints = false; + [deltaInCelsiusView.trailingAnchor constraintEqualToAnchor:stackView.trailingAnchor].active = YES; // Reporting button _sendReportingSetup = [UIButton new]; @@ -194,10 +194,10 @@ - (void)reportFromUserEnteredSettings { int minIntervalSeconds = [_minIntervalInSecondsTextField.text intValue]; int maxIntervalSeconds = [_maxIntervalInSecondsTextField.text intValue]; - int deltaInFahrenheit = [_deltaInFahrenheitTextField.text intValue]; + int deltaInCelsius = [_deltaInCelsiusTextField.text intValue]; - NSLog(@"Sending temp reporting values: min %@ max %@ value %@", @(minIntervalSeconds), @(maxIntervalSeconds), - @(deltaInFahrenheit)); + NSLog( + @"Sending temp reporting values: min %@ max %@ value %@", @(minIntervalSeconds), @(maxIntervalSeconds), @(deltaInCelsius)); if (CHIPGetConnectedDevice(^(CHIPDevice * _Nullable chipDevice, NSError * _Nullable error) { if (chipDevice) { @@ -207,7 +207,7 @@ - (void)reportFromUserEnteredSettings [cluster configureAttributeMeasuredValueWithMinInterval:minIntervalSeconds maxInterval:maxIntervalSeconds - change:deltaInFahrenheit + change:deltaInCelsius responseHandler:^(NSError * error, NSDictionary * values) { if (error == nil) return;