@@ -66,7 +66,13 @@ class TireStatus extends RpcStruct {
66
66
* @returns {WarningLightStatus } - the KEY_PRESSURE_TELLTALE value
67
67
*/
68
68
getPressureTelltale ( ) {
69
- return this . getObject ( WarningLightStatus , TireStatus . KEY_PRESSURE_TELLTALE ) ;
69
+ let warningLightStatus = this . getObject ( WarningLightStatus , TireStatus . KEY_PRESSURE_TELLTALE ) ;
70
+ if ( warningLightStatus === null ) {
71
+ warningLightStatus = WarningLightStatus . WLS_NOT_USED ;
72
+ this . setParameter ( TireStatus . KEY_PRESSURE_TELLTALE , warningLightStatus ) ;
73
+ console . warn ( 'TireStatus\'s pressureTelltale was null and will be set to WarningLightStatus.WLS_NOT_USED. In the future, this will change to be nullable.' ) ;
74
+ }
75
+ return warningLightStatus ;
70
76
}
71
77
72
78
/**
@@ -86,7 +92,15 @@ class TireStatus extends RpcStruct {
86
92
* @returns {SingleTireStatus } - the KEY_LEFT_FRONT value
87
93
*/
88
94
getLeftFront ( ) {
89
- return this . getObject ( SingleTireStatus , TireStatus . KEY_LEFT_FRONT ) ;
95
+ let tireStatus = this . getObject ( SingleTireStatus , TireStatus . KEY_LEFT_FRONT ) ;
96
+ if ( tireStatus === null ) {
97
+ tireStatus = new SingleTireStatus ( {
98
+ status : 'UNKNOWN' ,
99
+ } ) ;
100
+ this . setParameter ( TireStatus . KEY_LEFT_FRONT , tireStatus ) ;
101
+ console . warn ( 'TireStatus\'s leftFront was null and will have its status set to UNKNOWN. In the future, this will change to be nullable.' ) ;
102
+ }
103
+ return tireStatus ;
90
104
}
91
105
92
106
/**
@@ -106,7 +120,15 @@ class TireStatus extends RpcStruct {
106
120
* @returns {SingleTireStatus } - the KEY_RIGHT_FRONT value
107
121
*/
108
122
getRightFront ( ) {
109
- return this . getObject ( SingleTireStatus , TireStatus . KEY_RIGHT_FRONT ) ;
123
+ let tireStatus = this . getObject ( SingleTireStatus , TireStatus . KEY_RIGHT_FRONT ) ;
124
+ if ( tireStatus === null ) {
125
+ tireStatus = new SingleTireStatus ( {
126
+ status : 'UNKNOWN' ,
127
+ } ) ;
128
+ this . setParameter ( TireStatus . KEY_RIGHT_FRONT , tireStatus ) ;
129
+ console . warn ( 'TireStatus\'s rightFront was null and will have its status set to UNKNOWN. In the future, this will change to be nullable.' ) ;
130
+ }
131
+ return tireStatus ;
110
132
}
111
133
112
134
/**
@@ -126,7 +148,15 @@ class TireStatus extends RpcStruct {
126
148
* @returns {SingleTireStatus } - the KEY_LEFT_REAR value
127
149
*/
128
150
getLeftRear ( ) {
129
- return this . getObject ( SingleTireStatus , TireStatus . KEY_LEFT_REAR ) ;
151
+ let tireStatus = this . getObject ( SingleTireStatus , TireStatus . KEY_LEFT_REAR ) ;
152
+ if ( tireStatus === null ) {
153
+ tireStatus = new SingleTireStatus ( {
154
+ status : 'UNKNOWN' ,
155
+ } ) ;
156
+ this . setParameter ( TireStatus . KEY_LEFT_REAR , tireStatus ) ;
157
+ console . warn ( 'TireStatus\'s leftRear was null and will have its status set to UNKNOWN. In the future, this will change to be nullable.' ) ;
158
+ }
159
+ return tireStatus ;
130
160
}
131
161
132
162
/**
@@ -146,7 +176,15 @@ class TireStatus extends RpcStruct {
146
176
* @returns {SingleTireStatus } - the KEY_RIGHT_REAR value
147
177
*/
148
178
getRightRear ( ) {
149
- return this . getObject ( SingleTireStatus , TireStatus . KEY_RIGHT_REAR ) ;
179
+ let tireStatus = this . getObject ( SingleTireStatus , TireStatus . KEY_RIGHT_REAR ) ;
180
+ if ( tireStatus === null ) {
181
+ tireStatus = new SingleTireStatus ( {
182
+ status : 'UNKNOWN' ,
183
+ } ) ;
184
+ this . setParameter ( TireStatus . KEY_RIGHT_REAR , tireStatus ) ;
185
+ console . warn ( 'TireStatus\'s rightRear was null and will have its status set to UNKNOWN. In the future, this will change to be nullable.' ) ;
186
+ }
187
+ return tireStatus ;
150
188
}
151
189
152
190
/**
@@ -166,7 +204,15 @@ class TireStatus extends RpcStruct {
166
204
* @returns {SingleTireStatus } - the KEY_INNER_LEFT_REAR value
167
205
*/
168
206
getInnerLeftRear ( ) {
169
- return this . getObject ( SingleTireStatus , TireStatus . KEY_INNER_LEFT_REAR ) ;
207
+ let tireStatus = this . getObject ( SingleTireStatus , TireStatus . KEY_INNER_LEFT_REAR ) ;
208
+ if ( tireStatus === null ) {
209
+ tireStatus = new SingleTireStatus ( {
210
+ status : 'UNKNOWN' ,
211
+ } ) ;
212
+ this . setParameter ( TireStatus . KEY_INNER_LEFT_REAR , tireStatus ) ;
213
+ console . warn ( 'TireStatus\'s innerLeftRear was null and will have its status set to UNKNOWN. In the future, this will change to be nullable.' ) ;
214
+ }
215
+ return tireStatus ;
170
216
}
171
217
172
218
/**
@@ -186,7 +232,15 @@ class TireStatus extends RpcStruct {
186
232
* @returns {SingleTireStatus } - the KEY_INNER_RIGHT_REAR value
187
233
*/
188
234
getInnerRightRear ( ) {
189
- return this . getObject ( SingleTireStatus , TireStatus . KEY_INNER_RIGHT_REAR ) ;
235
+ let tireStatus = this . getObject ( SingleTireStatus , TireStatus . KEY_INNER_RIGHT_REAR ) ;
236
+ if ( tireStatus === null ) {
237
+ tireStatus = new SingleTireStatus ( {
238
+ status : 'UNKNOWN' ,
239
+ } ) ;
240
+ this . setParameter ( TireStatus . KEY_INNER_RIGHT_REAR , tireStatus ) ;
241
+ console . warn ( 'TireStatus\'s innerRightRear was null and will have its status set to UNKNOWN. In the future, this will change to be nullable.' ) ;
242
+ }
243
+ return tireStatus ;
190
244
}
191
245
}
192
246
0 commit comments