Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change temperature delta label to degrees Celsius #9427

Merged
merged 3 commits into from
Sep 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -51,7 +51,7 @@ - (void)dismissKeyboard
{
[_minIntervalInSecondsTextField resignFirstResponder];
[_maxIntervalInSecondsTextField resignFirstResponder];
[_deltaInFahrenheitTextField resignFirstResponder];
[_deltaInCelsiusTextField resignFirstResponder];
}

- (void)setupUI
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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) {
Expand All @@ -207,7 +207,7 @@ - (void)reportFromUserEnteredSettings
[cluster
configureAttributeMeasuredValueWithMinInterval:minIntervalSeconds
maxInterval:maxIntervalSeconds
change:deltaInFahrenheit
change:deltaInCelsius
responseHandler:^(NSError * error, NSDictionary * values) {
if (error == nil)
return;
Expand Down