@iternio/react-native-auto-play 0.3.4 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -55,100 +55,60 @@ class AndroidAutoTelemetryHolder {
55
55
  }
56
56
 
57
57
  fun updateBatteryLevel(value: Float) = synchronized(lock) {
58
- if (batteryLevel == value) {
59
- return
60
- }
61
-
62
58
  batteryLevel = value
63
59
  batteryLevelTimestamp = (System.currentTimeMillis() / 1000L).toInt()
64
60
  isDirty = true
65
61
  }
66
62
 
67
63
  fun updateFuelLevel(value: Float) = synchronized(lock) {
68
- if (fuelLevel == value) {
69
- return
70
- }
71
-
72
64
  fuelLevel = value
73
65
  fuelLevelTimestamp = (System.currentTimeMillis() / 1000L).toInt()
74
66
  isDirty = true
75
67
  }
76
68
 
77
69
  fun updateRange(value: Float) = synchronized(lock) {
78
- if (range == value) {
79
- return
80
- }
81
-
82
70
  range = value
83
71
  rangeTimestamp = (System.currentTimeMillis() / 1000L).toInt()
84
72
  isDirty = true
85
73
  }
86
74
 
87
75
  fun updateSpeed(value: Float?) = synchronized(lock) {
88
- if (speed == value) {
89
- return
90
- }
91
-
92
76
  speed = value
93
77
  speedTimestamp = (System.currentTimeMillis() / 1000L).toInt()
94
78
  isDirty = true
95
79
  }
96
80
 
97
81
  fun updateOdometer(value: Float?) = synchronized(lock) {
98
- if (odometer == value) {
99
- return
100
- }
101
-
102
82
  odometer = value
103
83
  odometerTimestamp = (System.currentTimeMillis() / 1000L).toInt()
104
84
  isDirty = true
105
85
  }
106
86
 
107
87
  fun updateSelectedGear(value: Int?) = synchronized(lock) {
108
- if (value == selectedGear) {
109
- return
110
- }
111
-
112
88
  selectedGear = value
113
89
  selectedGearTimestamp = (System.currentTimeMillis() / 1000L).toInt()
114
90
  isDirty = true
115
91
  }
116
92
 
117
93
  fun updateEnvOutsideTemperature(value: Float?) = synchronized(lock) {
118
- if (value == envOutsideTemperature) {
119
- return
120
- }
121
-
122
94
  envOutsideTemperature = value
123
95
  envOutsideTemperatureTimestamp = (System.currentTimeMillis() / 1000L).toInt()
124
96
  isDirty = true
125
97
  }
126
98
 
127
99
  fun updateEvChargePortConnected(value: Boolean?) = synchronized(lock) {
128
- if (value == evChargePortConnected) {
129
- return
130
- }
131
-
132
100
  evChargePortConnected = value
133
101
  evChargePortConnectedTimestamp = (System.currentTimeMillis() / 1000L).toInt()
134
102
  isDirty = true
135
103
  }
136
104
 
137
105
  fun updateEvBatteryInstantaneousChargeRate(value: Float?) = synchronized(lock) {
138
- if (value == evBatteryInstantaneousChargeRate) {
139
- return
140
- }
141
-
142
106
  evBatteryInstantaneousChargeRate = value
143
107
  evBatteryInstantaneousChargeRateTimeStamp = (System.currentTimeMillis() / 1000L).toInt()
144
108
  isDirty = true
145
109
  }
146
110
 
147
111
  fun updateParkingBrakeOn(value: Boolean?) = synchronized(lock) {
148
- if (value == parkingBrakeOn) {
149
- return
150
- }
151
-
152
112
  parkingBrakeOn = value
153
113
  parkingBrakeOnTimestamp = (System.currentTimeMillis() / 1000L).toInt()
154
114
  isDirty = true
@@ -156,6 +116,10 @@ class AndroidAutoTelemetryHolder {
156
116
 
157
117
  fun updateBatteryLevel(levelWh: Float, capacityWh: Float) = synchronized(lock) {
158
118
  if (soe == levelWh) {
119
+ soeTimestamp = (System.currentTimeMillis() / 1000L).toInt()
120
+ batteryLevelTimestamp = soeTimestamp
121
+
122
+ isDirty = true
159
123
  return
160
124
  }
161
125
 
@@ -34,7 +34,10 @@ class SignInWithGoogleActivity : ComponentActivity() {
34
34
  val googleSignInClient = GoogleSignIn.getClient(
35
35
  this,
36
36
  GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
37
- .requestServerAuthCode(serverClientId).requestEmail().build()
37
+ .requestServerAuthCode(serverClientId)
38
+ .requestEmail()
39
+ .requestIdToken(serverClientId)
40
+ .build()
38
41
  )
39
42
  activityResultLauncher.launch(googleSignInClient.signInIntent)
40
43
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iternio/react-native-auto-play",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "description": "Android Auto and Apple CarPlay for react-native",
5
5
  "main": "lib/index",
6
6
  "module": "lib/index",