Skip to content

Commit 914bb65

Browse files
committed
Changes all value types in protocol models to nullable to match Ecobee API usage docs
1 parent b7f6a37 commit 914bb65

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+317
-512
lines changed

src/I8Beef.Ecobee/Protocol/Hierarchy/Set/SetListRequest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,18 @@ public class SetListRequest : RequestBase
4040
/// Whether to also return the children of the children, recursively. Default: false
4141
/// </summary>
4242
[JsonProperty(PropertyName = "recursive")]
43-
public bool Recursive { get; set; }
43+
public bool? Recursive { get; set; }
4444

4545
/// <summary>
4646
/// Whether to include the privileges with each set. Default: false
4747
/// </summary>
4848
[JsonProperty(PropertyName = "includePrivileges")]
49-
public bool IncludePrivileges { get; set; }
49+
public bool? IncludePrivileges { get; set; }
5050

5151
/// <summary>
5252
/// Whether to include a list of all thermostat identifiers assigned to each set. Default: false
5353
/// </summary>
5454
[JsonProperty(PropertyName = "includeThermostats")]
55-
public bool IncludeThermostats { get; set; }
55+
public bool? IncludeThermostats { get; set; }
5656
}
5757
}

src/I8Beef.Ecobee/Protocol/Hierarchy/User/UserAddRequest.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,6 @@ namespace I8Beef.Ecobee.Protocol.Hierarchy.User
1111
[JsonObject(MemberSerialization.OptIn)]
1212
public class UserAddRequest : RequestBase
1313
{
14-
/// <summary>
15-
/// Initializes a new instance of the <see cref="UserAddRequest"/> class.
16-
/// </summary>
17-
public UserAddRequest()
18-
{
19-
Users = new List<HierarchyUser>();
20-
}
21-
2214
/// <summary>
2315
/// Request URI.
2416
/// </summary>

src/I8Beef.Ecobee/Protocol/Hierarchy/User/UserListRequest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ public class UserListRequest : RequestBase
4040
/// Whether to include the user privileges.
4141
/// </summary>
4242
[JsonProperty(PropertyName = "includePrivileges")]
43-
public bool IncludePrivileges { get; set; }
43+
public bool? IncludePrivileges { get; set; }
4444

4545
/// <summary>
4646
/// Whether to also return the children of the children, recursively. Default: false
4747
/// </summary>
4848
[JsonProperty(PropertyName = "recursive")]
49-
public bool Recursive { get; set; }
49+
public bool? Recursive { get; set; }
5050
}
5151
}

src/I8Beef.Ecobee/Protocol/Hierarchy/User/UserRemoveRequest.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,6 @@ namespace I8Beef.Ecobee.Protocol.Hierarchy.User
1111
[JsonObject(MemberSerialization.OptIn)]
1212
public class UserRemoveRequest : RequestBase
1313
{
14-
/// <summary>
15-
/// Initializes a new instance of the <see cref="UserRemoveRequest"/> class.
16-
/// </summary>
17-
public UserRemoveRequest()
18-
{
19-
Users = new List<HierarchyUser>();
20-
}
21-
2214
/// <summary>
2315
/// Request URI.
2416
/// </summary>

src/I8Beef.Ecobee/Protocol/Hierarchy/User/UserUnregisterRequest.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,6 @@ namespace I8Beef.Ecobee.Protocol.Hierarchy.User
1111
[JsonObject(MemberSerialization.OptIn)]
1212
public class UserUnregisterRequest : RequestBase
1313
{
14-
/// <summary>
15-
/// Initializes a new instance of the <see cref="UserUnregisterRequest"/> class.
16-
/// </summary>
17-
public UserUnregisterRequest()
18-
{
19-
Users = new List<HierarchyUser>();
20-
}
21-
2214
/// <summary>
2315
/// Request URI.
2416
/// </summary>

src/I8Beef.Ecobee/Protocol/Objects/Action.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,43 +21,43 @@ public class Action
2121
/// Flag to enable an alert to be generated when the state is triggered.
2222
/// </summary>
2323
[JsonProperty(PropertyName = "sendAlert")]
24-
public bool SendAlert { get; set; }
24+
public bool? SendAlert { get; set; }
2525

2626
/// <summary>
2727
/// Whether to send an update message.
2828
/// </summary>
2929
[JsonProperty(PropertyName = "sendUpdate")]
30-
public bool SendUpdate { get; set; }
30+
public bool? SendUpdate { get; set; }
3131

3232
/// <summary>
3333
/// Delay in seconds before the action is triggered by the state change.
3434
/// </summary>
3535
[JsonProperty(PropertyName = "activationDelay")]
36-
public int ActivationDelay { get; set; }
36+
public int? ActivationDelay { get; set; }
3737

3838
/// <summary>
3939
/// The amount of time to wait before deactivating this state after the state has been cleared.
4040
/// </summary>
4141
[JsonProperty(PropertyName = "deactivationDelay")]
42-
public int DeactivationDelay { get; set; }
42+
public int? DeactivationDelay { get; set; }
4343

4444
/// <summary>
4545
/// The minimum length of time to maintain action after sensor has been deactivated.
4646
/// </summary>
4747
[JsonProperty(PropertyName = "minActionDuration")]
48-
public int MinActionDuration { get; set; }
48+
public int? MinActionDuration { get; set; }
4949

5050
/// <summary>
51-
/// The amount to increase/decrease current setpoint if the type = adjustTemp.
51+
/// The amount to increase/decrease current setpoint? if the type = adjustTemp.
5252
/// </summary>
5353
[JsonProperty(PropertyName = "heatAdjustTemp")]
54-
public int HeatAdjustTemp { get; set; }
54+
public int? HeatAdjustTemp { get; set; }
5555

5656
/// <summary>
57-
/// The amount to increase/decrease current setpoint if the type = adjustTemp.
57+
/// The amount to increase/decrease current setpoint? if the type = adjustTemp.
5858
/// </summary>
5959
[JsonProperty(PropertyName = "coolAdjustTemp")]
60-
public int CoolAdjustTemp { get; set; }
60+
public int? CoolAdjustTemp { get; set; }
6161

6262
/// <summary>
6363
/// The user defined relay to be activated, only used for type == activateRelay.
@@ -69,6 +69,6 @@ public class Action
6969
/// Select if relay is to be open or closed when activated, only used for type == activateRelay.
7070
/// </summary>
7171
[JsonProperty(PropertyName = "activateRelayOpen")]
72-
public bool ActivateRelayOpen { get; set; }
72+
public bool? ActivateRelayOpen { get; set; }
7373
}
7474
}

src/I8Beef.Ecobee/Protocol/Objects/Alert.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class Alert
4242
/// The number of the alert.
4343
/// </summary>
4444
[JsonProperty(PropertyName = "alertNumber")]
45-
public int AlertNumber { get; set; }
45+
public int? AlertNumber { get; set; }
4646

4747
/// <summary>
4848
/// The type of the alert.
@@ -54,7 +54,7 @@ public class Alert
5454
/// Whether alert is an operator alert.
5555
/// </summary>
5656
[JsonProperty(PropertyName = "isOperatorAlert")]
57-
public bool IsOperatorAlert { get; set; }
57+
public bool? IsOperatorAlert { get; set; }
5858

5959
/// <summary>
6060
/// The reminder of the alert.
@@ -66,19 +66,19 @@ public class Alert
6666
/// Whether to show the alert in Idt.
6767
/// </summary>
6868
[JsonProperty(PropertyName = "showIdt")]
69-
public bool ShowIdt { get; set; }
69+
public bool? ShowIdt { get; set; }
7070

7171
/// <summary>
7272
/// Whether to show the alert on the web.
7373
/// </summary>
7474
[JsonProperty(PropertyName = "showWeb")]
75-
public bool ShowWeb { get; set; }
75+
public bool? ShowWeb { get; set; }
7676

7777
/// <summary>
7878
/// Whether to send and email for the alert.
7979
/// </summary>
8080
[JsonProperty(PropertyName = "sendEmail")]
81-
public bool SendEmail { get; set; }
81+
public bool? SendEmail { get; set; }
8282

8383
/// <summary>
8484
/// Acknowledgement of the alert.
@@ -90,7 +90,7 @@ public class Alert
9090
/// Whether to remind about the alert later.
9191
/// </summary>
9292
[JsonProperty(PropertyName = "remindMeLater")]
93-
public bool RemindMeLater { get; set; }
93+
public bool? RemindMeLater { get; set; }
9494

9595
/// <summary>
9696
/// The thermostat identifier.

src/I8Beef.Ecobee/Protocol/Objects/Audio.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,27 @@ public class Audio
1414
/// assistant. A value between 0 and 100.
1515
/// </summary>
1616
[JsonProperty(PropertyName = "playbackVolume")]
17-
public int PlaybackVolume { get; set; }
17+
public int? PlaybackVolume { get; set; }
1818

1919
/// <summary>
2020
/// Turn microphone (privacy mode) on and off.
2121
/// </summary>
2222
[JsonProperty(PropertyName = "microphoneEnabled ")]
23-
public bool MicrophoneEnabled { get; set; }
23+
public bool? MicrophoneEnabled { get; set; }
2424

2525
/// <summary>
2626
/// The volume level for alerts on the thermostat. A value between 0 and 10, with 0
2727
/// meaning 'off' - the zero value may not be honored by all ecobee versions.
2828
/// </summary>
2929
[JsonProperty(PropertyName = "soundAlertVolume")]
30-
public int SoundAlertVolume { get; set; }
30+
public int? SoundAlertVolume { get; set; }
3131

3232
/// <summary>
3333
/// The volume level for key presses on the thermostat. A value between 0 and 10,
3434
/// with 0 meaning 'off' - the zero value may not be honored by all ecobee versions.
3535
/// </summary>
3636
[JsonProperty(PropertyName = "soundTickVolume")]
37-
public int SoundTickVolume { get; set; }
37+
public int? SoundTickVolume { get; set; }
3838

3939
/// <summary>
4040
/// The list of voice engines compatible with the selected thermostat.

src/I8Beef.Ecobee/Protocol/Objects/Climate.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ public class Climate
2727
/// A flag indicating whether the property is occupied by persons during this climate.
2828
/// </summary>
2929
[JsonProperty(PropertyName = "isOccupied")]
30-
public bool IsOccupied { get; set; }
30+
public bool? IsOccupied { get; set; }
3131

3232
/// <summary>
3333
/// A flag indicating whether ecobee optimized climate settings are used by this climate.
3434
/// </summary>
3535
[JsonProperty(PropertyName = "isOptimized")]
36-
public bool IsOptimizedame { get; set; }
36+
public bool? IsOptimizedame { get; set; }
3737

3838
/// <summary>
3939
/// The cooling fan mode. Default: on.Values: auto, on.
@@ -57,7 +57,7 @@ public class Climate
5757
/// The minimum time, in minutes, to run the ventilator each hour.
5858
/// </summary>
5959
[JsonProperty(PropertyName = "ventilatorMinOnTime")]
60-
public int VentilatorMinOnTime { get; set; }
60+
public int? VentilatorMinOnTime { get; set; }
6161

6262
/// <summary>
6363
/// The climate owner.Default: system.Values: adHoc, demandResponse, quickSave, sensorAction, switchOccupancy, system, template, user.
@@ -81,13 +81,13 @@ public class Climate
8181
/// The cool temperature for this climate.
8282
/// </summary>
8383
[JsonProperty(PropertyName = "coolTemp")]
84-
public int CoolTemp { get; set; }
84+
public int? CoolTemp { get; set; }
8585

8686
/// <summary>
8787
/// The heat temperature for this climate.
8888
/// </summary>
8989
[JsonProperty(PropertyName = "heatTemp")]
90-
public int HeatTemp { get; set; }
90+
public int? HeatTemp { get; set; }
9191

9292
/// <summary>
9393
/// The list of sensors in use for the specific climate.The sensors listed here are used for temperature

src/I8Beef.Ecobee/Protocol/Objects/DemandManagement.cs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,6 @@ namespace I8Beef.Ecobee.Protocol.Objects
99
[JsonObject(MemberSerialization.OptIn)]
1010
public class DemandManagement
1111
{
12-
/// <summary>
13-
/// Initializes a new instance of the <see cref="DemandManagement"/> class.
14-
/// </summary>
15-
public DemandManagement()
16-
{
17-
TempOffsets = new List<int>();
18-
}
19-
2012
/// <summary>
2113
/// The date(UTC) for the beginning of this day's demand management series.
2214
/// </summary>
@@ -27,7 +19,7 @@ public DemandManagement()
2719
/// The hour in the day this series begins at.Range: 0-23
2820
/// </summary>
2921
[JsonProperty(PropertyName = "hour", Required = Required.Always)]
30-
public int Hour { get; set; }
22+
public int? Hour { get; set; }
3123

3224
/// <summary>
3325
/// The series of 12, 5 minute interval temperature adjustments in the hour.

0 commit comments

Comments
 (0)