@eohjsc/react-native-smart-city 0.3.30 → 0.3.33

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.
Files changed (411) hide show
  1. package/package.json +7 -5
  2. package/src/Images/DevMode/close.png +0 -0
  3. package/src/Images/DevMode/close@2x.png +0 -0
  4. package/src/Images/DevMode/close@3x.png +0 -0
  5. package/src/Images/DevMode/plus.png +0 -0
  6. package/src/Images/DevMode/plus@2x.png +0 -0
  7. package/src/Images/DevMode/plus@3x.png +0 -0
  8. package/src/Images/DevMode/remove_circle.png +0 -0
  9. package/src/Images/DevMode/remove_circle@2x.png +0 -0
  10. package/src/Images/DevMode/remove_circle@3x.png +0 -0
  11. package/src/commons/Action/ItemQuickAction.js +20 -4
  12. package/src/commons/Action/__test__/ItemQuickAction.test.js +35 -11
  13. package/src/commons/ActionGroup/ColorPickerTemplate.js +36 -17
  14. package/src/commons/ActionGroup/CurtainButtonTemplate.js +6 -6
  15. package/src/commons/ActionGroup/NumberUpDownActionTemplate.js +23 -15
  16. package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/ButtonWrapper.js +5 -2
  17. package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/__test__/index.test.js +10 -4
  18. package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/index.js +4 -4
  19. package/src/commons/ActionGroup/OnOffSmartLock/OnOffSmartLock.js +38 -45
  20. package/src/commons/ActionGroup/OnOffSmartLock/OnOffSmartLockStyle.js +1 -0
  21. package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/ItemPasscode.js +1 -1
  22. package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/__test__/index.test.js +2 -2
  23. package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/index.js +2 -2
  24. package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/ButtonWrapper.js +2 -2
  25. package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/__test__/index.test.js +12 -6
  26. package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/index.js +8 -4
  27. package/src/commons/ActionGroup/OnOffTemplate/OnOffButtonTemplate.js +9 -10
  28. package/src/commons/ActionGroup/OnOffTemplate/index.js +30 -12
  29. package/src/commons/ActionGroup/OneBigButtonTemplate.js +5 -5
  30. package/src/commons/ActionGroup/OptionsDropdownActionTemplate.js +51 -28
  31. package/src/commons/ActionGroup/SliderRangeTemplate.js +2 -2
  32. package/src/commons/ActionGroup/SmartTiviActionTemplate/SmartTiviActionTemplate.js +25 -9
  33. package/src/commons/ActionGroup/SmartTiviActionTemplate/__test__/ControlPlay.test.js +13 -7
  34. package/src/commons/ActionGroup/SmartTiviActionTemplate/__test__/RectangleButton.test.js +9 -5
  35. package/src/commons/ActionGroup/SmartTiviActionTemplate/__test__/SmartTiviActionTemplate.test.js +25 -9
  36. package/src/commons/ActionGroup/SmartTiviActionTemplate/component/CircleButton.js +16 -6
  37. package/src/commons/ActionGroup/SmartTiviActionTemplate/component/ControlPlay.js +10 -4
  38. package/src/commons/ActionGroup/SmartTiviActionTemplate/component/RectangleButton.js +7 -3
  39. package/src/commons/ActionGroup/StatesGridActionTemplate.js +21 -7
  40. package/src/commons/ActionGroup/ThreeButtonTemplate.js +50 -60
  41. package/src/commons/ActionGroup/TwoButtonTemplate/index.js +135 -133
  42. package/src/commons/ActionGroup/__test__/NumberUpDownTemplate.test.js +7 -7
  43. package/src/commons/ActionGroup/__test__/OnOffSmartLock.test.js +3 -3
  44. package/src/commons/ActionGroup/__test__/OnOffTemplate.test.js +3 -3
  45. package/src/commons/ActionGroup/__test__/OptionsDropdownTemplate.test.js +9 -5
  46. package/src/commons/ActionGroup/__test__/index.test.js +7 -5
  47. package/src/commons/ActionGroup/index.js +35 -10
  48. package/src/commons/ActionTemplate/OnOffButtonAction.js +14 -5
  49. package/src/commons/ActionTemplate/__test__/OnOffButtonAction.test.js +23 -2
  50. package/src/commons/ActionTemplate/__test__/index.test.js +2 -0
  51. package/src/commons/ActionTemplate/index.js +1 -0
  52. package/src/commons/AlertAction/index.js +2 -2
  53. package/src/commons/Auth/AccountItem.js +9 -3
  54. package/src/commons/Auth/__test__/AccountItem.test.js +6 -3
  55. package/src/commons/Automate/ItemAutomate.js +22 -3
  56. package/src/commons/BackDefault/index.js +2 -2
  57. package/src/commons/BottomButtonView/index.js +4 -5
  58. package/src/commons/Button/index.js +0 -2
  59. package/src/commons/ButtonPopup/index.js +3 -3
  60. package/src/commons/Dashboard/MyPinnedSharedUnit/__test__/MyPinnedSharedUnit.test.js +3 -2
  61. package/src/commons/Dashboard/MyPinnedSharedUnit/index.js +4 -2
  62. package/src/commons/Dashboard/MyUnit/__test__/MyUnit.test.js +6 -3
  63. package/src/commons/Dashboard/MyUnit/index.js +5 -3
  64. package/src/commons/DevMode/CardDevMode.js +42 -0
  65. package/src/commons/DevMode/EmptyComponent.js +18 -0
  66. package/src/commons/DevMode/Item.js +21 -0
  67. package/src/commons/DevMode/Styles/CardStyles.js +40 -0
  68. package/src/commons/DevMode/Styles/EmptyComponentStyles.js +15 -0
  69. package/src/commons/DevMode/Styles/ItemStyles.js +27 -0
  70. package/src/commons/DevMode/Styles/TextWithLabelStyles.js +36 -0
  71. package/src/commons/DevMode/TextWithLabel.js +30 -0
  72. package/src/commons/DevMode/index.js +5 -1
  73. package/src/commons/Device/ConnectedViewHeader.js +2 -2
  74. package/src/commons/Device/DeviceAlertStatus.js +3 -3
  75. package/src/commons/Device/DisconnectedView.js +2 -2
  76. package/src/commons/Device/Emergency/EmergencyButton.js +2 -2
  77. package/src/commons/Device/Emergency/EmergencyDetail.js +1 -1
  78. package/src/commons/Device/Emergency/__test__/EmergencyButton.test.js +3 -2
  79. package/src/commons/Device/FlatListItems.js +2 -2
  80. package/src/commons/Device/ItemAddNew/index.js +7 -12
  81. package/src/commons/Device/ItemDevice.js +16 -11
  82. package/src/commons/Device/PMSensor/PMSensorIndicatior.js +1 -1
  83. package/src/commons/Device/RainningSensor/CurrentRainSensor.js +1 -1
  84. package/src/commons/Device/SensorConnectedStatus.js +5 -2
  85. package/src/commons/Device/WindDirection/Compass/index.js +6 -3
  86. package/src/commons/Device/WindSpeed/Anemometer/index.js +1 -1
  87. package/src/commons/Device/__test__/DeviceAlertStatus.test.js +8 -4
  88. package/src/commons/Device/__test__/FlatListItems.test.js +3 -2
  89. package/src/commons/Device/__test__/SensorConnectedStatus.test.js +4 -2
  90. package/src/commons/Explore/ActivityIndicator/index.js +5 -2
  91. package/src/commons/Explore/SearchBox/__test__/SearchBox.test.js +3 -3
  92. package/src/commons/Explore/SearchBox/index.js +2 -2
  93. package/src/commons/FieldTemplate/ChooseUserField/ChoosePopup.js +4 -4
  94. package/src/commons/FieldTemplate/ChooseUserField/__test__/index.test.js +11 -8
  95. package/src/commons/FieldTemplate/ChooseUserField/index.js +2 -2
  96. package/src/commons/FieldTemplate/PasscodeField/__test__/index.test.js +3 -2
  97. package/src/commons/FieldTemplate/PasscodeField/index.js +2 -2
  98. package/src/commons/FieldTemplate/ScheduleField/__test__/index.test.js +12 -7
  99. package/src/commons/Form/TextInput.js +2 -2
  100. package/src/commons/Form/TextInputPassword.js +2 -2
  101. package/src/commons/GroupCheckBox/__test__/GroupCheckBox.test.js +5 -3
  102. package/src/commons/GroupCheckBox/index.js +2 -2
  103. package/src/commons/Header/HeaderCustom.js +8 -2
  104. package/src/commons/HeaderAni/index.js +2 -3
  105. package/src/commons/MediaPlayerDetail/index.js +2 -2
  106. package/src/commons/MenuActionList/index.js +2 -2
  107. package/src/commons/MenuActionMore/index.js +5 -4
  108. package/src/commons/NavBar/index.js +2 -3
  109. package/src/commons/OneTapTemplate/NumberUpDownActionTemplate.js +12 -6
  110. package/src/commons/OneTapTemplate/OptionsDropdownActionTemplate.js +7 -3
  111. package/src/commons/OneTapTemplate/StatesGridActionTemplate.js +4 -2
  112. package/src/commons/OneTapTemplate/__test__/NumberUpDownActionTemplate.test.js +11 -8
  113. package/src/commons/OneTapTemplate/__test__/OptionsDropdownActionTemplate.test.js +9 -5
  114. package/src/commons/OneTapTemplate/__test__/StatesGridActionTemplate.test.js +5 -3
  115. package/src/commons/Popover/index.js +2 -13
  116. package/src/commons/PreventAccess/__test__/PreventAccess.test.js +5 -3
  117. package/src/commons/PreventAccess/index.js +3 -3
  118. package/src/commons/{Connecting → Processing}/__test__/Connecting.test.js +5 -4
  119. package/src/commons/Processing/index.js +93 -0
  120. package/src/commons/{Connecting → Processing}/styles.js +9 -1
  121. package/src/commons/SelectGateway/index.js +105 -0
  122. package/src/commons/SelectGateway/styles.js +55 -0
  123. package/src/commons/SelectSubUnit/__test__/SelectSubUnit.test.js +106 -0
  124. package/src/commons/SelectSubUnit/index.js +124 -0
  125. package/src/commons/SelectSubUnit/styles.js +55 -0
  126. package/src/commons/SelectUnit/__test__/SelectUnit.test.js +120 -0
  127. package/src/commons/SelectUnit/index.js +106 -0
  128. package/src/commons/SelectUnit/styles.js +54 -0
  129. package/src/commons/Sharing/WrapHeaderScrollable.js +6 -4
  130. package/src/commons/SubUnit/OneTap/ItemOneTap.js +4 -4
  131. package/src/commons/SubUnit/OneTap/__test__/SubUnitAutomate.test.js +25 -10
  132. package/src/commons/SubUnit/OneTap/index.js +9 -4
  133. package/src/commons/SubUnit/ShortDetail.js +11 -29
  134. package/src/commons/SubUnit/__test__/ShortDetail.test.js +15 -10
  135. package/src/commons/SummaryItem/index.js +2 -2
  136. package/src/commons/Tabbar/__test__/index.test.js +97 -0
  137. package/src/commons/Unit/HeaderUnit/index.js +4 -5
  138. package/src/commons/Unit/SharedUnit.js +10 -8
  139. package/src/commons/Unit/__test__/HeaderUnit.test.js +13 -5
  140. package/src/commons/Unit/__test__/SharedUnit.test.js +30 -11
  141. package/src/commons/UnitSummary/AirQuality/__test__/index.test.js +13 -8
  142. package/src/commons/UnitSummary/AirQuality/index.js +7 -3
  143. package/src/commons/UnitSummary/TotalPowerBox.js +2 -2
  144. package/src/commons/UnitSummary/TotalPowerConsumption/index.js +2 -2
  145. package/src/commons/UnitSummary/__test__/TotalPowerBox.test.js +3 -2
  146. package/src/commons/UnitSummary/__test__/TotalPowerConsumption.test.js +4 -2
  147. package/src/commons/ViewButtonBottom/index.js +4 -4
  148. package/src/commons/WheelDateTimePicker/index.js +5 -3
  149. package/src/commons/WrapParallaxScrollView/index.js +2 -1
  150. package/src/configs/API.js +12 -14
  151. package/src/configs/AccessibilityLabel.js +611 -0
  152. package/src/configs/Colors.js +4 -0
  153. package/src/configs/Constants.js +1 -604
  154. package/src/configs/Images.js +3 -0
  155. package/src/context/actionType.ts +19 -3
  156. package/src/context/mockStore.ts +18 -3
  157. package/src/context/reducer.ts +66 -9
  158. package/src/hoc/__test__/withRemoteControl.test.js +24 -0
  159. package/src/hoc/withRemoteControl.js +1 -0
  160. package/src/hooks/Common/__test__/useAndroidTranslucentStatusBar.test.js +55 -0
  161. package/src/hooks/Common/index.js +2 -2
  162. package/src/hooks/Common/useDevicesStatus.js +19 -15
  163. package/src/hooks/Common/{useGGHomeDeviceConnected.js → useHomeAssistantDeviceConnected.js} +3 -3
  164. package/src/hooks/Common/usePopover.js +6 -1
  165. package/src/hooks/IoT/__test__/{useGGHomeConnection.test.js → useHomeAssistantConnection.test.js} +18 -18
  166. package/src/hooks/IoT/__test__/useRemoteControl.test.js +17 -12
  167. package/src/hooks/IoT/index.js +2 -2
  168. package/src/hooks/IoT/useHomeAssistantConnection.js +91 -0
  169. package/src/hooks/IoT/useRemoteControl.js +6 -6
  170. package/src/hooks/__test__/useInitDeepLink.test.js +28 -0
  171. package/src/hooks/useReceiveNotifications.js +2 -4
  172. package/src/iot/RemoteControl/{GoogleHome.js → HomeAssistant.js} +21 -17
  173. package/src/iot/RemoteControl/LG.js +2 -1
  174. package/src/iot/RemoteControl/__test__/{GoogleHome.test.js → HomeAssistant.test.js} +30 -30
  175. package/src/navigations/AddDeviceStack.js +0 -14
  176. package/src/navigations/AddGatewayStack.js +51 -21
  177. package/src/navigations/Main.js +28 -4
  178. package/src/navigations/SmartIrStack.js +3 -3
  179. package/src/navigations/UnitStack.js +1 -1
  180. package/src/screens/AQIGuide/__test__/AQIGuide.test.js +5 -3
  181. package/src/screens/AQIGuide/index.js +5 -3
  182. package/src/screens/ActivityLog/FilterPopup.js +2 -2
  183. package/src/screens/ActivityLog/__test__/FilterPopup.test.js +2 -2
  184. package/src/screens/ActivityLog/__test__/index.test.js +3 -2
  185. package/src/screens/ActivityLog/index.js +3 -3
  186. package/src/screens/AddCommon/SelectSubUnit.js +44 -191
  187. package/src/screens/AddCommon/SelectUnit.js +51 -204
  188. package/src/screens/AddCommon/__test__/SelectSubUnit.test.js +7 -50
  189. package/src/screens/AddCommon/__test__/SelectUnit.test.js +28 -26
  190. package/src/screens/AddLocationMaps/__test__/index.test.js +13 -7
  191. package/src/screens/AddLocationMaps/index.js +3 -3
  192. package/src/screens/AddNewAction/Device/index.js +2 -2
  193. package/src/screens/AddNewAction/SelectAction.js +16 -7
  194. package/src/screens/AddNewAction/SelectSensorDevices.js +3 -3
  195. package/src/screens/AddNewAction/__test__/SelectAction.test.js +2 -2
  196. package/src/screens/AddNewAction/__test__/SelectSensorDevices.test.js +8 -3
  197. package/src/screens/AddNewAutoSmart/__test__/AddNewAutoSmart.test.js +11 -7
  198. package/src/screens/AddNewAutoSmart/index.js +9 -12
  199. package/src/screens/AddNewDevice/ConnectingDevices.js +1 -1
  200. package/src/screens/AddNewDevice/__test__/AddNewDevice.test.js +7 -4
  201. package/src/screens/AddNewDevice/index.js +4 -4
  202. package/src/screens/AddNewGateway/ConnectingDevice.js +40 -0
  203. package/src/screens/AddNewGateway/ConnectingModbusDevice.js +61 -0
  204. package/src/screens/AddNewGateway/ConnectingWifiDevice.js +70 -0
  205. package/src/screens/AddNewGateway/ConnectingZigbeeDevice.js +60 -0
  206. package/src/screens/AddNewGateway/PlugAndPlay/FirstWarning.js +21 -8
  207. package/src/screens/AddNewGateway/PlugAndPlay/__test__/FirstWarning.test.js +23 -4
  208. package/src/screens/AddNewGateway/RenameNewDevices.js +141 -0
  209. package/src/screens/AddNewGateway/RenameNewDevicesStyles.js +75 -0
  210. package/src/screens/AddNewGateway/ScanGatewayQR.js +57 -0
  211. package/src/screens/AddNewGateway/ScanModbusQR.js +53 -0
  212. package/src/screens/AddNewGateway/ScanWifiDeviceQR.js +55 -0
  213. package/src/screens/AddNewGateway/SelectDeviceSubUnit.js +31 -0
  214. package/src/screens/AddNewGateway/SelectDeviceType.js +52 -0
  215. package/src/screens/AddNewGateway/SelectDeviceUnit.js +29 -0
  216. package/src/screens/AddNewGateway/SelectModbusGateway.js +34 -0
  217. package/src/screens/AddNewGateway/SelectZigbeeGateway.js +34 -0
  218. package/src/screens/AddNewGateway/ShareWifiPassword.js +302 -0
  219. package/src/screens/AddNewGateway/ShareWifiPasswordStyles.js +44 -0
  220. package/src/screens/AddNewGateway/__test__/AddNewGateway.test.js +7 -4
  221. package/src/screens/AddNewGateway/__test__/ConnectingModbusDevice.test.js +63 -0
  222. package/src/screens/AddNewGateway/__test__/{SelectGateway.test.js → ConnectingWifiDevice.test.js} +15 -10
  223. package/src/screens/AddNewGateway/__test__/ConnectingZigbeeDevice.test.js +62 -0
  224. package/src/screens/AddNewGateway/__test__/RenameNewDevices.test.js +191 -0
  225. package/src/screens/AddNewGateway/__test__/ScanGatewayQR.test.js +73 -0
  226. package/src/screens/AddNewGateway/__test__/ScanModbusQR.test.js +75 -0
  227. package/src/screens/AddNewGateway/__test__/ScanWifiDeviceQR.test.js +73 -0
  228. package/src/screens/AddNewGateway/__test__/SelectDeviceSubUnit.test.js +47 -0
  229. package/src/screens/AddNewGateway/__test__/SelectDeviceType.test.js +89 -0
  230. package/src/screens/AddNewGateway/__test__/SelectDeviceUnit.test.js +48 -0
  231. package/src/screens/AddNewGateway/__test__/SelectModbusGateway.test.js +77 -0
  232. package/src/screens/AddNewGateway/__test__/SelectZigbeeGateway.test.js +77 -0
  233. package/src/screens/AddNewGateway/__test__/ShareWifiPassword.test.js +294 -0
  234. package/src/screens/AddNewGateway/hooks/__Tests__/index.test.js +27 -0
  235. package/src/screens/AddNewGateway/index.js +4 -4
  236. package/src/screens/AddNewOneTap/__test__/AddNewOneTap.test.js +5 -4
  237. package/src/screens/AddNewOneTap/index.js +4 -4
  238. package/src/screens/Automate/__test__/index.test.js +2 -2
  239. package/src/screens/Automate/index.js +6 -2
  240. package/src/screens/ConfirmUnitDeletion/__test__/ConfirmUnitDeletion.test.js +3 -2
  241. package/src/screens/ConfirmUnitDeletion/index.js +3 -3
  242. package/src/screens/Device/EditDevice/__test__/EditDevice.test.js +5 -5
  243. package/src/screens/Device/EditDevice/index.js +3 -3
  244. package/src/screens/Device/__test__/detail.test.js +38 -22
  245. package/src/screens/Device/components/DetailHistoryChart.js +7 -5
  246. package/src/screens/Device/components/SensorConnectStatusViewHeader.js +6 -6
  247. package/src/screens/Device/components/SensorDisplayItem.js +51 -26
  248. package/src/screens/Device/detail.js +31 -23
  249. package/src/screens/Device/hooks/useEvaluateValue.js +0 -2
  250. package/src/screens/DeviceInfo/__test__/index.test.js +8 -4
  251. package/src/screens/DeviceInfo/index.js +10 -6
  252. package/src/screens/Drawer/index.js +30 -13
  253. package/src/screens/EmergencyContacts/EmergencyContactsAddNew.js +8 -4
  254. package/src/screens/EmergencyContacts/EmergencyContactsList.js +1 -1
  255. package/src/screens/EmergencyContacts/EmergencyContactsSelectContacts.js +5 -3
  256. package/src/screens/EmergencyContacts/__test__/EmergencyContactAddNew.test.js +9 -5
  257. package/src/screens/EmergencyContacts/__test__/EmergencyContactList.test.js +7 -3
  258. package/src/screens/EmergencyContacts/__test__/EmergencyContactsSelectContacts.test.js +7 -3
  259. package/src/screens/EmergencySetting/__test__/DropDownItem.test.js +3 -2
  260. package/src/screens/EmergencySetting/components/DropDownItem.js +2 -2
  261. package/src/screens/EnterPassword/__test__/EnterPassword.test.js +6 -3
  262. package/src/screens/EnterPassword/index.js +5 -3
  263. package/src/screens/GuestInfo/__test__/index.test.js +18 -12
  264. package/src/screens/GuestInfo/components/AccessScheduleItem.js +2 -2
  265. package/src/screens/GuestInfo/components/AccessScheduleSheet.js +3 -3
  266. package/src/screens/GuestInfo/components/HeaderGuestInfo.js +2 -2
  267. package/src/screens/GuestInfo/components/RecurringDetail.js +4 -4
  268. package/src/screens/GuestInfo/components/TemporaryDetail.js +3 -3
  269. package/src/screens/GuestInfo/index.js +1 -1
  270. package/src/screens/HanetCamera/Detail.js +10 -4
  271. package/src/screens/HanetCamera/ManageAccess.js +4 -4
  272. package/src/screens/HanetCamera/MemberInfo.js +1 -1
  273. package/src/screens/HanetCamera/__test__/Detail.test.js +5 -3
  274. package/src/screens/HanetCamera/__test__/ManageAccess.test.js +10 -4
  275. package/src/screens/HanetCamera/__test__/MemberInfo.test.js +4 -2
  276. package/src/screens/HanetCamera/components/RequestFaceIDPopup.js +2 -2
  277. package/src/screens/ManageAccess/index.js +1 -1
  278. package/src/screens/MoveToAnotherSubUnit/__test__/index.test.js +4 -4
  279. package/src/screens/MoveToAnotherSubUnit/index.js +2 -2
  280. package/src/screens/PlayBackCamera/__test__/index.test.js +9 -6
  281. package/src/screens/PlayBackCamera/index.js +6 -6
  282. package/src/screens/ScanChipQR/components/QRScan/__test__/QRScan.test.js +1 -1
  283. package/src/screens/ScanChipQR/components/QRScan/index.js +10 -3
  284. package/src/screens/ScriptDetail/__test__/index.test.js +43 -38
  285. package/src/screens/ScriptDetail/index.js +26 -16
  286. package/src/screens/SelectUnit/__test__/index.test.js +4 -3
  287. package/src/screens/SelectUnit/index.js +3 -3
  288. package/src/screens/SetSchedule/index.js +1 -1
  289. package/src/screens/Sharing/Components/{SensorItem.js → DeviceItem.js} +16 -22
  290. package/src/screens/Sharing/Components/Styles/{SensorItemStyles.js → DeviceItemStyles.js} +0 -0
  291. package/src/screens/Sharing/Components/__test__/{SensorItem.test.js → DeviceItem.test.js} +10 -8
  292. package/src/screens/Sharing/Components/index.js +2 -2
  293. package/src/screens/Sharing/InfoMemberUnit.js +7 -6
  294. package/src/screens/Sharing/MemberList.js +4 -4
  295. package/src/screens/Sharing/SelectPermission.js +72 -72
  296. package/src/screens/Sharing/SelectUser.js +9 -5
  297. package/src/screens/Sharing/Styles/SelectPermissionStyles.js +2 -2
  298. package/src/screens/Sharing/__test__/InfoMemberUnit.test.js +3 -2
  299. package/src/screens/Sharing/__test__/SelectPermission.test.js +12 -12
  300. package/src/screens/Sharing/__test__/SelectUser.test.js +7 -4
  301. package/src/screens/SideMenuDetail/__test__/index.test.js +11 -7
  302. package/src/screens/SideMenuDetail/index.js +2 -2
  303. package/src/screens/SmartIr/__test__/GroupButtonByType.test.js +4 -2
  304. package/src/screens/SmartIr/__test__/SelectDeviceType.test.js +5 -5
  305. package/src/screens/SmartIr/__test__/SmartIr.test.js +14 -6
  306. package/src/screens/SmartIr/components/GroupButtonByType/GroupButtonByType.js +4 -2
  307. package/src/screens/SmartIr/components/{SelectDeviceType.js → SelectIrDeviceType.js} +2 -2
  308. package/src/screens/SmartIr/index.js +1 -1
  309. package/src/screens/SubUnit/AddSubUnit.js +7 -3
  310. package/src/screens/SubUnit/Detail.js +6 -6
  311. package/src/screens/SubUnit/EditSubUnit.js +10 -6
  312. package/src/screens/SubUnit/ManageSubUnit.js +2 -2
  313. package/src/screens/SubUnit/__test__/AddSubUnit.test.js +6 -3
  314. package/src/screens/SubUnit/__test__/Detail.test.js +5 -3
  315. package/src/screens/SubUnit/__test__/EditSubUnit.test.js +9 -5
  316. package/src/screens/SubUnit/__test__/ManageSubUnit.test.js +3 -2
  317. package/src/screens/SyncLGDevice/AddLGDevice.js +4 -4
  318. package/src/screens/SyncLGDevice/__test__/AddLGDevice.test.js +7 -4
  319. package/src/screens/TDSGuide/__test__/TDSGuide.test.js +4 -2
  320. package/src/screens/TDSGuide/index.js +2 -2
  321. package/src/screens/Template/EditTemplate.js +152 -0
  322. package/src/screens/Template/GatewayList.js +51 -0
  323. package/src/screens/Template/Information.js +41 -0
  324. package/src/screens/Template/Styles/EditTemplateStyle.js +109 -0
  325. package/src/screens/Template/Styles/GatewayStyles.js +46 -0
  326. package/src/screens/Template/Styles/InformationStyles.js +16 -0
  327. package/src/screens/Template/Styles/detailStyles.js +35 -0
  328. package/src/screens/Template/Styles/indexStyles.js +2 -33
  329. package/src/screens/Template/__test__/EditTemplate.test.js +89 -0
  330. package/src/screens/Template/__test__/GatewayList.test.js +26 -0
  331. package/src/screens/Template/__test__/Information.test.js +16 -0
  332. package/src/screens/Template/__test__/detail.test.js +68 -0
  333. package/src/screens/Template/__test__/index.test.js +26 -1
  334. package/src/screens/Template/detail.js +154 -0
  335. package/src/screens/Template/index.js +38 -32
  336. package/src/screens/UVIndexGuide/__test__/UVIndexGuide.test.js +3 -2
  337. package/src/screens/UVIndexGuide/index.js +2 -2
  338. package/src/screens/Unit/AddMenu.js +6 -20
  339. package/src/screens/Unit/ChooseLocation.js +1 -1
  340. package/src/screens/Unit/Detail.js +10 -10
  341. package/src/screens/Unit/ManageUnit.js +21 -15
  342. package/src/screens/Unit/MyAllUnit/index.js +1 -1
  343. package/src/screens/Unit/SelectAddToFavorites.js +7 -8
  344. package/src/screens/Unit/SelectAddress.js +4 -4
  345. package/src/screens/Unit/SmartAccount.js +1 -1
  346. package/src/screens/Unit/SmartAccountItem.js +3 -3
  347. package/src/screens/Unit/Station/__test__/index.test.js +19 -3
  348. package/src/screens/Unit/Station/index.js +2 -2
  349. package/src/screens/Unit/Summaries.js +2 -2
  350. package/src/screens/Unit/__test__/CheckSendEmail.test.js +6 -6
  351. package/src/screens/Unit/__test__/Detail.test.js +90 -55
  352. package/src/screens/Unit/__test__/ManageUnit.test.js +40 -18
  353. package/src/screens/Unit/__test__/SelectAddress.test.js +15 -8
  354. package/src/screens/Unit/__test__/SmartAccount.test.js +42 -25
  355. package/src/screens/Unit/__test__/SmartAccountItem.test.js +4 -3
  356. package/src/screens/Unit/components/AutomateScript/index.js +5 -2
  357. package/src/screens/Unit/components/ListMyAllUnit/index.js +1 -1
  358. package/src/screens/Unit/components/MyAllUnit/__test__/Header.test.js +9 -5
  359. package/src/screens/Unit/components/MyAllUnit/index.js +1 -1
  360. package/src/screens/Unit/components/MyUnitDevice/index.js +8 -5
  361. package/src/screens/Unit/components/SharedUnit/index.js +12 -6
  362. package/src/screens/Unit/components/__test__/MyUnitDevice.test.js +2 -2
  363. package/src/screens/Unit/components/__test__/SharedUnit.test.js +24 -9
  364. package/src/screens/Unit/hook/useUnitConnectRemoteDevices.js +25 -11
  365. package/src/screens/UnitSummary/__test__/index.test.js +4 -2
  366. package/src/screens/UnitSummary/components/3PPowerConsumption/__test__/3PPowerConsumption.test.js +4 -2
  367. package/src/screens/UnitSummary/components/3PPowerConsumption/index.js +2 -2
  368. package/src/screens/UnitSummary/components/PowerConsumption/__test__/PowerConsumption.test.js +4 -2
  369. package/src/screens/UnitSummary/components/PowerConsumption/index.js +2 -2
  370. package/src/screens/UnitSummary/components/RunningDevices/__test__/index.test.js +5 -4
  371. package/src/screens/UnitSummary/components/RunningDevices/index.js +6 -3
  372. package/src/screens/UnitSummary/components/TotalPowerBox/index.js +2 -2
  373. package/src/screens/UnitSummary/components/TotalPowerConsumption/index.js +2 -2
  374. package/src/screens/UnitSummary/components/__test__/TotalPowerBox.test.js +3 -2
  375. package/src/screens/UnitSummary/components/__test__/TotalPowerConsumption.test.js +4 -2
  376. package/src/screens/UnitSummary/index.js +10 -8
  377. package/src/screens/WaterQualityGuide/__test__/index.test.js +17 -12
  378. package/src/screens/WaterQualityGuide/index.js +26 -10
  379. package/src/utils/Apis/axios.js +1 -0
  380. package/src/utils/I18n/translations/en.json +20 -10
  381. package/src/utils/I18n/translations/vi.json +17 -9
  382. package/src/utils/Route/index.js +22 -10
  383. package/src/utils/Utils.js +6 -7
  384. package/src/commons/Connecting/index.js +0 -67
  385. package/src/commons/ConnectingProcess/DeviceItem/DeviceItem.js +0 -28
  386. package/src/commons/ConnectingProcess/DeviceItem/DeviceItemStyles.js +0 -41
  387. package/src/commons/ConnectingProcess/__test__/Connecting.test.js +0 -163
  388. package/src/commons/ConnectingProcess/__test__/DeviceItem.test.js +0 -19
  389. package/src/commons/ConnectingProcess/index.js +0 -213
  390. package/src/commons/ConnectingProcess/styles.js +0 -69
  391. package/src/hooks/IoT/useGGHomeConnection.js +0 -91
  392. package/src/iot/RemoteControl/index.js +0 -55
  393. package/src/screens/AddNewDevice/ConnectDevices.js +0 -184
  394. package/src/screens/AddNewDevice/__test__/ConnectDevices.test.js +0 -131
  395. package/src/screens/AddNewGateway/ConnectedGateway.js +0 -139
  396. package/src/screens/AddNewGateway/ConnectingGateway.js +0 -137
  397. package/src/screens/AddNewGateway/PlugAndPlay/ConnectWifiWarning.js +0 -214
  398. package/src/screens/AddNewGateway/PlugAndPlay/GatewayWifiList.js +0 -319
  399. package/src/screens/AddNewGateway/PlugAndPlay/__test__/ConnectWifiWarning.test.js +0 -75
  400. package/src/screens/AddNewGateway/PlugAndPlay/__test__/GatewayWifiList.test.js +0 -130
  401. package/src/screens/AddNewGateway/SelectGateway.js +0 -133
  402. package/src/screens/AddNewGateway/SetupGatewayWifi.js +0 -207
  403. package/src/screens/AddNewGateway/__test__/ConnectedGateway.test.js +0 -71
  404. package/src/screens/AddNewGateway/__test__/ConnectingGateway.test.js +0 -96
  405. package/src/screens/AddNewGateway/__test__/SetupGateway.test.js +0 -120
  406. package/src/screens/ScanChipQR/__test__/ScanChipQR.test.js +0 -115
  407. package/src/screens/ScanChipQR/hooks/index.js +0 -120
  408. package/src/screens/ScanChipQR/index.js +0 -29
  409. package/src/screens/ScanSensorQR/__test__/ScanSensorQR.test.js +0 -111
  410. package/src/screens/ScanSensorQR/hooks/index.js +0 -40
  411. package/src/screens/ScanSensorQR/index.js +0 -39
@@ -5,12 +5,12 @@ import { useTranslations } from '../../hooks/Common/useTranslations';
5
5
  import Text from '../../commons/Text';
6
6
  import { Colors, Theme } from '../../configs';
7
7
  import useTitleHeader from '../../hooks/Common/useTitleHeader';
8
- import { TESTID } from '../../configs/Constants';
8
+ import { AccessibilityLabel } from '../../configs/Constants';
9
9
  import { useSCContextSelector } from '../../context';
10
10
 
11
11
  const WaterQualityGuide = memo(({ route }) => {
12
12
  const t = useTranslations();
13
- const { waterType } = route.params;
13
+ const { waterType } = route?.params || {};
14
14
  const language = useSCContextSelector((state) => state.language);
15
15
 
16
16
  const cloGuide = useMemo(
@@ -277,7 +277,9 @@ const WaterQualityGuide = memo(({ route }) => {
277
277
  return (
278
278
  <View key={index.toString()}>
279
279
  <Text
280
- testID={TESTID.WATER_QUALITY_GUIDE_TITLE}
280
+ accessibilityLabel={
281
+ AccessibilityLabel.WATER_QUALITY_GUIDE_TITLE
282
+ }
281
283
  semibold
282
284
  size={20}
283
285
  color={Colors.Gray9}
@@ -286,7 +288,9 @@ const WaterQualityGuide = memo(({ route }) => {
286
288
  {title}
287
289
  </Text>
288
290
  <Text
289
- testID={TESTID.WATER_QUALITY_GUIDE_DESCRIPTION}
291
+ accessibilityLabel={
292
+ AccessibilityLabel.WATER_QUALITY_GUIDE_DESCRIPTION
293
+ }
290
294
  size={14}
291
295
  color={Colors.Gray8}
292
296
  style={styles.des}
@@ -309,7 +313,9 @@ const WaterQualityGuide = memo(({ route }) => {
309
313
  <View style={styles.contentBox}>
310
314
  <Text
311
315
  type="H4"
312
- testID={TESTID.WATER_QUALITY_GUIDE_TITLE_LEVEL}
316
+ accessibilityLabel={
317
+ AccessibilityLabel.WATER_QUALITY_GUIDE_TITLE_LEVEL
318
+ }
313
319
  semibold
314
320
  size={16}
315
321
  color={color}
@@ -317,7 +323,9 @@ const WaterQualityGuide = memo(({ route }) => {
317
323
  {title}
318
324
  </Text>
319
325
  <Text
320
- testID={TESTID.WATER_QUALITY_GUIDE_DESCRIPTION_LEVEL}
326
+ accessibilityLabel={
327
+ AccessibilityLabel.WATER_QUALITY_GUIDE_DESCRIPTION_LEVEL
328
+ }
321
329
  type="Body"
322
330
  color={Colors.Gray8}
323
331
  style={styles.lineHeight}
@@ -333,7 +341,9 @@ const WaterQualityGuide = memo(({ route }) => {
333
341
  return (
334
342
  <View key={index.toString()} style={styles.wrapEachTitle1}>
335
343
  <Text
336
- testID={TESTID.WATER_QUALITY_GUIDE_TITLE1}
344
+ accessibilityLabel={
345
+ AccessibilityLabel.WATER_QUALITY_GUIDE_TITLE1
346
+ }
337
347
  semibold
338
348
  size={20}
339
349
  color={Colors.Gray9}
@@ -342,7 +352,9 @@ const WaterQualityGuide = memo(({ route }) => {
342
352
  {title}
343
353
  </Text>
344
354
  <Text
345
- testID={TESTID.WATER_QUALITY_GUIDE_DESCRIPTION1}
355
+ accessibilityLabel={
356
+ AccessibilityLabel.WATER_QUALITY_GUIDE_DESCRIPTION1
357
+ }
346
358
  size={14}
347
359
  color={Colors.Gray8}
348
360
  style={styles.des}
@@ -358,7 +370,9 @@ const WaterQualityGuide = memo(({ route }) => {
358
370
  <View style={styles.containerLevel1} key={index.toString()}>
359
371
  <View style={styles.level1WrapTitle}>
360
372
  <Text
361
- testID={TESTID.WATER_QUALITY_GUIDE_TITLE_LEVEL1}
373
+ accessibilityLabel={
374
+ AccessibilityLabel.WATER_QUALITY_GUIDE_TITLE_LEVEL1
375
+ }
362
376
  style={styles.level1Title}
363
377
  >
364
378
  {title}
@@ -370,7 +384,9 @@ const WaterQualityGuide = memo(({ route }) => {
370
384
  </View>
371
385
  <View>
372
386
  <Text
373
- testID={TESTID.WATER_QUALITY_GUIDE_DESCRIPTION_LEVEL1}
387
+ accessibilityLabel={
388
+ AccessibilityLabel.WATER_QUALITY_GUIDE_DESCRIPTION_LEVEL1
389
+ }
374
390
  style={{
375
391
  ...styles.level1PhType,
376
392
  color: desColor ?? Colors.Black,
@@ -165,6 +165,7 @@ async function axiosCall(method, ...args) {
165
165
  success: false,
166
166
  resp_status: response.status,
167
167
  data,
168
+ problem,
168
169
  };
169
170
  }
170
171
 
@@ -155,7 +155,7 @@
155
155
  "ok": "OK",
156
156
  "Status": "Status: ",
157
157
  "connected": "Connected",
158
- "ggHomeConnected": "Google Home is connected",
158
+ "home_assistant_connected": "Home Assistant is connected",
159
159
  "don_t_have_an_account": "Don't have an account?",
160
160
  "please_enter_your_phone_number": "Please enter your phone number",
161
161
  "please_enter_your_password": "Please enter your password",
@@ -279,8 +279,8 @@
279
279
  "text_select_sub_unit": "Select sub unit",
280
280
  "text_select_a_gateway": "Select a gateway",
281
281
  "text_select_a_unit_desc": "Select a unit you want to add new members",
282
- "select_a_sub_unit_want_add_device": "Then, select a sub-unit that you want to add this device in",
283
- "text_select_a_unit_have_device": "First, select a unit that has this device",
282
+ "select_a_sub_unit_want_add_device": "Select a sub-unit that you want to add this device in",
283
+ "text_select_a_unit_have_device": "Select a unit that has this device",
284
284
  "text_select_permissions": "Select permissions",
285
285
  "text_select_permissions_desc": "Select permissions will be grant",
286
286
  "text_read_config": "Read configs",
@@ -371,7 +371,7 @@
371
371
  "check_the_wifi": "Check the Wi-Fi/Cellular signal or try to reset it.",
372
372
  "check_the_ble": "Check your Bluetooth status and try to use QUICK ACTION to control.",
373
373
  "disconnected": "Disconnected",
374
- "ggHomeDisconnected": "Google Home is disconnected",
374
+ "home_assistant_disconnected": "Home Assistant is disconnected",
375
375
  "rename_sub_unit": "Rename sub-unit",
376
376
  "select_image": "Select image",
377
377
  "text_rename_sub_unit_success": "Rename sub-unit success",
@@ -615,7 +615,7 @@
615
615
  "notify_no_car_parked": "No car parked at this spot at this moment. Please check your current position again and enter a right spot number.",
616
616
  "notify_spot_has_been_booked": "This spot has been booked before",
617
617
  "notify_spot_not_exist": "This spot does not exist. Please try enter again",
618
- "then_select_a_sub_unit_to_add": "Then, select a sub-unit that you want to add this device in",
618
+ "then_select_a_sub_unit_to_add": "Select a sub-unit that you want to add this device in",
619
619
  "first_select_a_unit": "First, select a unit that has this device",
620
620
  "alert_will_be_sent_in": "Alert will be sent in:",
621
621
  "alert_has_been_stopped": "You have stop your alert success",
@@ -693,10 +693,10 @@
693
693
  "this_spot_does_not_support_to_scan": "This spot does not support to scan",
694
694
  "please_book_by_the_normal_way": "Please book by the normal way",
695
695
  "qr_code_invalid": "This QR code is invalid",
696
- "command_send_success_googlehome": "Command is sent to device via google home",
697
- "command_send_fail_googlehome": "Command is fail to send via google home",
698
- "command_googlehome_ready": "Google Home is connected",
699
- "command_googlehome_lost": "Google Home is disconnection. Reconnecting...",
696
+ "command_send_success_homeassistant": "Command is sent to device via Home Assistant",
697
+ "command_send_fail_homeassistant": "Command is fail to send via Home Assistant",
698
+ "command_homeassistant_ready": "Home Assistant is connected",
699
+ "command_homeassistant_lost": "Home Assistant is disconnection. Reconnecting...",
700
700
  "confirm": "Confirm",
701
701
  "car_validate_warning": "Please enter a right format of your license plate number \nEx:%{example}",
702
702
  "are_you_sure_this_resolved": "Are you sure this emergency situation has been resolved? All members in this unit will be notified.",
@@ -997,5 +997,15 @@
997
997
  "developer_mode": "Developer Mode",
998
998
  "what_are_you_looking_for": "What are you looking for?",
999
999
  "no_template_yet": "No Template yet",
1000
- "add_your_template": "Add your template at web app"
1000
+ "add_your_template": "Add your template at web app",
1001
+ "edit_template": "Edit template",
1002
+ "information": "Information",
1003
+ "gateway_list": "Gateway list",
1004
+ "delete_template": "Delete template",
1005
+ "template_name": "Template name",
1006
+ "add_widget": "Add widget",
1007
+ "no_widgets": "No Widgets",
1008
+ "add_your_widget": "Add your widget in dashboard template",
1009
+ "label": "Label",
1010
+ "hold_and_hover_description": "Hold and hover to rearrange the module"
1001
1011
  }
@@ -206,7 +206,7 @@
206
206
  "ok": "OK",
207
207
  "Status": "Trạng thái: ",
208
208
  "connected": "Đã kết nối",
209
- "ggHomeConnected": "Google Home đã kết nối",
209
+ "home_assistant_connected": "Home Assistant đã kết nối",
210
210
  "don_t_have_an_account": "Bạn chưa có tài khoản?",
211
211
  "please_enter_your_phone_number": "Vui lòng nhập số điện thoại",
212
212
  "please_enter_your_password": "Vui lòng nhập mật khẩu",
@@ -314,8 +314,8 @@
314
314
  "text_select_sub_unit": "Chọn đơn vị",
315
315
  "text_select_a_gateway": "Chọn một gateway",
316
316
  "text_select_a_unit_desc": "Chọn 1 địa điểm bạn muốn thêm thành viên",
317
- "text_select_a_unit_have_device": "Đầu tiên, chọn một địa điểm có thiết bị này",
318
- "select_a_sub_unit_want_add_device": "Sau đó, chọn một đơn vị con mà bạn muốn thêm thiết bị này vào",
317
+ "text_select_a_unit_have_device": "Chọn một địa điểm có thiết bị này",
318
+ "select_a_sub_unit_want_add_device": "Chọn một đơn vị con mà bạn muốn thêm thiết bị này vào",
319
319
  "text_select_permissions": "Chọn hành động",
320
320
  "text_select_permissions_desc": "Chọn các hành động cho phép",
321
321
  "text_read_config": "Thông số đọc",
@@ -419,7 +419,7 @@
419
419
  "check_the_wifi": "Kiểm tra lại Wi-Fi/tín hiệu di động hoặc thử khởi động lại.",
420
420
  "check_the_ble": "Kiểm tra trạng thái Bluetooth của bạn và thử sử dụng HÀNH ĐỘNG NHANH để điều khiển",
421
421
  "disconnected": "Ngắt kết nối",
422
- "ggHomeDisconnected": "Google Home bị ngắt kết nối",
422
+ "home_assistant_disconnected": "Home Assistant bị ngắt kết nối",
423
423
  "rename_sub_unit": "Đổi tên khu vực",
424
424
  "select_image": "Chọn ảnh",
425
425
  "text_rename_sub_unit_success": "Đổi tên khu vực thành công",
@@ -708,10 +708,10 @@
708
708
  "this_spot_does_not_support_to_scan": "Vị trí đỗ này không hỗ trợ quét",
709
709
  "please_book_by_the_normal_way": "Vui lòng đặt trước bằng cách thông thường",
710
710
  "qr_code_invalid": "Mã QR này không hợp lệ",
711
- "command_send_success_googlehome": "Lệnh gởi thành công đến google home",
712
- "command_send_fail_googlehome": "Lệnh gởi thất bại đến google home",
713
- "command_googlehome_ready": "Google Home kết nối thành công",
714
- "command_googlehome_lost": "Google Home bị mất kết nối. Đang kết nối lại...",
711
+ "command_send_success_homeassistant": "Lệnh gởi thành công đến Home Assistant",
712
+ "command_send_fail_homeassistant": "Lệnh gởi thất bại đến Home Assistant",
713
+ "command_homeassistant_ready": "Home Assistant kết nối thành công",
714
+ "command_homeassistant_lost": "Home Assistant bị mất kết nối. Đang kết nối lại...",
715
715
  "confirm": "Xác nhận",
716
716
  "car_validate_warning": "Vui lòng nhập đúng định dạng biển số xe \nVD: %{example}",
717
717
  "are_you_sure_this_resolved": "Bạn có chắc tình huống khẩn cấp này đã được xử lý xong? Các thành viên thuộc địa điểm này cũng sẽ nhận được thông báo.",
@@ -996,5 +996,13 @@
996
996
  "developer_mode": "Chế độ nhà phát triển",
997
997
  "what_are_you_looking_for": "Bạn đang tìm kiếm cái gì?",
998
998
  "no_template_yet": "Chưa có mẫu nào",
999
- "add_your_template": "Thêm mẫu của bạn trên web"
999
+ "add_your_template": "Thêm mẫu của bạn trên web",
1000
+ "edit_template": "Chỉnh sửa mẫu",
1001
+ "information": "Thông tin",
1002
+ "gateway_list": "Danh sách cổng vào",
1003
+ "delete_template": "Xóa mẫu",
1004
+ "add_widget": "Thêm tiện ích con",
1005
+ "add_your_widget": "Thêm tiện ích của bạn vào mẫu trang tổng quan",
1006
+ "label": "Nhãn",
1007
+ "hold_and_hover_description": "Giữ và di chuột để sắp xếp lại mô-đun"
1000
1008
  }
@@ -43,9 +43,7 @@ const Routes = {
43
43
  AQIGuide: 'AQIGuide',
44
44
  AddNewDevice: 'AddNewDevice',
45
45
  AddNewGateway: 'AddNewGateway',
46
- SetupGatewayWifi: 'SetupGatewayWifi',
47
46
  ConnectingDevices: 'ConnectingDevices',
48
- ConnectingGateway: 'ConnectingGateway',
49
47
  ManageUnit: 'ManageUnit',
50
48
  SelectAddress: 'SelectAddress',
51
49
  ChooseLocation: 'ChooseLocation',
@@ -55,14 +53,26 @@ const Routes = {
55
53
  UnitDetail: 'UnitDetail',
56
54
  DrawerMain: 'DrawerMain',
57
55
  ConnectDevices: 'ConnectDevices',
58
- ConnectedGateway: 'ConnectedGateway',
59
56
  SharedStack: 'SharedStack',
60
57
  DashboardStack: 'DashboardStack',
61
58
  AddSubUnit: 'AddSubUnit',
62
59
  AddCommonSelectUnit: 'AddCommonSelectUnit',
63
60
  AddCommonSelectSubUnit: 'AddCommonSelectSubUnit',
64
- AddGatewaySelectGateway: 'AddGatewaySelectGateway',
65
- ConnectingProcess: 'ConnectingProcess',
61
+
62
+ SelectDeviceUnit: 'SelectDeviceUnit',
63
+ SelectDeviceSubUnit: 'SelectDeviceSubUnit',
64
+ SelectDeviceType: 'SelectDeviceType',
65
+ SelectModbusGateway: 'SelectModbusGateway',
66
+ SelectZigbeeGateway: 'SelectZigbeeGateway',
67
+ ConnectingZigbeeDevice: 'ConnectingZigbeeDevice',
68
+ ScanModbusQR: 'ScanModbusQR',
69
+ ConnectingModbusDevice: 'ConnectingModbusDevice',
70
+ ScanWifiDeviceQR: 'ScanWifiDeviceQR',
71
+ ScanGatewayQR: 'ScanGatewayQR',
72
+ ConnectingWifiDevice: 'ConnectingWifiDevice',
73
+ ShareWifiPassword: 'ShareWifiPassword',
74
+ RenameNewDevices: 'RenameNewDevices',
75
+
66
76
  UnitMemberList: 'UnitMemberList',
67
77
  SharingSelectPermission: 'SharingSelectPermission',
68
78
  SharingInviteMembers: 'SharingInviteMembers',
@@ -70,8 +80,6 @@ const Routes = {
70
80
  WindSpeed: 'WindSpeed',
71
81
  WaterQualitySensor: 'WaterQualitySensor',
72
82
  AddLocationMaps: 'AddLocationMaps',
73
- ScanSensorQR: 'ScanSensorQR',
74
- ScanChipQR: 'ScanChipQR',
75
83
  ParkingAreaDetail: 'ParkingAreaDetail',
76
84
  SavedVehicle: 'SavedVehicle',
77
85
  MapDashboard: 'MapDashboard',
@@ -130,14 +138,12 @@ const Routes = {
130
138
  SmartAccountConnecting: 'SmartAccountConnecting',
131
139
  EmergencySetting: 'EmergencySetting',
132
140
  FirstWarning: 'FirstWarning',
133
- ConnectWifiWarning: 'ConnectWifiWarning',
134
- GatewayWifiList: 'GatewayWifiList',
135
141
  ConfirmUnitDeletion: 'ConfirmUnitDeletion',
136
142
  SmartAccount: 'SmartAccount',
137
143
  SmartHomeDashboard: 'SmartHomeDashboard',
138
144
  SetupGeneratePasscode: 'SetupGeneratePasscode',
139
145
  SideMenuDetail: 'SideMenuDetail',
140
- SelectDeviceType: 'SelectDeviceType',
146
+ SelectIrDeviceType: 'SelectIrDeviceType',
141
147
  SelectBrand: 'SelectBrand',
142
148
  GroupButtonByType: 'GroupButtonByType',
143
149
  AutoLock: 'AutoLock',
@@ -148,11 +154,17 @@ const Routes = {
148
154
  EnterPassword: 'EnterPassword',
149
155
  SelectAddToFavorites: 'SelectAddToFavorites',
150
156
  Template: 'Template',
157
+ TemplateDetail: 'TemplateDetail',
151
158
  Gateway: 'Gateway',
152
159
  Smart: 'Smart',
153
160
  TemplateStack: 'TemplateStack',
154
161
  GatewayStack: 'GatewayStack',
155
162
  SmartStack: 'SmartStack',
163
+ MainDevMode: 'MainDevMode',
164
+ DrawerScreen: 'DrawerScreen',
165
+ Information: 'Information',
166
+ GatewayList: 'GatewayList',
167
+ EditTemplate: 'EditTemplate',
156
168
  };
157
169
 
158
170
  export default Routes;
@@ -110,24 +110,23 @@ export const removeFromString = (str, index) => {
110
110
 
111
111
  export const object_Ids = (data) => {
112
112
  let stationIds = [];
113
- let sensorIds = [];
113
+ let deviceIds = [];
114
114
  let actionIds = [];
115
115
  let configIds = [];
116
116
  data?.forEach((station) => {
117
117
  stationIds.push(station?.id);
118
118
  //Todo change devices When production release end_devices
119
- station?.sensors?.forEach((sensor) => {
120
- sensorIds.push(sensor?.id);
121
- sensor?.actions?.forEach((action) => {
119
+ station?.devices?.forEach((device) => {
120
+ deviceIds.push(device?.id);
121
+ device?.actions?.forEach((action) => {
122
122
  actionIds.push(action?.id);
123
123
  });
124
- sensor?.read_configs?.forEach((config) => {
124
+ device?.read_configs?.forEach((config) => {
125
125
  configIds.push(config?.id);
126
126
  });
127
127
  });
128
128
  });
129
- const listObject = { stationIds, sensorIds, actionIds, configIds } || {};
130
- return listObject;
129
+ return { stationIds, deviceIds, actionIds, configIds } || {};
131
130
  };
132
131
 
133
132
  export const notImplemented = (t) => {
@@ -1,67 +0,0 @@
1
- import React, { useEffect, useCallback, useState } from 'react';
2
- import { View } from 'react-native';
3
- import * as Progress from 'react-native-progress';
4
- import Text from '../Text';
5
- import { Colors, Constants } from '../../configs';
6
- import styles from './styles';
7
- import { useTranslations } from '../../hooks/Common/useTranslations';
8
- import { HeaderCustom } from '../Header';
9
-
10
- const Connecting = ({ isLoading, isConnect, isPercentConnect }) => {
11
- const t = useTranslations();
12
- const [percent, setPercent] = useState(0);
13
-
14
- useEffect(() => {
15
- processLoading();
16
- }, [processLoading]);
17
-
18
- const processLoading = useCallback(() => {
19
- let interval;
20
- if (isLoading) {
21
- interval = setInterval(() => {
22
- setPercent((prev) => {
23
- if (prev === 1) {
24
- clearInterval(interval);
25
- return 1;
26
- } else if (prev === 0.8 && isConnect) {
27
- clearInterval(interval);
28
- return 0.8;
29
- } else {
30
- return prev + 0.2;
31
- }
32
- });
33
- }, 180);
34
- } else {
35
- clearInterval(interval);
36
- }
37
- }, [isConnect, isLoading]);
38
- return (
39
- <View style={styles.screen}>
40
- <HeaderCustom title={t('connect_device')} isShowSeparator />
41
- <View style={styles.body}>
42
- <View style={styles.connecting}>
43
- <Text type="H4" bold>
44
- {t('connecting')}
45
- </Text>
46
- </View>
47
- <View style={styles.percentLoad}>
48
- <Progress.Bar
49
- progress={isPercentConnect || percent}
50
- animated={true}
51
- color={Colors.Primary}
52
- indeterminateAnimationDuration={1000}
53
- height={7}
54
- width={Constants.width - 80}
55
- useNativeDriver={true}
56
- />
57
- <Text style={styles.textPercentLoad}>{`${parseInt(
58
- (isPercentConnect || percent) * 100,
59
- 10
60
- )}%`}</Text>
61
- </View>
62
- </View>
63
- </View>
64
- );
65
- };
66
-
67
- export default Connecting;
@@ -1,28 +0,0 @@
1
- import React, { memo } from 'react';
2
- import { View } from 'react-native';
3
- import styles from './DeviceItemStyles';
4
- import FImage from '../../FImage';
5
- import _TextInput from '../../Form/TextInput';
6
- import Images from '../../../configs/Images';
7
-
8
- const DeviceItem = memo(
9
- ({ icon, name, setNewName, handleSelectionChange, isSelection }) => {
10
- return (
11
- <View style={styles.container}>
12
- <FImage
13
- source={icon ? { uri: icon } : Images.deviceIcon}
14
- style={styles.iconSensor}
15
- />
16
- <_TextInput
17
- value={name}
18
- textInputStyle={styles.textItem}
19
- onChange={setNewName}
20
- selection={isSelection && { start: 0, end: 0 }}
21
- onSelectionChange={handleSelectionChange}
22
- />
23
- </View>
24
- );
25
- }
26
- );
27
-
28
- export default DeviceItem;
@@ -1,41 +0,0 @@
1
- import { StyleSheet } from 'react-native';
2
- import { Colors } from '../../../configs';
3
-
4
- export default StyleSheet.create({
5
- container: {
6
- borderRadius: 10,
7
- width: 250,
8
- borderWidth: 1,
9
- borderColor: Colors.Gray4,
10
- backgroundColor: Colors.White,
11
- justifyContent: 'center',
12
- flexDirection: 'row',
13
- shadowColor: Colors.Shadow,
14
- shadowOffset: {
15
- width: 0,
16
- height: 2,
17
- },
18
- shadowOpacity: 0.1,
19
- shadowRadius: 3,
20
- elevation: 6,
21
- paddingLeft: 30,
22
- paddingRight: 30,
23
- display: 'flex',
24
- alignItems: 'center',
25
- },
26
- iconSensor: {
27
- width: 32,
28
- height: 32,
29
- resizeMode: 'contain',
30
- },
31
- textItem: {
32
- borderWidth: 0,
33
- borderBottomWidth: 1,
34
- borderBottomColor: Colors.Primary,
35
- textAlign: 'center',
36
- marginTop: -10,
37
- padding: 5,
38
- fontSize: 16,
39
- height: 50,
40
- },
41
- });
@@ -1,163 +0,0 @@
1
- import React from 'react';
2
- import renderer, { act } from 'react-test-renderer';
3
- import MockAdapter from 'axios-mock-adapter';
4
-
5
- import ConnectingProcess from '../index';
6
- import { SafeAreaView } from 'react-native';
7
- import { SCProvider } from '../../../context';
8
- import { mockSCStore } from '../../../context/mockStore';
9
- import api from '../../../utils/Apis/axios';
10
- import { API } from '../../../configs';
11
-
12
- const wrapComponent = (route) => (
13
- <SCProvider initState={mockSCStore({})}>
14
- <ConnectingProcess route={route} />
15
- </SCProvider>
16
- );
17
-
18
- const mock = new MockAdapter(api.axiosInstance);
19
-
20
- describe('Test ConnectingProcess', () => {
21
- let tree;
22
-
23
- test('render without params', () => {
24
- act(() => {
25
- tree = renderer.create(wrapComponent({}));
26
- });
27
- const instance = tree.root;
28
- const safeAreaView = instance.findAllByType(SafeAreaView);
29
- expect(safeAreaView).toHaveLength(1);
30
- });
31
-
32
- test('create ConnectingProcess with devicePrefixName = SENSOR call api success', async () => {
33
- const scan_sensor_data = { imei: 'SENSOR-afasdfas' };
34
- const devicePrefixName = 'SENSOR';
35
- const gateway = { id: 1, name: 'gateway' };
36
- const station = { id: 1, icon_kit: 'a', name: 'station' };
37
- const route = {
38
- params: { scan_sensor_data, gateway, station, devicePrefixName },
39
- };
40
- mock.onPost(API.SUB_UNIT.SENSOR_SCAN(1)).reply(200);
41
- await act(async () => {
42
- tree = await renderer.create(wrapComponent(route));
43
- });
44
- const instance = tree.root;
45
- const safeAreaView = instance.findAllByType(SafeAreaView);
46
- expect(safeAreaView).toHaveLength(1);
47
- });
48
-
49
- test('create ConnectingProcess with devicePrefixName = SENSOR call api fail', async () => {
50
- const scan_sensor_data = { imei: 'SENSOR-afasdfas' };
51
- const devicePrefixName = 'SENSOR';
52
- const gateway = { id: 1, name: 'gateway' };
53
- const station = { id: 1, icon_kit: 'a', name: 'station' };
54
- const route = {
55
- params: { scan_sensor_data, gateway, station, devicePrefixName },
56
- };
57
- mock.onPost(API.SUB_UNIT.SENSOR_SCAN(1)).reply(400);
58
- await act(async () => {
59
- tree = await renderer.create(wrapComponent(route));
60
- });
61
- const instance = tree.root;
62
- const safeAreaView = instance.findAllByType(SafeAreaView);
63
- expect(safeAreaView).toHaveLength(1);
64
- });
65
-
66
- test('create ConnectingProcess with devicePrefixName = ROBOT call api success', async () => {
67
- const scan_sensor_data = { imei: 'SENSOR-afasdfas' };
68
- const devicePrefixName = 'ROBOT';
69
- const gateway = { id: 1, name: 'gateway' };
70
- const station = { id: 1, icon_kit: 'a', name: 'station' };
71
- const route = {
72
- params: {
73
- scan_sensor_data,
74
- gateway,
75
- station,
76
- devicePrefixName,
77
- unit_id: 1,
78
- unit: {
79
- id: 1,
80
- },
81
- },
82
- };
83
- mock.onPost(API.UNIT.CHIP_SCAN(1)).reply(200);
84
- await act(async () => {
85
- tree = await renderer.create(wrapComponent(route));
86
- });
87
- const instance = tree.root;
88
- const safeAreaView = instance.findAllByType(SafeAreaView);
89
- expect(safeAreaView).toHaveLength(1);
90
- });
91
-
92
- test('create ConnectingProcess with devicePrefixName = ROBOT call api fail', async () => {
93
- const scan_sensor_data = { imei: 'SENSOR-afasdfas' };
94
- const devicePrefixName = 'ROBOT';
95
- const gateway = { id: 1, name: 'gateway' };
96
- const station = { id: 1, icon_kit: 'a', name: 'station' };
97
- const route = {
98
- params: {
99
- scan_sensor_data,
100
- gateway,
101
- station,
102
- devicePrefixName,
103
- unit_id: 1,
104
- unit: {
105
- id: 1,
106
- },
107
- },
108
- };
109
- mock.onPost(API.UNIT.CHIP_SCAN(1)).reply(400);
110
- await act(async () => {
111
- tree = await renderer.create(wrapComponent(route));
112
- });
113
- const instance = tree.root;
114
- const safeAreaView = instance.findAllByType(SafeAreaView);
115
- expect(safeAreaView).toHaveLength(1);
116
- });
117
-
118
- test('create ConnectingProcess with devicePrefixName = LITE call api success', async () => {
119
- const scan_sensor_data = { imei: 'SENSOR-afasdfas' };
120
- const devicePrefixName = 'LITE';
121
- const gateway = { id: 1, name: 'gateway' };
122
- const station = { id: 1, icon_kit: 'a', name: 'station' };
123
- const route = {
124
- params: {
125
- scan_sensor_data,
126
- gateway,
127
- station,
128
- devicePrefixName,
129
- unit_id: 1,
130
- },
131
- };
132
- mock.onPost(API.UNIT.ADD_GATEWAY(1)).reply(200);
133
- await act(async () => {
134
- tree = await renderer.create(wrapComponent(route));
135
- });
136
- const instance = tree.root;
137
- const safeAreaView = instance.findAllByType(SafeAreaView);
138
- expect(safeAreaView).toHaveLength(1);
139
- });
140
-
141
- test('create ConnectingProcess with devicePrefixName = LITE call api fail', async () => {
142
- const scan_sensor_data = { imei: 'SENSOR-afasdfas' };
143
- const devicePrefixName = 'LITE';
144
- const gateway = { id: 1, name: 'gateway' };
145
- const station = { id: 1, icon_kit: 'a', name: 'station' };
146
- const route = {
147
- params: {
148
- scan_sensor_data,
149
- gateway,
150
- station,
151
- devicePrefixName,
152
- unit_id: 1,
153
- },
154
- };
155
- mock.onPost(API.UNIT.ADD_GATEWAY(1)).reply(400);
156
- await act(async () => {
157
- tree = await renderer.create(wrapComponent(route));
158
- });
159
- const instance = tree.root;
160
- const safeAreaView = instance.findAllByType(SafeAreaView);
161
- expect(safeAreaView).toHaveLength(1);
162
- });
163
- });
@@ -1,19 +0,0 @@
1
- import React from 'react';
2
- import renderer, { act } from 'react-test-renderer';
3
- import DeviceItem from '../DeviceItem/DeviceItem';
4
- import FImage from '../../FImage';
5
- import _TextInput from '../../Form/TextInput';
6
-
7
- describe('Test DeviceItem button', () => {
8
- let tree;
9
- test('create DeviceItem button', () => {
10
- act(() => {
11
- tree = renderer.create(<DeviceItem />);
12
- });
13
- const instance = tree.root;
14
- const image = instance.findAllByType(FImage);
15
- const text = instance.findAllByType(_TextInput);
16
- expect(image).toHaveLength(1);
17
- expect(text).toHaveLength(1);
18
- });
19
- });