@eohjsc/react-native-smart-city 0.3.92 → 0.3.93
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.
- package/package.json +5 -1
- package/src/commons/ActionGroup/SliderRangeTemplate.js +2 -2
- package/src/commons/AlertAction/index.js +5 -0
- package/src/commons/BottomButtonView/index.js +22 -4
- package/src/commons/Button/index.js +5 -0
- package/src/commons/Device/ConnectedViewHeader.js +0 -1
- package/src/commons/Device/Emergency/EmergencyDetail.js +4 -2
- package/src/commons/Device/Emergency/__test__/EmergencyDetail.test.js +4 -2
- package/src/commons/Device/ProgressBar/index.js +3 -1
- package/src/commons/Device/ProgressBar/styles.js +1 -4
- package/src/commons/Device/WindSpeed/Anemometer/index.js +1 -1
- package/src/commons/Header/HeaderCustom.js +8 -18
- package/src/commons/SubUnit/OneTap/ItemOneTap.js +5 -48
- package/src/commons/SubUnit/OneTap/__test__/SubUnitAutomate.test.js +6 -15
- package/src/commons/SubUnit/OneTap/index.js +3 -3
- package/src/commons/ViewButtonBottom/index.js +32 -4
- package/src/configs/API.js +3 -0
- package/src/configs/AccessibilityLabel.js +1 -0
- package/src/configs/BLE.js +1 -0
- package/src/context/actionType.ts +2 -1
- package/src/context/mockStore.ts +1 -0
- package/src/context/reducer.ts +12 -1
- package/src/hooks/Explore/useKeyboardAnimated.js +10 -4
- package/src/hooks/IoT/useBluetoothConnection.js +14 -26
- package/src/hooks/useMqtt.js +95 -0
- package/src/iot/Monitor.js +2 -1
- package/src/iot/RemoteControl/Bluetooth.js +56 -19
- package/src/iot/RemoteControl/__test__/Bluetooth.test.js +140 -0
- package/src/iot/mqtt.js +233 -0
- package/src/navigations/UnitStack.js +11 -3
- package/src/screens/AddLocationMaps/index.js +18 -16
- package/src/screens/AddLocationMaps/indexStyle.js +3 -0
- package/src/screens/Automate/AddNewAction/NewActionWrapper.js +3 -6
- package/src/screens/Automate/AddNewAction/SetupConfigCondition.js +29 -29
- package/src/screens/Automate/AddNewAction/__test__/SetupSensor.test.js +45 -39
- package/src/screens/Automate/AddNewAutoSmart/AddAutomationTypeSmart.js +25 -0
- package/src/screens/{AddNewAutoSmart/index.js → Automate/AddNewAutoSmart/AddTypeSmart.js} +16 -51
- package/src/screens/Automate/AddNewAutoSmart/AddUnknownTypeSmart.js +29 -0
- package/src/screens/{AddNewAutoSmart → Automate/AddNewAutoSmart}/__test__/AddNewAutoSmart.test.js +11 -11
- package/src/screens/{AddNewAutoSmart → Automate/AddNewAutoSmart}/styles/AddNewAutoSmartStyles.js +1 -1
- package/src/screens/Automate/Components/InputNameStyles.js +1 -1
- package/src/screens/Automate/EditActionsList/__tests__/index.test.js +11 -25
- package/src/screens/Automate/EditActionsList/index.js +32 -33
- package/src/screens/Automate/MultiUnits.js +1 -1
- package/src/screens/Automate/ScriptDetail/__test__/index.test.js +42 -3
- package/src/screens/Automate/ScriptDetail/index.js +21 -7
- package/src/screens/Automate/__test__/MultiUnits.test.js +1 -1
- package/src/screens/Automate/__test__/index.test.js +1 -1
- package/src/screens/Automate/index.js +1 -1
- package/src/screens/Device/__test__/detail.test.js +1 -1
- package/src/screens/Device/__test__/mqttDetail.test.js +599 -0
- package/src/screens/Device/components/SensorDisplayItem.js +1 -7
- package/src/screens/Device/detail.js +64 -30
- package/src/screens/Device/hooks/useDeviceWatchConfigControl.js +13 -3
- package/src/screens/SelectUnit/__test__/index.test.js +8 -13
- package/src/screens/SmartAccount/__test__/SmartAccount.test.js +8 -4
- package/src/screens/SmartAccount/index.js +8 -9
- package/src/screens/SmartAccount/style.js +8 -7
- package/src/screens/Unit/Detail.js +4 -19
- package/src/screens/Unit/Summaries.js +6 -17
- package/src/screens/Unit/__test__/Summaries.test.js +2 -2
- package/src/utils/FactoryGateway.js +525 -0
- package/src/utils/I18n/translations/en.json +5 -1
- package/src/utils/I18n/translations/vi.json +5 -2
- package/src/utils/Route/index.js +2 -1
- package/src/utils/Utils.js +11 -0
- package/src/commons/Device/SensorConnectedStatus.js +0 -56
- package/src/commons/Device/__test__/SensorConnectedStatus.test.js +0 -29
|
@@ -0,0 +1,525 @@
|
|
|
1
|
+
export const configDataFactory = {
|
|
2
|
+
id: 128282,
|
|
3
|
+
status_texts: [],
|
|
4
|
+
is_on: false,
|
|
5
|
+
get_value_unit: '0 ',
|
|
6
|
+
period_configs: [],
|
|
7
|
+
auto_triggers: [],
|
|
8
|
+
spotsensorconnect: null,
|
|
9
|
+
last_maxmin: {
|
|
10
|
+
id: 15772,
|
|
11
|
+
config_id: 128282,
|
|
12
|
+
max: 1,
|
|
13
|
+
min: 0,
|
|
14
|
+
created_at: '2022-12-06',
|
|
15
|
+
min_created_at: '2022-12-06T00:11:22.798649Z',
|
|
16
|
+
max_created_at: '2022-12-06T00:11:48.587128Z',
|
|
17
|
+
},
|
|
18
|
+
user_receive_email: [],
|
|
19
|
+
phone_send_sms: [],
|
|
20
|
+
status_configuration: {},
|
|
21
|
+
is_auto_release: false,
|
|
22
|
+
active: true,
|
|
23
|
+
name: 'Led',
|
|
24
|
+
is_read: true,
|
|
25
|
+
is_write: true,
|
|
26
|
+
range_min: 0,
|
|
27
|
+
range_max: 0,
|
|
28
|
+
unit: '',
|
|
29
|
+
scale: 0.1,
|
|
30
|
+
is_main: true,
|
|
31
|
+
is_chart: true,
|
|
32
|
+
is_report: true,
|
|
33
|
+
is_chart_column: false,
|
|
34
|
+
is_hide: false,
|
|
35
|
+
display_type: '',
|
|
36
|
+
is_alarm: false,
|
|
37
|
+
email_flags: false,
|
|
38
|
+
time_is_over: null,
|
|
39
|
+
is_update_value_when_change: false,
|
|
40
|
+
maintain_time: 5,
|
|
41
|
+
number_send_email: null,
|
|
42
|
+
period_send_email: 15,
|
|
43
|
+
allow_min_value: 0,
|
|
44
|
+
allow_max_value: 0,
|
|
45
|
+
message: 'Th\\u00f4ng b\\u00e1o.',
|
|
46
|
+
last_time_send_email: null,
|
|
47
|
+
ai_trans_offset_value: '0.000',
|
|
48
|
+
ai_trans_average_sample: 0,
|
|
49
|
+
last_values: [],
|
|
50
|
+
icon: '',
|
|
51
|
+
scale_write: 1,
|
|
52
|
+
lock: false,
|
|
53
|
+
flag: false,
|
|
54
|
+
index: 0,
|
|
55
|
+
decimal_behind: 1,
|
|
56
|
+
active_filter: '',
|
|
57
|
+
high_level: 0,
|
|
58
|
+
low_level: 0,
|
|
59
|
+
value_converter: '',
|
|
60
|
+
ack: false,
|
|
61
|
+
sensor_type: '',
|
|
62
|
+
enable_log_max_min: true,
|
|
63
|
+
log_value_mode: 1,
|
|
64
|
+
freq_log_data: 600,
|
|
65
|
+
release_time: 0,
|
|
66
|
+
sensor: 35440,
|
|
67
|
+
end_device: null,
|
|
68
|
+
last_value: null,
|
|
69
|
+
last_value_log: null,
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const gatewayDataFactory = {
|
|
73
|
+
code: 'code-123',
|
|
74
|
+
name: 'Son chip - esp32 2',
|
|
75
|
+
mqtt_server: {
|
|
76
|
+
host: 'example.cloudmqtt.com',
|
|
77
|
+
allow_frontend_connect: true,
|
|
78
|
+
websocket_port: 443,
|
|
79
|
+
},
|
|
80
|
+
sensors: [
|
|
81
|
+
{
|
|
82
|
+
id: 35441,
|
|
83
|
+
configs: [
|
|
84
|
+
{
|
|
85
|
+
id: 128282,
|
|
86
|
+
status_texts: [],
|
|
87
|
+
is_on: false,
|
|
88
|
+
get_value_unit: '0 ',
|
|
89
|
+
period_configs: [],
|
|
90
|
+
auto_triggers: [],
|
|
91
|
+
spotsensorconnect: null,
|
|
92
|
+
last_maxmin: {
|
|
93
|
+
id: 15772,
|
|
94
|
+
config_id: 128282,
|
|
95
|
+
max: 1,
|
|
96
|
+
min: 0,
|
|
97
|
+
created_at: '2022-12-06',
|
|
98
|
+
min_created_at: '2022-12-06T00:11:22.798649Z',
|
|
99
|
+
max_created_at: '2022-12-06T00:11:48.587128Z',
|
|
100
|
+
},
|
|
101
|
+
user_receive_email: [],
|
|
102
|
+
phone_send_sms: [],
|
|
103
|
+
status_configuration: {},
|
|
104
|
+
is_auto_release: false,
|
|
105
|
+
active: true,
|
|
106
|
+
name: 'Led',
|
|
107
|
+
is_read: true,
|
|
108
|
+
is_write: true,
|
|
109
|
+
range_min: 0,
|
|
110
|
+
range_max: 0,
|
|
111
|
+
unit: '',
|
|
112
|
+
scale: 1,
|
|
113
|
+
is_main: true,
|
|
114
|
+
is_chart: true,
|
|
115
|
+
is_report: true,
|
|
116
|
+
is_chart_column: false,
|
|
117
|
+
is_hide: false,
|
|
118
|
+
display_type: '',
|
|
119
|
+
is_alarm: false,
|
|
120
|
+
email_flags: false,
|
|
121
|
+
time_is_over: null,
|
|
122
|
+
is_update_value_when_change: false,
|
|
123
|
+
maintain_time: 5,
|
|
124
|
+
number_send_email: null,
|
|
125
|
+
period_send_email: 15,
|
|
126
|
+
allow_min_value: 0,
|
|
127
|
+
allow_max_value: 0,
|
|
128
|
+
message: 'Th\\u00f4ng b\\u00e1o.',
|
|
129
|
+
last_time_send_email: null,
|
|
130
|
+
ai_trans_offset_value: '0.000',
|
|
131
|
+
ai_trans_average_sample: 0,
|
|
132
|
+
last_values: [],
|
|
133
|
+
icon: '',
|
|
134
|
+
scale_write: 1,
|
|
135
|
+
lock: false,
|
|
136
|
+
flag: false,
|
|
137
|
+
index: 0,
|
|
138
|
+
decimal_behind: null,
|
|
139
|
+
active_filter: '',
|
|
140
|
+
high_level: 0,
|
|
141
|
+
low_level: 0,
|
|
142
|
+
value_converter: '',
|
|
143
|
+
ack: false,
|
|
144
|
+
sensor_type: '',
|
|
145
|
+
enable_log_max_min: true,
|
|
146
|
+
log_value_mode: 1,
|
|
147
|
+
freq_log_data: 600,
|
|
148
|
+
release_time: 0,
|
|
149
|
+
sensor: 35440,
|
|
150
|
+
end_device: null,
|
|
151
|
+
last_value: null,
|
|
152
|
+
last_value_log: null,
|
|
153
|
+
},
|
|
154
|
+
],
|
|
155
|
+
active: true,
|
|
156
|
+
name: 'Device Led',
|
|
157
|
+
mix: true,
|
|
158
|
+
index: 0,
|
|
159
|
+
icon: '',
|
|
160
|
+
is_managed_by_backend: true,
|
|
161
|
+
device_id: '',
|
|
162
|
+
last_updated: null,
|
|
163
|
+
connection_time: 30,
|
|
164
|
+
sent_email: false,
|
|
165
|
+
device_type: '',
|
|
166
|
+
is_reading_device: false,
|
|
167
|
+
realtime_monitoring: false,
|
|
168
|
+
station: null,
|
|
169
|
+
chip: 7689,
|
|
170
|
+
icon_kit: null,
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
id: 35466,
|
|
174
|
+
configs: [
|
|
175
|
+
{
|
|
176
|
+
id: 128323,
|
|
177
|
+
status_texts: [],
|
|
178
|
+
is_on: false,
|
|
179
|
+
get_value_unit: '56.9 %',
|
|
180
|
+
period_configs: [],
|
|
181
|
+
auto_triggers: [],
|
|
182
|
+
spotsensorconnect: null,
|
|
183
|
+
last_maxmin: {
|
|
184
|
+
id: 15843,
|
|
185
|
+
config_id: 128323,
|
|
186
|
+
max: 60.8,
|
|
187
|
+
min: 0,
|
|
188
|
+
created_at: '2022-12-07',
|
|
189
|
+
min_created_at: '2022-12-07T17:44:10.864589Z',
|
|
190
|
+
max_created_at: '2022-12-07T17:54:43.580269Z',
|
|
191
|
+
},
|
|
192
|
+
user_receive_email: [],
|
|
193
|
+
phone_send_sms: [],
|
|
194
|
+
status_configuration: {},
|
|
195
|
+
is_auto_release: false,
|
|
196
|
+
active: true,
|
|
197
|
+
name: 'Do am',
|
|
198
|
+
is_read: true,
|
|
199
|
+
is_write: false,
|
|
200
|
+
range_min: 0,
|
|
201
|
+
range_max: 0,
|
|
202
|
+
unit: '%',
|
|
203
|
+
scale: 0.1,
|
|
204
|
+
is_main: true,
|
|
205
|
+
is_chart: true,
|
|
206
|
+
is_report: true,
|
|
207
|
+
is_chart_column: false,
|
|
208
|
+
is_hide: false,
|
|
209
|
+
display_type: '',
|
|
210
|
+
is_alarm: false,
|
|
211
|
+
email_flags: false,
|
|
212
|
+
time_is_over: null,
|
|
213
|
+
is_update_value_when_change: false,
|
|
214
|
+
maintain_time: 5,
|
|
215
|
+
number_send_email: null,
|
|
216
|
+
period_send_email: 15,
|
|
217
|
+
allow_min_value: 0,
|
|
218
|
+
allow_max_value: 0,
|
|
219
|
+
message: 'Th\\u00f4ng b\\u00e1o.',
|
|
220
|
+
last_time_send_email: null,
|
|
221
|
+
ai_trans_offset_value: '0.000',
|
|
222
|
+
ai_trans_average_sample: 0,
|
|
223
|
+
last_values: [],
|
|
224
|
+
icon: '',
|
|
225
|
+
scale_write: 1,
|
|
226
|
+
lock: false,
|
|
227
|
+
flag: false,
|
|
228
|
+
index: 0,
|
|
229
|
+
decimal_behind: 1,
|
|
230
|
+
active_filter: '',
|
|
231
|
+
high_level: 0,
|
|
232
|
+
low_level: 0,
|
|
233
|
+
value_converter: '',
|
|
234
|
+
ack: false,
|
|
235
|
+
sensor_type: '',
|
|
236
|
+
enable_log_max_min: true,
|
|
237
|
+
log_value_mode: 1,
|
|
238
|
+
freq_log_data: 600,
|
|
239
|
+
release_time: 0,
|
|
240
|
+
sensor: 35466,
|
|
241
|
+
end_device: null,
|
|
242
|
+
last_value: null,
|
|
243
|
+
last_value_log: null,
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
id: 128324,
|
|
247
|
+
status_texts: [],
|
|
248
|
+
is_on: false,
|
|
249
|
+
get_value_unit: '27 *C',
|
|
250
|
+
period_configs: [],
|
|
251
|
+
auto_triggers: [],
|
|
252
|
+
spotsensorconnect: null,
|
|
253
|
+
last_maxmin: {
|
|
254
|
+
id: 15844,
|
|
255
|
+
config_id: 128324,
|
|
256
|
+
max: 27,
|
|
257
|
+
min: 0,
|
|
258
|
+
created_at: '2022-12-07',
|
|
259
|
+
min_created_at: '2022-12-07T17:44:10.864589Z',
|
|
260
|
+
max_created_at: '2022-12-07T17:49:53.430263Z',
|
|
261
|
+
},
|
|
262
|
+
user_receive_email: [],
|
|
263
|
+
phone_send_sms: [],
|
|
264
|
+
status_configuration: {},
|
|
265
|
+
is_auto_release: false,
|
|
266
|
+
active: true,
|
|
267
|
+
name: 'Nhiet do',
|
|
268
|
+
is_read: true,
|
|
269
|
+
is_write: false,
|
|
270
|
+
range_min: 0,
|
|
271
|
+
range_max: 0,
|
|
272
|
+
unit: '*C',
|
|
273
|
+
scale: 0.1,
|
|
274
|
+
is_main: true,
|
|
275
|
+
is_chart: true,
|
|
276
|
+
is_report: true,
|
|
277
|
+
is_chart_column: false,
|
|
278
|
+
is_hide: false,
|
|
279
|
+
display_type: '',
|
|
280
|
+
is_alarm: false,
|
|
281
|
+
email_flags: false,
|
|
282
|
+
time_is_over: null,
|
|
283
|
+
is_update_value_when_change: false,
|
|
284
|
+
maintain_time: 5,
|
|
285
|
+
number_send_email: null,
|
|
286
|
+
period_send_email: 15,
|
|
287
|
+
allow_min_value: 0,
|
|
288
|
+
allow_max_value: 0,
|
|
289
|
+
message: 'Th\\u00f4ng b\\u00e1o.',
|
|
290
|
+
last_time_send_email: null,
|
|
291
|
+
ai_trans_offset_value: '0.000',
|
|
292
|
+
ai_trans_average_sample: 0,
|
|
293
|
+
last_values: [],
|
|
294
|
+
icon: '',
|
|
295
|
+
scale_write: 1,
|
|
296
|
+
lock: false,
|
|
297
|
+
flag: false,
|
|
298
|
+
index: 0,
|
|
299
|
+
decimal_behind: 1,
|
|
300
|
+
active_filter: '',
|
|
301
|
+
high_level: 0,
|
|
302
|
+
low_level: 0,
|
|
303
|
+
value_converter: '',
|
|
304
|
+
ack: false,
|
|
305
|
+
sensor_type: '',
|
|
306
|
+
enable_log_max_min: true,
|
|
307
|
+
log_value_mode: 1,
|
|
308
|
+
freq_log_data: 600,
|
|
309
|
+
release_time: 0,
|
|
310
|
+
sensor: 35466,
|
|
311
|
+
end_device: null,
|
|
312
|
+
last_value: null,
|
|
313
|
+
last_value_log: null,
|
|
314
|
+
},
|
|
315
|
+
],
|
|
316
|
+
active: true,
|
|
317
|
+
name: 'Device Temp - Humi',
|
|
318
|
+
mix: true,
|
|
319
|
+
index: 0,
|
|
320
|
+
icon: '',
|
|
321
|
+
is_managed_by_backend: true,
|
|
322
|
+
device_id: '',
|
|
323
|
+
last_updated: null,
|
|
324
|
+
connection_time: 60,
|
|
325
|
+
sent_email: false,
|
|
326
|
+
device_type: '',
|
|
327
|
+
is_reading_device: false,
|
|
328
|
+
realtime_monitoring: false,
|
|
329
|
+
station: null,
|
|
330
|
+
chip: 7689,
|
|
331
|
+
icon_kit: null,
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
// zigbee
|
|
335
|
+
id: 123,
|
|
336
|
+
configs: [
|
|
337
|
+
{
|
|
338
|
+
id: 111,
|
|
339
|
+
status_texts: [],
|
|
340
|
+
is_on: false,
|
|
341
|
+
get_value_unit: '0 ',
|
|
342
|
+
period_configs: [],
|
|
343
|
+
auto_triggers: [],
|
|
344
|
+
spotsensorconnect: null,
|
|
345
|
+
last_maxmin: {
|
|
346
|
+
id: 15772,
|
|
347
|
+
config_id: 128282,
|
|
348
|
+
max: 1,
|
|
349
|
+
min: 0,
|
|
350
|
+
created_at: '2022-12-06',
|
|
351
|
+
min_created_at: '2022-12-06T00:11:22.798649Z',
|
|
352
|
+
max_created_at: '2022-12-06T00:11:48.587128Z',
|
|
353
|
+
},
|
|
354
|
+
user_receive_email: [],
|
|
355
|
+
phone_send_sms: [],
|
|
356
|
+
status_configuration: {},
|
|
357
|
+
is_auto_release: false,
|
|
358
|
+
active: true,
|
|
359
|
+
name: 'Led',
|
|
360
|
+
is_read: true,
|
|
361
|
+
is_write: true,
|
|
362
|
+
range_min: 0,
|
|
363
|
+
range_max: 0,
|
|
364
|
+
unit: '',
|
|
365
|
+
scale: 1,
|
|
366
|
+
is_main: true,
|
|
367
|
+
is_chart: true,
|
|
368
|
+
is_report: true,
|
|
369
|
+
is_chart_column: false,
|
|
370
|
+
is_hide: false,
|
|
371
|
+
display_type: '',
|
|
372
|
+
is_alarm: false,
|
|
373
|
+
email_flags: false,
|
|
374
|
+
time_is_over: null,
|
|
375
|
+
is_update_value_when_change: false,
|
|
376
|
+
maintain_time: 5,
|
|
377
|
+
number_send_email: null,
|
|
378
|
+
period_send_email: 15,
|
|
379
|
+
allow_min_value: 0,
|
|
380
|
+
allow_max_value: 0,
|
|
381
|
+
message: 'Th\\u00f4ng b\\u00e1o.',
|
|
382
|
+
last_time_send_email: null,
|
|
383
|
+
ai_trans_offset_value: '0.000',
|
|
384
|
+
ai_trans_average_sample: 0,
|
|
385
|
+
last_values: [],
|
|
386
|
+
icon: '',
|
|
387
|
+
scale_write: 1,
|
|
388
|
+
lock: false,
|
|
389
|
+
flag: false,
|
|
390
|
+
index: 0,
|
|
391
|
+
decimal_behind: null,
|
|
392
|
+
active_filter: '',
|
|
393
|
+
high_level: 0,
|
|
394
|
+
low_level: 0,
|
|
395
|
+
value_converter: '',
|
|
396
|
+
ack: false,
|
|
397
|
+
sensor_type: '',
|
|
398
|
+
enable_log_max_min: true,
|
|
399
|
+
log_value_mode: 1,
|
|
400
|
+
freq_log_data: 600,
|
|
401
|
+
release_time: 0,
|
|
402
|
+
sensor: 123,
|
|
403
|
+
end_device: null,
|
|
404
|
+
last_value: null,
|
|
405
|
+
last_value_log: null,
|
|
406
|
+
},
|
|
407
|
+
],
|
|
408
|
+
active: true,
|
|
409
|
+
name: 'Device Zigbee nhiet do',
|
|
410
|
+
mix: true,
|
|
411
|
+
index: 0,
|
|
412
|
+
icon: '',
|
|
413
|
+
is_managed_by_backend: true,
|
|
414
|
+
device_id: '',
|
|
415
|
+
last_updated: null,
|
|
416
|
+
connection_time: 30,
|
|
417
|
+
sent_email: false,
|
|
418
|
+
device_type: '',
|
|
419
|
+
is_reading_device: false,
|
|
420
|
+
realtime_monitoring: false,
|
|
421
|
+
station: null,
|
|
422
|
+
chip: 7689,
|
|
423
|
+
icon_kit: null,
|
|
424
|
+
},
|
|
425
|
+
],
|
|
426
|
+
id: 7689,
|
|
427
|
+
sn: '57ae596e-ef65-4162-9b6f-4f67f2c86632',
|
|
428
|
+
interchange_throttle: 20,
|
|
429
|
+
is_wifi: false,
|
|
430
|
+
wifi_ssid: '',
|
|
431
|
+
wifi_pass: null,
|
|
432
|
+
phone: '',
|
|
433
|
+
wifi_is_using: null,
|
|
434
|
+
wifi_update_time: '12:56:44 05-12-2022',
|
|
435
|
+
is_success_new_wifi: false,
|
|
436
|
+
max_config: 10,
|
|
437
|
+
is_timer: false,
|
|
438
|
+
datetime_active: '2022-12-05',
|
|
439
|
+
sim_co: true,
|
|
440
|
+
message_expire: 'Th\\u00f4ng b\\u00e1o gia h\\u1ea1n Sim.',
|
|
441
|
+
is_hex: true,
|
|
442
|
+
conditional_config: null,
|
|
443
|
+
conditional_value: '0',
|
|
444
|
+
is_using_soft_interlock: false,
|
|
445
|
+
modbus_gateway: {
|
|
446
|
+
finalize_id: null,
|
|
447
|
+
baud_speed: 9600,
|
|
448
|
+
ip_master: null,
|
|
449
|
+
port: null,
|
|
450
|
+
sensors: [
|
|
451
|
+
{
|
|
452
|
+
add: 1,
|
|
453
|
+
ip_slave: null,
|
|
454
|
+
configs: [
|
|
455
|
+
{
|
|
456
|
+
id: 110425,
|
|
457
|
+
sa: 0,
|
|
458
|
+
len: 1,
|
|
459
|
+
func: 3,
|
|
460
|
+
sa1: 0,
|
|
461
|
+
sa2: 0,
|
|
462
|
+
len1: 0,
|
|
463
|
+
len2: 1,
|
|
464
|
+
ex: '0',
|
|
465
|
+
scale: 1,
|
|
466
|
+
time_is_over: null,
|
|
467
|
+
transformer: 'int_all',
|
|
468
|
+
ai_trans_max_value: 0,
|
|
469
|
+
ai_trans_min_value: 0,
|
|
470
|
+
ai_trans_max_raw_in: 0,
|
|
471
|
+
ai_trans_min_raw_in: 0,
|
|
472
|
+
scale_write: 1,
|
|
473
|
+
device: 24122,
|
|
474
|
+
config: 128323,
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
id: 110426,
|
|
478
|
+
sa: 1,
|
|
479
|
+
len: 1,
|
|
480
|
+
func: 3,
|
|
481
|
+
sa1: 0,
|
|
482
|
+
sa2: 1,
|
|
483
|
+
len1: 0,
|
|
484
|
+
len2: 1,
|
|
485
|
+
ex: '0',
|
|
486
|
+
scale: 1,
|
|
487
|
+
time_is_over: null,
|
|
488
|
+
transformer: 'int_all',
|
|
489
|
+
ai_trans_max_value: 0,
|
|
490
|
+
ai_trans_min_value: 0,
|
|
491
|
+
ai_trans_max_raw_in: 0,
|
|
492
|
+
ai_trans_min_raw_in: 0,
|
|
493
|
+
scale_write: 1,
|
|
494
|
+
device: 24122,
|
|
495
|
+
config: 128324,
|
|
496
|
+
},
|
|
497
|
+
],
|
|
498
|
+
sensor_id: 35466,
|
|
499
|
+
},
|
|
500
|
+
],
|
|
501
|
+
chip_id: 7689,
|
|
502
|
+
version: 9,
|
|
503
|
+
},
|
|
504
|
+
zigbee_gateway: {
|
|
505
|
+
id: 224,
|
|
506
|
+
sensors: [
|
|
507
|
+
{
|
|
508
|
+
id: 566,
|
|
509
|
+
configs: [
|
|
510
|
+
{
|
|
511
|
+
id: 1621,
|
|
512
|
+
key: 'temperature_measured',
|
|
513
|
+
device: 566,
|
|
514
|
+
config: 111,
|
|
515
|
+
},
|
|
516
|
+
],
|
|
517
|
+
ieee_address: '0x00158d00022fd3c6',
|
|
518
|
+
model_name: 'lumi.weather',
|
|
519
|
+
gateway: 224,
|
|
520
|
+
sensor: 123,
|
|
521
|
+
},
|
|
522
|
+
],
|
|
523
|
+
chip: 7682,
|
|
524
|
+
},
|
|
525
|
+
};
|
|
@@ -886,6 +886,7 @@
|
|
|
886
886
|
"connected_via_internet": "Connected via Internet",
|
|
887
887
|
"name_your_unit": "Name your unit",
|
|
888
888
|
"script_updated_by": "Script updated by",
|
|
889
|
+
"only_owner_has_permission_to_edit_this_script": "Only owner has permission to edit this script.",
|
|
889
890
|
"qr_scan_guidelines": "The QR code will be detected automatically when it’s positioned within the guide lines.",
|
|
890
891
|
"move_to_another_sub_unit": "Move to another Sub unit",
|
|
891
892
|
"now_playing": "Now Playing",
|
|
@@ -1134,5 +1135,8 @@
|
|
|
1134
1135
|
"transfer_ownership": "Transfer ownership",
|
|
1135
1136
|
"text_change_owner": "Ownership permissions of this unit to the user you have selected.",
|
|
1136
1137
|
"text_alert_change_owner": "You will be removed from this Unit after transfer ownership.",
|
|
1137
|
-
"the_system_has_been_upgraded" : "To provide a better user experience, [Era] will perform a system upgrade.The upgrade will take about 10 minutes.\n\n Some device control functions will be interrupted during the upgrade.[Era] would like to ask for your understanding for this inconvenience.\n\nBest regards."
|
|
1138
|
+
"the_system_has_been_upgraded" : "To provide a better user experience, [Era] will perform a system upgrade.The upgrade will take about 10 minutes.\n\n Some device control functions will be interrupted during the upgrade.[Era] would like to ask for your understanding for this inconvenience.\n\nBest regards.",
|
|
1139
|
+
"value_must_be_greater_than_min": "Value must be greater than {min}",
|
|
1140
|
+
"value_must_be_less_than_max": "Value must be less than {max}",
|
|
1141
|
+
"value_must_be_a_number": "Value must be a number"
|
|
1138
1142
|
}
|
|
@@ -883,6 +883,7 @@
|
|
|
883
883
|
"connected_via_internet": "Đã kết nối điều khiển thông qua Internet",
|
|
884
884
|
"name_your_unit": "Đặt tên cho khu vực của bạn",
|
|
885
885
|
"script_updated_by": "Kịch bản được cập nhật bởi",
|
|
886
|
+
"only_owner_has_permission_to_edit_this_script": "Chỉ chủ sở hữu mới có quyền chỉnh sửa kịch bản này",
|
|
886
887
|
"qr_scan_guidelines": "Mã QR sẽ được phát hiện tự động khi nó được định vị trong các dòng hướng dẫn.",
|
|
887
888
|
"move_to_another_sub_unit": "Chuyển sang khu vực khác",
|
|
888
889
|
"now_playing": "Đang chạy",
|
|
@@ -1131,6 +1132,8 @@
|
|
|
1131
1132
|
"transfer_ownership": "Chuyển quyền sở hữu",
|
|
1132
1133
|
"text_change_owner": "Quyền sở hữu đơn vị này cho người dùng bạn đã chọn.",
|
|
1133
1134
|
"text_alert_change_owner": "Bạn sẽ bị xóa khỏi Unit này sau khi chuyển quyền sở hữu.",
|
|
1134
|
-
"the_system_has_been_upgraded" : "Để mang lại trải nghiệm tốt hơn cho người dùng, [Era] sẽ tiến hành nâng cấp hệ thống.Việc nâng cấp sẽ diễn ra trong khoảng 10 phút.\n\nMột số chức năng điều khiển thiết bị sẽ bị gián đoạn trong thời gian nâng cấp.[Era] kính mong quý khách hàng thông cảm cho sự bất tiện này.\n\nTrân trọng "
|
|
1135
|
-
|
|
1135
|
+
"the_system_has_been_upgraded" : "Để mang lại trải nghiệm tốt hơn cho người dùng, [Era] sẽ tiến hành nâng cấp hệ thống.Việc nâng cấp sẽ diễn ra trong khoảng 10 phút.\n\nMột số chức năng điều khiển thiết bị sẽ bị gián đoạn trong thời gian nâng cấp.[Era] kính mong quý khách hàng thông cảm cho sự bất tiện này.\n\nTrân trọng ",
|
|
1136
|
+
"value_must_be_greater_than_min": "Giá trị phải lớn hơn {min}",
|
|
1137
|
+
"value_must_be_less_than_max": "Giá trị phải nhỏ hơn {max}",
|
|
1138
|
+
"value_must_be_a_number": "Giá trị phải là một số"
|
|
1136
1139
|
}
|
package/src/utils/Route/index.js
CHANGED
|
@@ -126,7 +126,8 @@ const Routes = {
|
|
|
126
126
|
EditActionsList: 'EditActionsList',
|
|
127
127
|
PlaybackCamera: 'PlaybackCamera',
|
|
128
128
|
SetupConfigCondition: 'SetupConfigCondition',
|
|
129
|
-
|
|
129
|
+
AddAutomationTypeSmart: 'AddAutomationTypeSmart',
|
|
130
|
+
AddUnknownTypeSmart: 'AddUnknownTypeSmart',
|
|
130
131
|
ScenarioName: 'ScenarioName',
|
|
131
132
|
ValueChangeName: 'ValueChangeName',
|
|
132
133
|
AllCamera: 'AllCamera',
|
package/src/utils/Utils.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PixelRatio, Linking, Alert } from 'react-native';
|
|
2
2
|
import Toast from 'react-native-toast-message';
|
|
3
|
+
import { decode } from 'base-64';
|
|
3
4
|
import validator from 'validator';
|
|
4
5
|
import api from './Apis/axios';
|
|
5
6
|
import {
|
|
@@ -266,3 +267,13 @@ export const getDateRangeOfWeek = (weekNumber, year) => {
|
|
|
266
267
|
rangeIsTo = d1.getDate() + '.' + (d1.getMonth() + 1);
|
|
267
268
|
return rangeIsFrom + '-' + rangeIsTo;
|
|
268
269
|
};
|
|
270
|
+
|
|
271
|
+
export const base64ToHex = (str) => {
|
|
272
|
+
const raw = decode(str);
|
|
273
|
+
let result = '';
|
|
274
|
+
for (let i = 0; i < raw.length; i++) {
|
|
275
|
+
const hex = raw.charCodeAt(i).toString(16);
|
|
276
|
+
result += hex.length === 2 ? hex : '0' + hex;
|
|
277
|
+
}
|
|
278
|
+
return result.toUpperCase();
|
|
279
|
+
};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import React, { memo } from 'react';
|
|
2
|
-
import { View, StyleSheet } from 'react-native';
|
|
3
|
-
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
4
|
-
|
|
5
|
-
import { Colors } from '../../configs';
|
|
6
|
-
import Text from '../../commons/Text';
|
|
7
|
-
import Connect from '../../../assets/images/Device/Connect.svg';
|
|
8
|
-
import { AccessibilityLabel } from '../../configs/Constants';
|
|
9
|
-
|
|
10
|
-
const SensorConnectedStatus = memo(({ txtSensor, timeLastUpdate }) => {
|
|
11
|
-
const t = useTranslations();
|
|
12
|
-
return (
|
|
13
|
-
<View
|
|
14
|
-
style={styles.container}
|
|
15
|
-
accessibilityLabel={AccessibilityLabel.SENSOR_CONNECTED_STATUS}
|
|
16
|
-
>
|
|
17
|
-
<View style={styles.connectStatus}>
|
|
18
|
-
<Connect />
|
|
19
|
-
<Text color={Colors.Green6} size={14} style={styles.txtStatus}>
|
|
20
|
-
{t('connected')}
|
|
21
|
-
</Text>
|
|
22
|
-
</View>
|
|
23
|
-
<Text color={Colors.Gray9} size={16} style={styles.txtCurrent}>
|
|
24
|
-
{txtSensor}
|
|
25
|
-
</Text>
|
|
26
|
-
<Text color={Colors.Gray7} size={12} style={styles.txtLastUpdate}>
|
|
27
|
-
{t('last_updated_%{minutes}_minutes_ago', { minutes: timeLastUpdate })}
|
|
28
|
-
</Text>
|
|
29
|
-
</View>
|
|
30
|
-
);
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
export default SensorConnectedStatus;
|
|
34
|
-
|
|
35
|
-
const styles = StyleSheet.create({
|
|
36
|
-
container: {
|
|
37
|
-
alignItems: 'center',
|
|
38
|
-
},
|
|
39
|
-
connectStatus: {
|
|
40
|
-
flexDirection: 'row',
|
|
41
|
-
alignItems: 'center',
|
|
42
|
-
},
|
|
43
|
-
txtStatus: {
|
|
44
|
-
marginLeft: 8,
|
|
45
|
-
},
|
|
46
|
-
txtCurrent: {
|
|
47
|
-
marginLeft: 8,
|
|
48
|
-
lineHeight: 24,
|
|
49
|
-
marginTop: 16,
|
|
50
|
-
},
|
|
51
|
-
txtLastUpdate: {
|
|
52
|
-
marginLeft: 8,
|
|
53
|
-
lineHeight: 20,
|
|
54
|
-
marginTop: 8,
|
|
55
|
-
},
|
|
56
|
-
});
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import SensorConnectedStatus from '../SensorConnectedStatus';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import renderer, { act } from 'react-test-renderer';
|
|
4
|
-
import { AccessibilityLabel } from '../../../configs/Constants';
|
|
5
|
-
import { SCProvider } from '../../../context';
|
|
6
|
-
import { mockSCStore } from '../../../context/mockStore';
|
|
7
|
-
|
|
8
|
-
const wrapComponent = () => (
|
|
9
|
-
<SCProvider initState={mockSCStore({})}>
|
|
10
|
-
<SensorConnectedStatus />
|
|
11
|
-
</SCProvider>
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
describe('Test Sensor Connected Status', () => {
|
|
15
|
-
let tree;
|
|
16
|
-
|
|
17
|
-
it('render Sensor Connected Status', async () => {
|
|
18
|
-
await act(async () => {
|
|
19
|
-
tree = await renderer.create(wrapComponent());
|
|
20
|
-
});
|
|
21
|
-
const instance = tree.root;
|
|
22
|
-
const item = instance.find(
|
|
23
|
-
(el) =>
|
|
24
|
-
el.props.accessibilityLabel ===
|
|
25
|
-
AccessibilityLabel.SENSOR_CONNECTED_STATUS
|
|
26
|
-
);
|
|
27
|
-
expect(item).not.toBeUndefined();
|
|
28
|
-
});
|
|
29
|
-
});
|