@eohjsc/react-native-smart-city 0.3.31 → 0.3.34

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/assets/images/AddNewDevice/add-gateway-icon.svg +13 -0
  2. package/assets/images/AddNewDevice/add-modbus-device-icon.svg +8 -0
  3. package/assets/images/AddNewDevice/add-wifi-device-icon.svg +4 -0
  4. package/assets/images/AddNewDevice/add-zigbee-device-icon.svg +4 -0
  5. package/assets/images/AddNewDevice/interact-smartphone-icon.svg +14 -0
  6. package/index.js +2 -0
  7. package/package.json +8 -5
  8. package/src/Images/SmartAccount/DienQuang.png +0 -0
  9. package/src/Images/SmartAccount/DienQuang@2x.png +0 -0
  10. package/src/Images/SmartAccount/DienQuang@3x.png +0 -0
  11. package/src/Images/SmartAccount/LG.png +0 -0
  12. package/src/Images/SmartAccount/LG@2x.png +0 -0
  13. package/src/Images/SmartAccount/LG@3x.png +0 -0
  14. package/src/Images/SmartAccount/Samsung.png +0 -0
  15. package/src/Images/SmartAccount/Samsung@2x.png +0 -0
  16. package/src/Images/SmartAccount/Samsung@3x.png +0 -0
  17. package/src/commons/Action/ItemQuickAction.js +20 -4
  18. package/src/commons/Action/__test__/ItemQuickAction.test.js +35 -11
  19. package/src/commons/ActionGroup/CurtainButtonTemplate.js +6 -6
  20. package/src/commons/ActionGroup/NumberUpDownActionTemplate.js +9 -6
  21. package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/ButtonWrapper.js +5 -2
  22. package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/__test__/index.test.js +10 -4
  23. package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/index.js +4 -4
  24. package/src/commons/ActionGroup/OnOffSmartLock/OnOffSmartLock.js +2 -2
  25. package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/ItemPasscode.js +1 -1
  26. package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/__test__/index.test.js +2 -2
  27. package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/index.js +2 -2
  28. package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/ButtonWrapper.js +2 -2
  29. package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/__test__/index.test.js +12 -6
  30. package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/index.js +8 -4
  31. package/src/commons/ActionGroup/OnOffTemplate/OnOffButtonTemplate.js +4 -6
  32. package/src/commons/ActionGroup/OnOffTemplate/index.js +28 -10
  33. package/src/commons/ActionGroup/OneBigButtonTemplate.js +1 -1
  34. package/src/commons/ActionGroup/OptionsDropdownActionTemplate.js +25 -12
  35. package/src/commons/ActionGroup/SmartTiviActionTemplate/SmartTiviActionTemplate.js +25 -9
  36. package/src/commons/ActionGroup/SmartTiviActionTemplate/__test__/ControlPlay.test.js +13 -7
  37. package/src/commons/ActionGroup/SmartTiviActionTemplate/__test__/RectangleButton.test.js +9 -5
  38. package/src/commons/ActionGroup/SmartTiviActionTemplate/__test__/SmartTiviActionTemplate.test.js +25 -9
  39. package/src/commons/ActionGroup/SmartTiviActionTemplate/component/CircleButton.js +16 -6
  40. package/src/commons/ActionGroup/SmartTiviActionTemplate/component/ControlPlay.js +10 -4
  41. package/src/commons/ActionGroup/SmartTiviActionTemplate/component/RectangleButton.js +7 -3
  42. package/src/commons/ActionGroup/StatesGridActionTemplate.js +21 -7
  43. package/src/commons/ActionGroup/ThreeButtonTemplate.js +5 -5
  44. package/src/commons/ActionGroup/TwoButtonTemplate/index.js +4 -4
  45. package/src/commons/ActionGroup/__test__/NumberUpDownTemplate.test.js +7 -7
  46. package/src/commons/ActionGroup/__test__/OnOffSmartLock.test.js +3 -3
  47. package/src/commons/ActionGroup/__test__/OnOffTemplate.test.js +3 -3
  48. package/src/commons/ActionGroup/__test__/OptionsDropdownTemplate.test.js +9 -5
  49. package/src/commons/ActionGroup/__test__/index.test.js +5 -3
  50. package/src/commons/ActionTemplate/OnOffButtonAction.js +14 -5
  51. package/src/commons/ActionTemplate/__test__/OnOffButtonAction.test.js +23 -2
  52. package/src/commons/ActionTemplate/__test__/index.test.js +2 -0
  53. package/src/commons/ActionTemplate/index.js +1 -0
  54. package/src/commons/AlertAction/index.js +2 -2
  55. package/src/commons/Auth/AccountItem.js +9 -3
  56. package/src/commons/Auth/__test__/AccountItem.test.js +6 -3
  57. package/src/commons/Automate/ItemAutomate.js +22 -3
  58. package/src/commons/BackDefault/index.js +2 -2
  59. package/src/commons/BottomButtonView/index.js +4 -5
  60. package/src/commons/Button/index.js +0 -2
  61. package/src/commons/ButtonPopup/index.js +3 -3
  62. package/src/commons/Dashboard/MyPinnedSharedUnit/__test__/MyPinnedSharedUnit.test.js +3 -2
  63. package/src/commons/Dashboard/MyPinnedSharedUnit/index.js +4 -2
  64. package/src/commons/Dashboard/MyUnit/__test__/MyUnit.test.js +6 -3
  65. package/src/commons/Dashboard/MyUnit/index.js +5 -3
  66. package/src/commons/Device/ConnectedViewHeader.js +2 -2
  67. package/src/commons/Device/DeviceAlertStatus.js +2 -2
  68. package/src/commons/Device/DisconnectedView.js +2 -2
  69. package/src/commons/Device/Emergency/EmergencyButton.js +2 -2
  70. package/src/commons/Device/Emergency/__test__/EmergencyButton.test.js +3 -2
  71. package/src/commons/Device/FlatListItems.js +2 -2
  72. package/src/commons/Device/ItemAddNew/index.js +7 -12
  73. package/src/commons/Device/ItemDevice.js +16 -11
  74. package/src/commons/Device/SensorConnectedStatus.js +5 -2
  75. package/src/commons/Device/WindDirection/Compass/index.js +5 -2
  76. package/src/commons/Device/__test__/DeviceAlertStatus.test.js +8 -4
  77. package/src/commons/Device/__test__/FlatListItems.test.js +3 -2
  78. package/src/commons/Device/__test__/SensorConnectedStatus.test.js +4 -2
  79. package/src/commons/Explore/ActivityIndicator/index.js +5 -2
  80. package/src/commons/Explore/SearchBox/__test__/SearchBox.test.js +3 -3
  81. package/src/commons/Explore/SearchBox/index.js +2 -2
  82. package/src/commons/FieldTemplate/ChooseUserField/ChoosePopup.js +4 -4
  83. package/src/commons/FieldTemplate/ChooseUserField/__test__/index.test.js +11 -8
  84. package/src/commons/FieldTemplate/ChooseUserField/index.js +2 -2
  85. package/src/commons/FieldTemplate/PasscodeField/__test__/index.test.js +3 -2
  86. package/src/commons/FieldTemplate/PasscodeField/index.js +2 -2
  87. package/src/commons/FieldTemplate/ScheduleField/__test__/index.test.js +12 -7
  88. package/src/commons/Form/TextInput.js +2 -2
  89. package/src/commons/Form/TextInputPassword.js +2 -2
  90. package/src/commons/GroupCheckBox/__test__/GroupCheckBox.test.js +5 -3
  91. package/src/commons/GroupCheckBox/index.js +2 -2
  92. package/src/commons/HeaderAni/index.js +2 -3
  93. package/src/commons/MediaPlayerDetail/index.js +2 -2
  94. package/src/commons/MenuActionList/index.js +2 -2
  95. package/src/commons/MenuActionMore/index.js +2 -3
  96. package/src/commons/NavBar/index.js +2 -3
  97. package/src/commons/OneTapTemplate/NumberUpDownActionTemplate.js +12 -6
  98. package/src/commons/OneTapTemplate/OptionsDropdownActionTemplate.js +7 -3
  99. package/src/commons/OneTapTemplate/StatesGridActionTemplate.js +4 -2
  100. package/src/commons/OneTapTemplate/__test__/NumberUpDownActionTemplate.test.js +11 -8
  101. package/src/commons/OneTapTemplate/__test__/OptionsDropdownActionTemplate.test.js +9 -5
  102. package/src/commons/OneTapTemplate/__test__/StatesGridActionTemplate.test.js +5 -3
  103. package/src/commons/Popover/index.js +2 -13
  104. package/src/commons/PreventAccess/__test__/PreventAccess.test.js +5 -3
  105. package/src/commons/PreventAccess/index.js +3 -3
  106. package/src/commons/{Connecting → Processing}/__test__/Connecting.test.js +5 -4
  107. package/src/commons/Processing/index.js +93 -0
  108. package/src/commons/{Connecting → Processing}/styles.js +9 -1
  109. package/src/commons/SelectGateway/index.js +105 -0
  110. package/src/commons/SelectGateway/styles.js +55 -0
  111. package/src/commons/SelectSubUnit/__test__/SelectSubUnit.test.js +106 -0
  112. package/src/commons/SelectSubUnit/index.js +124 -0
  113. package/src/commons/SelectSubUnit/styles.js +52 -0
  114. package/src/commons/SelectUnit/__test__/SelectUnit.test.js +120 -0
  115. package/src/commons/SelectUnit/index.js +105 -0
  116. package/src/commons/SelectUnit/styles.js +53 -0
  117. package/src/commons/Sharing/WrapHeaderScrollable.js +2 -2
  118. package/src/commons/SubUnit/OneTap/ItemOneTap.js +4 -4
  119. package/src/commons/SubUnit/OneTap/__test__/SubUnitAutomate.test.js +25 -10
  120. package/src/commons/SubUnit/OneTap/index.js +9 -4
  121. package/src/commons/SubUnit/ShortDetail.js +11 -29
  122. package/src/commons/SubUnit/__test__/ShortDetail.test.js +15 -10
  123. package/src/commons/SummaryItem/index.js +2 -2
  124. package/src/commons/Tabbar/__test__/index.test.js +97 -0
  125. package/src/commons/Unit/HeaderUnit/index.js +4 -5
  126. package/src/commons/Unit/SharedUnit.js +10 -8
  127. package/src/commons/Unit/__test__/HeaderUnit.test.js +13 -5
  128. package/src/commons/Unit/__test__/SharedUnit.test.js +30 -11
  129. package/src/commons/UnitSummary/AirQuality/__test__/index.test.js +13 -8
  130. package/src/commons/UnitSummary/AirQuality/index.js +7 -3
  131. package/src/commons/UnitSummary/TotalPowerBox.js +2 -2
  132. package/src/commons/UnitSummary/TotalPowerConsumption/index.js +2 -2
  133. package/src/commons/UnitSummary/__test__/TotalPowerBox.test.js +3 -2
  134. package/src/commons/UnitSummary/__test__/TotalPowerConsumption.test.js +4 -2
  135. package/src/commons/ViewButtonBottom/index.js +4 -4
  136. package/src/commons/WheelDateTimePicker/index.js +5 -3
  137. package/src/commons/WrapParallaxScrollView/index.js +2 -1
  138. package/src/configs/API.js +16 -14
  139. package/src/configs/AccessibilityLabel.js +629 -0
  140. package/src/configs/Constants.js +1 -604
  141. package/src/configs/Images.js +2 -0
  142. package/src/context/actionType.ts +10 -3
  143. package/src/context/mockStore.ts +6 -3
  144. package/src/context/reducer.ts +45 -8
  145. package/src/hoc/__test__/withRemoteControl.test.js +24 -0
  146. package/src/hoc/withRemoteControl.js +1 -0
  147. package/src/hooks/Common/__test__/useAndroidTranslucentStatusBar.test.js +55 -0
  148. package/src/hooks/Common/index.js +2 -2
  149. package/src/hooks/Common/useDevicesStatus.js +19 -15
  150. package/src/hooks/Common/{useGGHomeDeviceConnected.js → useHomeAssistantDeviceConnected.js} +3 -3
  151. package/src/hooks/Common/usePopover.js +6 -1
  152. package/src/hooks/IoT/__test__/{useGGHomeConnection.test.js → useHomeAssistantConnection.test.js} +18 -18
  153. package/src/hooks/IoT/__test__/useRemoteControl.test.js +17 -12
  154. package/src/hooks/IoT/index.js +2 -2
  155. package/src/hooks/IoT/useHomeAssistantConnection.js +91 -0
  156. package/src/hooks/IoT/useRemoteControl.js +6 -6
  157. package/src/hooks/__test__/useInitDeepLink.test.js +28 -0
  158. package/src/hooks/useReceiveNotifications.js +2 -4
  159. package/src/iot/RemoteControl/{GoogleHome.js → HomeAssistant.js} +21 -17
  160. package/src/iot/RemoteControl/LG.js +2 -1
  161. package/src/iot/RemoteControl/__test__/{GoogleHome.test.js → HomeAssistant.test.js} +30 -30
  162. package/src/navigations/AddDeviceStack.js +0 -14
  163. package/src/navigations/AddGatewayStack.js +56 -21
  164. package/src/navigations/Main.js +2 -2
  165. package/src/navigations/SmartAccountStack.js +52 -0
  166. package/src/navigations/SmartIrStack.js +3 -3
  167. package/src/navigations/UnitStack.js +1 -1
  168. package/src/screens/AQIGuide/__test__/AQIGuide.test.js +5 -3
  169. package/src/screens/AQIGuide/index.js +5 -3
  170. package/src/screens/ActivityLog/FilterPopup.js +2 -2
  171. package/src/screens/ActivityLog/__test__/FilterPopup.test.js +2 -2
  172. package/src/screens/ActivityLog/__test__/index.test.js +3 -2
  173. package/src/screens/ActivityLog/index.js +3 -3
  174. package/src/screens/AddCommon/SelectSubUnit.js +49 -192
  175. package/src/screens/AddCommon/SelectUnit.js +58 -204
  176. package/src/screens/AddCommon/__test__/SelectSubUnit.test.js +25 -61
  177. package/src/screens/AddCommon/__test__/SelectUnit.test.js +41 -32
  178. package/src/screens/AddLocationMaps/__test__/index.test.js +13 -7
  179. package/src/screens/AddLocationMaps/index.js +3 -3
  180. package/src/screens/AddNewAction/Device/index.js +2 -2
  181. package/src/screens/AddNewAction/SelectAction.js +16 -7
  182. package/src/screens/AddNewAction/SelectSensorDevices.js +3 -3
  183. package/src/screens/AddNewAction/__test__/SelectAction.test.js +2 -2
  184. package/src/screens/AddNewAction/__test__/SelectSensorDevices.test.js +8 -3
  185. package/src/screens/AddNewAutoSmart/__test__/AddNewAutoSmart.test.js +11 -7
  186. package/src/screens/AddNewAutoSmart/index.js +9 -12
  187. package/src/screens/AddNewDevice/ConnectingDevices.js +1 -1
  188. package/src/screens/AddNewDevice/__test__/AddNewDevice.test.js +7 -4
  189. package/src/screens/AddNewDevice/index.js +4 -4
  190. package/src/screens/AddNewGateway/ConnectingDevice.js +40 -0
  191. package/src/screens/AddNewGateway/ConnectingModbusDevice.js +61 -0
  192. package/src/screens/AddNewGateway/ConnectingWifiDevice.js +70 -0
  193. package/src/screens/AddNewGateway/ConnectingWifiGuide.js +167 -0
  194. package/src/screens/AddNewGateway/ConnectingWifiGuideStyles.js +58 -0
  195. package/src/screens/AddNewGateway/ConnectingZigbeeDevice.js +60 -0
  196. package/src/screens/AddNewGateway/PlugAndPlay/FirstWarning.js +16 -8
  197. package/src/screens/AddNewGateway/PlugAndPlay/__test__/FirstWarning.test.js +23 -4
  198. package/src/screens/AddNewGateway/RenameNewDevices.js +141 -0
  199. package/src/screens/AddNewGateway/RenameNewDevicesStyles.js +75 -0
  200. package/src/screens/AddNewGateway/ScanGatewayQR.js +80 -0
  201. package/src/screens/AddNewGateway/ScanModbusQR.js +53 -0
  202. package/src/screens/AddNewGateway/ScanWifiDeviceQR.js +55 -0
  203. package/src/screens/AddNewGateway/SelectDeviceSubUnit.js +31 -0
  204. package/src/screens/AddNewGateway/SelectDeviceType.js +147 -0
  205. package/src/screens/AddNewGateway/SelectDeviceTypeStyles.js +51 -0
  206. package/src/screens/AddNewGateway/SelectDeviceUnit.js +29 -0
  207. package/src/screens/AddNewGateway/SelectModbusGateway.js +34 -0
  208. package/src/screens/AddNewGateway/SelectZigbeeGateway.js +34 -0
  209. package/src/screens/AddNewGateway/ShareWifiPassword.js +198 -0
  210. package/src/screens/AddNewGateway/ShareWifiPasswordStyles.js +44 -0
  211. package/src/screens/AddNewGateway/__test__/AddNewGateway.test.js +7 -4
  212. package/src/screens/AddNewGateway/__test__/ConnectingModbusDevice.test.js +63 -0
  213. package/src/screens/AddNewGateway/__test__/{SelectGateway.test.js → ConnectingWifiDevice.test.js} +15 -10
  214. package/src/screens/AddNewGateway/__test__/ConnectingWifiGuide.test.js +224 -0
  215. package/src/screens/AddNewGateway/__test__/ConnectingZigbeeDevice.test.js +62 -0
  216. package/src/screens/AddNewGateway/__test__/RenameNewDevices.test.js +191 -0
  217. package/src/screens/AddNewGateway/__test__/ScanGatewayQR.test.js +72 -0
  218. package/src/screens/AddNewGateway/__test__/ScanModbusQR.test.js +75 -0
  219. package/src/screens/AddNewGateway/__test__/ScanWifiDeviceQR.test.js +73 -0
  220. package/src/screens/AddNewGateway/__test__/SelectDeviceSubUnit.test.js +47 -0
  221. package/src/screens/AddNewGateway/__test__/SelectDeviceType.test.js +124 -0
  222. package/src/screens/AddNewGateway/__test__/SelectDeviceUnit.test.js +48 -0
  223. package/src/screens/AddNewGateway/__test__/SelectModbusGateway.test.js +77 -0
  224. package/src/screens/AddNewGateway/__test__/SelectZigbeeGateway.test.js +77 -0
  225. package/src/screens/AddNewGateway/__test__/ShareWifiPassword.test.js +155 -0
  226. package/src/screens/AddNewGateway/hooks/__Tests__/index.test.js +1 -1
  227. package/src/screens/AddNewGateway/index.js +4 -4
  228. package/src/screens/AddNewOneTap/__test__/AddNewOneTap.test.js +5 -4
  229. package/src/screens/AddNewOneTap/index.js +4 -4
  230. package/src/screens/Automate/__test__/index.test.js +2 -2
  231. package/src/screens/Automate/index.js +6 -2
  232. package/src/screens/ConfirmUnitDeletion/__test__/ConfirmUnitDeletion.test.js +3 -2
  233. package/src/screens/ConfirmUnitDeletion/index.js +3 -3
  234. package/src/screens/Device/EditDevice/__test__/EditDevice.test.js +5 -5
  235. package/src/screens/Device/EditDevice/index.js +3 -3
  236. package/src/screens/Device/__test__/detail.test.js +38 -22
  237. package/src/screens/Device/components/SensorConnectStatusViewHeader.js +6 -6
  238. package/src/screens/Device/components/SensorDisplayItem.js +2 -2
  239. package/src/screens/Device/detail.js +28 -22
  240. package/src/screens/Device/hooks/useEvaluateValue.js +0 -2
  241. package/src/screens/DeviceInfo/__test__/index.test.js +8 -4
  242. package/src/screens/DeviceInfo/index.js +10 -6
  243. package/src/screens/Drawer/index.js +21 -9
  244. package/src/screens/EditActionsList/__tests__/index.test.js +120 -0
  245. package/src/screens/EditActionsList/index.js +15 -5
  246. package/src/screens/EmergencyContacts/EmergencyContactsAddNew.js +8 -4
  247. package/src/screens/EmergencyContacts/EmergencyContactsList.js +1 -1
  248. package/src/screens/EmergencyContacts/EmergencyContactsSelectContacts.js +5 -3
  249. package/src/screens/EmergencyContacts/__test__/EmergencyContactAddNew.test.js +9 -5
  250. package/src/screens/EmergencyContacts/__test__/EmergencyContactList.test.js +7 -3
  251. package/src/screens/EmergencyContacts/__test__/EmergencyContactsSelectContacts.test.js +7 -3
  252. package/src/screens/EmergencySetting/__test__/DropDownItem.test.js +3 -2
  253. package/src/screens/EmergencySetting/components/DropDownItem.js +2 -2
  254. package/src/screens/EnterPassword/__test__/EnterPassword.test.js +6 -3
  255. package/src/screens/EnterPassword/index.js +5 -3
  256. package/src/screens/GuestInfo/__test__/index.test.js +18 -12
  257. package/src/screens/GuestInfo/components/AccessScheduleItem.js +2 -2
  258. package/src/screens/GuestInfo/components/AccessScheduleSheet.js +3 -3
  259. package/src/screens/GuestInfo/components/HeaderGuestInfo.js +2 -2
  260. package/src/screens/GuestInfo/components/RecurringDetail.js +4 -4
  261. package/src/screens/GuestInfo/components/TemporaryDetail.js +3 -3
  262. package/src/screens/GuestInfo/index.js +1 -1
  263. package/src/screens/HanetCamera/Detail.js +10 -4
  264. package/src/screens/HanetCamera/ManageAccess.js +4 -4
  265. package/src/screens/HanetCamera/MemberInfo.js +1 -1
  266. package/src/screens/HanetCamera/__test__/Detail.test.js +5 -3
  267. package/src/screens/HanetCamera/__test__/ManageAccess.test.js +10 -4
  268. package/src/screens/HanetCamera/__test__/MemberInfo.test.js +4 -2
  269. package/src/screens/HanetCamera/components/RequestFaceIDPopup.js +2 -2
  270. package/src/screens/ManageAccess/index.js +1 -1
  271. package/src/screens/MoveToAnotherSubUnit/__test__/index.test.js +4 -4
  272. package/src/screens/MoveToAnotherSubUnit/index.js +2 -2
  273. package/src/screens/PlayBackCamera/__test__/index.test.js +9 -6
  274. package/src/screens/PlayBackCamera/index.js +6 -6
  275. package/src/screens/ScanChipQR/components/QRScan/__test__/QRScan.test.js +1 -1
  276. package/src/screens/ScanChipQR/components/QRScan/index.js +10 -3
  277. package/src/screens/ScriptDetail/__test__/index.test.js +43 -38
  278. package/src/screens/ScriptDetail/index.js +26 -16
  279. package/src/screens/SelectUnit/__test__/index.test.js +4 -3
  280. package/src/screens/SelectUnit/index.js +3 -3
  281. package/src/screens/SetSchedule/index.js +1 -1
  282. package/src/screens/SharedUnit/__test__/ShareUnit.test.js +25 -0
  283. package/src/screens/SharedUnit/index.js +2 -0
  284. package/src/screens/Sharing/Components/{SensorItem.js → DeviceItem.js} +40 -30
  285. package/src/screens/Sharing/Components/Styles/{SensorItemStyles.js → DeviceItemStyles.js} +0 -0
  286. package/src/screens/Sharing/Components/__test__/{SensorItem.test.js → DeviceItem.test.js} +10 -8
  287. package/src/screens/Sharing/Components/index.js +2 -2
  288. package/src/screens/Sharing/InfoMemberUnit.js +7 -6
  289. package/src/screens/Sharing/MemberList.js +4 -4
  290. package/src/screens/Sharing/SelectPermission.js +139 -123
  291. package/src/screens/Sharing/SelectUser.js +9 -5
  292. package/src/screens/Sharing/Styles/SelectPermissionStyles.js +2 -2
  293. package/src/screens/Sharing/__test__/InfoMemberUnit.test.js +3 -2
  294. package/src/screens/Sharing/__test__/SelectPermission.test.js +67 -14
  295. package/src/screens/Sharing/__test__/SelectUser.test.js +7 -4
  296. package/src/screens/SideMenuDetail/__test__/index.test.js +11 -7
  297. package/src/screens/SideMenuDetail/index.js +2 -2
  298. package/src/screens/SmartAccount/Connecting/index.js +171 -0
  299. package/src/{commons/ConnectingProcess/styles.js → screens/SmartAccount/Connecting/style.js} +3 -22
  300. package/src/screens/SmartAccount/ListDevice/DeviceItem.js +45 -0
  301. package/src/screens/SmartAccount/ListDevice/__test__/DeviceItem.test.js +34 -0
  302. package/src/screens/SmartAccount/ListDevice/__test__/ListDevice.test.js +139 -0
  303. package/src/screens/SmartAccount/ListDevice/index.js +186 -0
  304. package/src/screens/SmartAccount/ListDevice/styles/DeviceItemStyles.js +70 -0
  305. package/src/screens/SmartAccount/ListDevice/styles/index.js +85 -0
  306. package/src/screens/SmartAccount/SuccessfullyConnected/DeviceItem.js +37 -0
  307. package/src/{commons/ConnectingProcess/DeviceItem → screens/SmartAccount/SuccessfullyConnected}/DeviceItemStyles.js +13 -5
  308. package/src/screens/SmartAccount/SuccessfullyConnected/__test__/DeviceItem.test.js +65 -0
  309. package/src/screens/SmartAccount/SuccessfullyConnected/__test__/SuccessfullyConnected.test.js +88 -0
  310. package/src/screens/SmartAccount/SuccessfullyConnected/index.js +101 -0
  311. package/src/screens/SmartAccount/SuccessfullyConnected/styles.js +42 -0
  312. package/src/screens/SmartAccount/__test__/Connecting.test.js +86 -0
  313. package/src/screens/SmartAccount/__test__/SmartAccount.test.js +249 -0
  314. package/src/screens/SmartAccount/index.js +172 -0
  315. package/src/screens/SmartAccount/style.js +70 -0
  316. package/src/screens/SmartIr/__test__/GroupButtonByType.test.js +4 -2
  317. package/src/screens/SmartIr/__test__/SelectDeviceType.test.js +5 -5
  318. package/src/screens/SmartIr/__test__/SmartIr.test.js +14 -6
  319. package/src/screens/SmartIr/components/GroupButtonByType/GroupButtonByType.js +4 -2
  320. package/src/screens/SmartIr/components/{SelectDeviceType.js → SelectIrDeviceType.js} +2 -2
  321. package/src/screens/SmartIr/index.js +1 -1
  322. package/src/screens/SubUnit/AddSubUnit.js +7 -3
  323. package/src/screens/SubUnit/Detail.js +6 -6
  324. package/src/screens/SubUnit/EditSubUnit.js +10 -6
  325. package/src/screens/SubUnit/ManageSubUnit.js +2 -2
  326. package/src/screens/SubUnit/__test__/AddSubUnit.test.js +6 -3
  327. package/src/screens/SubUnit/__test__/Detail.test.js +5 -3
  328. package/src/screens/SubUnit/__test__/EditSubUnit.test.js +9 -5
  329. package/src/screens/SubUnit/__test__/ManageSubUnit.test.js +3 -2
  330. package/src/screens/SyncLGDevice/AddLGDevice.js +4 -4
  331. package/src/screens/SyncLGDevice/__test__/AddLGDevice.test.js +44 -14
  332. package/src/screens/TDSGuide/__test__/TDSGuide.test.js +4 -2
  333. package/src/screens/TDSGuide/index.js +2 -2
  334. package/src/screens/Template/EditTemplate.js +2 -1
  335. package/src/screens/Template/__test__/detail.test.js +9 -1
  336. package/src/screens/Template/index.js +0 -1
  337. package/src/screens/UVIndexGuide/__test__/UVIndexGuide.test.js +3 -2
  338. package/src/screens/UVIndexGuide/index.js +2 -2
  339. package/src/screens/Unit/AddMenu.js +10 -25
  340. package/src/screens/Unit/ChooseLocation.js +1 -1
  341. package/src/screens/Unit/Detail.js +10 -10
  342. package/src/screens/Unit/ManageUnit.js +21 -15
  343. package/src/screens/Unit/MyAllUnit/index.js +1 -1
  344. package/src/screens/Unit/SelectAddToFavorites.js +7 -8
  345. package/src/screens/Unit/SelectAddress.js +4 -4
  346. package/src/screens/Unit/SmartAccount.js +8 -5
  347. package/src/screens/Unit/SmartAccountItem.js +3 -3
  348. package/src/screens/Unit/Station/__test__/index.test.js +1 -1
  349. package/src/screens/Unit/Station/index.js +2 -2
  350. package/src/screens/Unit/Summaries.js +2 -2
  351. package/src/screens/Unit/__test__/CheckSendEmail.test.js +6 -6
  352. package/src/screens/Unit/__test__/Detail.test.js +17 -12
  353. package/src/screens/Unit/__test__/ManageUnit.test.js +40 -18
  354. package/src/screens/Unit/__test__/SelectAddress.test.js +15 -8
  355. package/src/screens/Unit/__test__/SmartAccount.test.js +8 -5
  356. package/src/screens/Unit/__test__/SmartAccountItem.test.js +4 -3
  357. package/src/screens/Unit/components/AutomateScript/index.js +5 -2
  358. package/src/screens/Unit/components/ListMyAllUnit/index.js +1 -1
  359. package/src/screens/Unit/components/MyAllUnit/__test__/Header.test.js +9 -5
  360. package/src/screens/Unit/components/MyAllUnit/index.js +1 -1
  361. package/src/screens/Unit/components/MyUnitDevice/index.js +8 -5
  362. package/src/screens/Unit/components/SharedUnit/index.js +12 -6
  363. package/src/screens/Unit/components/__test__/MyUnitDevice.test.js +2 -2
  364. package/src/screens/Unit/components/__test__/SharedUnit.test.js +24 -9
  365. package/src/screens/Unit/hook/useUnitConnectRemoteDevices.js +25 -11
  366. package/src/screens/UnitSummary/__test__/index.test.js +4 -2
  367. package/src/screens/UnitSummary/components/3PPowerConsumption/__test__/3PPowerConsumption.test.js +4 -2
  368. package/src/screens/UnitSummary/components/3PPowerConsumption/index.js +2 -2
  369. package/src/screens/UnitSummary/components/PowerConsumption/__test__/PowerConsumption.test.js +4 -2
  370. package/src/screens/UnitSummary/components/PowerConsumption/index.js +2 -2
  371. package/src/screens/UnitSummary/components/RunningDevices/__test__/index.test.js +5 -4
  372. package/src/screens/UnitSummary/components/RunningDevices/index.js +6 -3
  373. package/src/screens/UnitSummary/components/TotalPowerBox/index.js +2 -2
  374. package/src/screens/UnitSummary/components/TotalPowerConsumption/index.js +2 -2
  375. package/src/screens/UnitSummary/components/__test__/TotalPowerBox.test.js +3 -2
  376. package/src/screens/UnitSummary/components/__test__/TotalPowerConsumption.test.js +4 -2
  377. package/src/screens/UnitSummary/index.js +10 -8
  378. package/src/screens/WaterQualityGuide/__test__/index.test.js +17 -12
  379. package/src/screens/WaterQualityGuide/index.js +26 -10
  380. package/src/utils/Apis/axios.js +1 -0
  381. package/src/utils/I18n/translations/en.json +36 -11
  382. package/src/utils/I18n/translations/vi.json +36 -10
  383. package/src/utils/Route/index.js +19 -10
  384. package/src/utils/Utils.js +6 -7
  385. package/src/utils/Validation.js +4 -0
  386. package/src/commons/Connecting/index.js +0 -67
  387. package/src/commons/ConnectingProcess/DeviceItem/DeviceItem.js +0 -28
  388. package/src/commons/ConnectingProcess/__test__/Connecting.test.js +0 -163
  389. package/src/commons/ConnectingProcess/__test__/DeviceItem.test.js +0 -19
  390. package/src/commons/ConnectingProcess/index.js +0 -213
  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
@@ -0,0 +1,13 @@
1
+ <svg width="60" height="60" viewBox="0 0 60 60" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M29.316 0.684039C29.316 0.306255 29.6222 0 30 0C46.5685 0 60 13.4315 60 30C60 46.5685 46.5685 60 30 60C13.4315 60 0 46.5685 0 30C0 25.6182 0.939855 21.4541 2.62962 17.6997C2.78468 17.3552 3.18964 17.2016 3.53414 17.3567C3.87864 17.5117 4.03222 17.9167 3.87717 18.2612C2.26528 21.8425 1.36808 25.8156 1.36808 30C1.36808 45.813 14.187 58.6319 30 58.6319C45.813 58.6319 58.6319 45.813 58.6319 30C58.6319 14.187 45.813 1.36808 30 1.36808C29.6222 1.36808 29.316 1.06182 29.316 0.684039Z" fill="#00979D"/>
3
+ <path d="M44.0034 40.0138C43.9656 40.138 43.9203 40.2621 43.8825 40.394C43.5351 41.4879 42.576 42.1862 41.3752 42.2095C41.1336 42.2172 40.8843 42.2095 40.6049 42.2095C40.6049 42.512 40.6049 42.7991 40.6049 43.0862C40.5974 43.6137 40.2273 44.0172 39.744 44.0094C39.2758 44.0017 38.9132 43.606 38.9057 43.0939C38.9057 42.8146 38.9057 42.5353 38.9057 42.2327C32.6375 42.2327 26.3843 42.2327 20.101 42.2327C20.101 42.512 20.101 42.8069 20.101 43.0939C20.0935 43.6215 19.7159 44.0249 19.2401 44.0094C18.7718 44.0017 18.4093 43.606 18.4018 43.0939C18.4018 42.8146 18.4018 42.5353 18.4018 42.2327C17.994 42.2095 17.6013 42.2095 17.2086 42.1629C15.9927 42.0233 15.0109 40.9138 15.0034 39.6492C14.9958 37.9036 15.0034 36.1579 15.0034 34.4123C15.0034 32.8684 16.0909 31.7357 17.5937 31.7046C18.1148 31.6969 18.6284 31.7046 19.1495 31.7046C26.4901 31.7046 33.8307 31.7046 41.1789 31.7046C42.6893 31.7046 43.5427 32.3641 43.9656 33.8537C43.9731 33.8692 43.9882 33.8847 44.0034 33.8925C44.0034 35.9407 44.0034 37.9734 44.0034 40.0138ZM33.808 36.957C33.808 36.6855 33.8156 36.414 33.808 36.1424C33.8005 35.5993 33.4455 35.2269 32.9471 35.2269C32.4638 35.2269 32.1164 35.5993 32.1088 36.1269C32.1013 36.6777 32.1013 37.2363 32.1088 37.7872C32.1164 38.3148 32.4713 38.6872 32.9547 38.6872C33.438 38.6872 33.7929 38.3225 33.808 37.8027C33.8156 37.5156 33.808 37.2363 33.808 36.957ZM37.2065 36.9648C37.2065 36.6777 37.214 36.3829 37.2065 36.0959C37.1838 35.5916 36.8289 35.2347 36.3606 35.2347C35.8924 35.2347 35.5299 35.5916 35.5148 36.1036C35.4997 36.6777 35.4997 37.2519 35.5148 37.8182C35.5224 38.3303 35.8849 38.6872 36.3531 38.6949C36.8364 38.7027 37.1989 38.338 37.214 37.8105C37.214 37.5234 37.2065 37.2441 37.2065 36.9648ZM38.9057 36.957C38.9057 37.2363 38.8981 37.5234 38.9057 37.8027C38.9208 38.3148 39.2682 38.6794 39.7364 38.6872C40.2198 38.6949 40.5898 38.338 40.6049 37.8182C40.62 37.2441 40.62 36.67 40.6049 36.1036C40.5974 35.5916 40.2349 35.2347 39.7666 35.2347C39.2833 35.2347 38.9284 35.5993 38.9132 36.1191C38.8981 36.3907 38.9057 36.6777 38.9057 36.957Z" fill="#00979D"/>
4
+ <path d="M37.9023 21.3314C37.5927 21.3392 37.3737 21.153 37.1697 20.9513C35.9312 19.7177 34.5039 18.7867 32.8424 18.2979C28.7718 17.0954 25.1393 17.9177 21.9599 20.8194C21.7484 21.0133 21.5067 21.2151 21.2424 21.3082C20.895 21.4323 20.5099 21.2073 20.3362 20.8815C20.1549 20.5323 20.2078 20.1366 20.4872 19.8418C21.2726 19.035 22.1335 18.3522 23.0851 17.7859C25.4263 16.3893 27.9487 15.8075 30.6296 16.0557C33.6807 16.335 36.3013 17.6074 38.4838 19.8108C38.7632 20.0901 38.8388 20.4237 38.7028 20.7961C38.5744 21.1297 38.2648 21.3392 37.9023 21.3314Z" fill="#00979D"/>
5
+ <path d="M36.3686 22.7746C36.3535 23.2944 36.1949 23.5737 35.8626 23.7211C35.5152 23.8763 35.2131 23.7987 34.9186 23.5504C34.4126 23.1315 33.9293 22.666 33.378 22.3324C30.4251 20.5402 26.7623 20.9824 24.255 23.403C24.0134 23.6358 23.7717 23.8375 23.4168 23.791C23.0694 23.7444 22.8201 23.5582 22.7069 23.2091C22.586 22.8522 22.6691 22.5419 22.9259 22.2781C23.9001 21.2772 25.0254 20.5014 26.3394 20.0592C29.9644 18.8411 33.2118 19.5394 36.0212 22.216C36.1949 22.3944 36.2931 22.6582 36.3686 22.7746Z" fill="#00979D"/>
6
+ <path d="M20.834 29.9822C20.2298 29.9822 19.6559 29.99 19.0895 29.9745C19.0215 29.9745 18.9309 29.8271 18.8931 29.734C17.9944 27.5849 17.0957 25.4358 16.197 23.279C15.8496 22.4489 15.4947 21.6109 15.1548 20.773C14.9434 20.2687 15.1322 19.7567 15.5853 19.5627C16.0384 19.3688 16.4991 19.5783 16.7106 20.0825C18.0699 23.3178 19.4218 26.553 20.7736 29.7883C20.7887 29.8426 20.8038 29.8969 20.834 29.9822Z" fill="#00979D"/>
7
+ <path d="M38.1582 29.9898C38.4754 29.2218 38.7775 28.5002 39.0796 27.7865C40.1444 25.234 41.2092 22.6815 42.2741 20.1367C42.5233 19.5471 43.0897 19.3298 43.5579 19.6402C43.928 19.8884 44.0488 20.3307 43.86 20.7884C43.2559 22.2392 42.6517 23.69 42.0475 25.1331C41.4132 26.6615 40.7712 28.1899 40.1368 29.7261C40.0538 29.92 39.9632 30.0054 39.7441 29.9976C39.2306 29.9743 38.7246 29.9898 38.1582 29.9898Z" fill="#00979D"/>
8
+ <path d="M29.5042 23.0381C31.1128 23.0846 32.4948 23.5889 33.6427 24.7139C33.892 24.9544 34.0204 25.2415 33.9297 25.5984C33.8467 25.9397 33.6352 26.157 33.3105 26.2423C32.9782 26.3354 32.7063 26.2113 32.4646 25.9785C31.075 24.6596 29.0511 24.3958 27.4047 25.3423C27.1026 25.513 26.8232 25.7458 26.5664 25.9785C26.136 26.3587 25.63 26.3819 25.2826 26.0018C24.9352 25.6216 24.9805 25.1018 25.4034 24.6906C26.5589 23.5579 27.9636 23.0691 29.5042 23.0381Z" fill="#00979D"/>
9
+ <path d="M31.5958 27.8411C31.5429 28.2213 31.3919 28.4851 31.0898 28.6403C30.7726 28.8032 30.4479 28.7721 30.1609 28.5472C29.6171 28.1282 29.3755 28.1282 28.8393 28.5472C28.4768 28.8342 27.9632 28.7877 27.6687 28.4463C27.3817 28.1127 27.3893 27.6006 27.6914 27.2593C28.6052 26.2274 30.4177 26.2274 31.3088 27.267C31.4447 27.4222 31.5052 27.6472 31.5958 27.8411Z" fill="#00979D"/>
10
+ <path d="M33.8084 36.9567C33.8084 37.236 33.816 37.523 33.8084 37.8023C33.7933 38.3299 33.4383 38.6946 32.955 38.6868C32.4717 38.6868 32.1167 38.3144 32.1092 37.7868C32.1016 37.236 32.1016 36.6774 32.1092 36.1265C32.1167 35.599 32.4717 35.2266 32.9475 35.2266C33.4459 35.2266 33.7933 35.5912 33.8084 36.1421C33.816 36.4136 33.8084 36.6851 33.8084 36.9567Z" fill="white"/>
11
+ <path d="M37.2079 36.9645C37.2079 37.2438 37.2155 37.5309 37.2079 37.8102C37.1928 38.33 36.8303 38.6946 36.347 38.6946C35.8788 38.6869 35.5238 38.3222 35.5087 37.8179C35.5012 37.2438 35.4936 36.6697 35.5087 36.1033C35.5238 35.599 35.8863 35.2344 36.3546 35.2344C36.8303 35.2344 37.1853 35.5913 37.2004 36.0956C37.2155 36.3749 37.2079 36.6697 37.2079 36.9645Z" fill="white"/>
12
+ <path d="M38.906 36.9568C38.906 36.6775 38.8984 36.3904 38.906 36.1111C38.9211 35.5913 39.276 35.2189 39.7594 35.2267C40.2276 35.2267 40.5901 35.5913 40.5977 36.0956C40.6128 36.6697 40.6128 37.2439 40.5977 37.8102C40.5826 38.33 40.2125 38.6947 39.7292 38.6792C39.2609 38.6714 38.9135 38.3068 38.8984 37.7947C38.8984 37.5154 38.906 37.2361 38.906 36.9568Z" fill="white"/>
13
+ </svg>
@@ -0,0 +1,8 @@
1
+ <svg width="60" height="60" viewBox="0 0 60 60" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M29.316 0.684039C29.316 0.306255 29.6222 0 30 0C46.5685 0 60 13.4315 60 30C60 46.5685 46.5685 60 30 60C13.4315 60 0 46.5685 0 30C0 25.6182 0.939855 21.4541 2.62962 17.6997C2.78468 17.3552 3.18964 17.2016 3.53414 17.3567C3.87864 17.5117 4.03222 17.9167 3.87717 18.2612C2.26528 21.8425 1.36808 25.8156 1.36808 30C1.36808 45.813 14.187 58.6319 30 58.6319C45.813 58.6319 58.6319 45.813 58.6319 30C58.6319 14.187 45.813 1.36808 30 1.36808C29.6222 1.36808 29.316 1.06182 29.316 0.684039Z" fill="#00979D"/>
3
+ <path d="M30.5217 38.1466C30.2226 38.0931 29.9165 38.0931 29.6175 38.1466C28.606 38.2999 27.7415 38.9559 27.3217 39.8886C26.9015 40.8214 26.983 41.9032 27.5383 42.7623C28.0937 43.6214 29.0467 44.1405 30.0696 44.1405C31.0926 44.1405 32.0455 43.6214 32.6009 42.7623C33.1563 41.9032 33.2377 40.8214 32.8175 39.8886C32.3977 38.9558 31.5332 38.2999 30.5218 38.1466H30.5217Z" fill="#00979D"/>
4
+ <path d="M29.5682 23.0059C29.9018 23.0462 30.2389 23.0462 30.5726 23.0059C31.9379 22.834 33.12 21.9755 33.7063 20.7306C34.2923 19.486 34.2008 18.0277 33.4638 16.8659C32.7265 15.7041 31.4462 15 30.0704 15C28.6947 15 27.4143 15.704 26.677 16.8659C25.94 18.0277 25.8485 19.486 26.4345 20.7306C27.0208 21.9755 28.2028 22.834 29.5683 23.0059H29.5682Z" fill="#00979D"/>
5
+ <path d="M18.466 38.1466C18.1669 38.0931 17.8608 38.0931 17.5618 38.1466C16.5503 38.2999 15.6858 38.9559 15.266 39.8886C14.8459 40.8214 14.9273 41.9032 15.4826 42.7623C16.038 43.6214 16.991 44.1405 18.0139 44.1405C19.0369 44.1405 19.9898 43.6214 20.5452 42.7623C21.1007 41.9032 21.182 40.8214 20.7619 39.8886C20.3421 38.9558 19.4776 38.2999 18.4661 38.1466H18.466Z" fill="#00979D"/>
6
+ <path d="M42.5773 38.1466C42.2783 38.0931 41.9722 38.0931 41.6731 38.1466C40.6616 38.2999 39.7972 38.9559 39.3774 39.8886C38.9572 40.8214 39.0386 41.9032 39.594 42.7623C40.1493 43.6214 41.1023 44.1405 42.1253 44.1405C43.1482 44.1405 44.1011 43.6214 44.6566 42.7623C45.212 41.9032 45.2933 40.8214 44.8732 39.8886C44.4534 38.9558 43.5889 38.2999 42.5774 38.1466H42.5773Z" fill="#00979D"/>
7
+ <path d="M41.6234 33.685V37.6031C41.9561 37.5496 42.2952 37.5496 42.6279 37.6031V33.685C42.6252 32.548 42.1724 31.4585 41.3684 30.6546C40.5645 29.8506 39.475 29.3978 38.338 29.3952H30.572V23.5381C30.2383 23.5785 29.9013 23.5785 29.5676 23.5381V29.4254H21.8015C20.6696 29.4281 19.5845 29.8765 18.7815 30.674C17.9786 31.4716 17.5221 32.5534 17.5117 33.685V37.6031C17.8444 37.5496 18.1835 37.5496 18.5161 37.6031V33.685C18.5188 32.8148 18.866 31.9805 19.4816 31.365C20.0968 30.7494 20.931 30.4026 21.8015 30.3999H29.5676V37.6031C29.9003 37.5496 30.2393 37.5496 30.572 37.6031V30.3999H38.338C39.2086 30.4026 40.0428 30.7494 40.658 31.365C41.2736 31.9806 41.6208 32.8148 41.6234 33.685Z" fill="#00979D"/>
8
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg width="60" height="60" viewBox="0 0 60 60" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M29.316 0.684039C29.316 0.306255 29.6222 0 30 0C46.5685 0 60 13.4315 60 30C60 46.5685 46.5685 60 30 60C13.4315 60 0 46.5685 0 30C0 25.6182 0.939855 21.4541 2.62962 17.6997C2.78468 17.3552 3.18964 17.2016 3.53414 17.3567C3.87864 17.5117 4.03222 17.9167 3.87717 18.2612C2.26528 21.8425 1.36808 25.8156 1.36808 30C1.36808 45.813 14.187 58.6319 30 58.6319C45.813 58.6319 58.6319 45.813 58.6319 30C58.6319 14.187 45.813 1.36808 30 1.36808C29.6222 1.36808 29.316 1.06182 29.316 0.684039Z" fill="#00979D"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M14.3298 25.3708L14.3298 25.3708L14.3298 25.3708C14.2213 25.4986 14.1126 25.6265 14 25.7512C14 25.9333 14 26.1154 14.0076 26.305C14.019 26.324 14.0323 26.3429 14.0455 26.3619C14.0588 26.3809 14.0721 26.3998 14.0835 26.4188C14.4099 27.0712 15.1236 27.2153 15.6777 26.745C15.7784 26.6545 15.8757 26.5607 15.9718 26.4679C16.0208 26.4207 16.0694 26.3738 16.118 26.3278C17.4314 25.0761 18.889 24.0292 20.506 23.1947C24.3625 21.2072 28.4544 20.5776 32.736 21.2527C35.5828 21.7003 38.2095 22.732 40.5629 24.3933C41.2607 24.8846 41.9106 25.4457 42.5614 26.0076C42.8452 26.2527 43.1292 26.4978 43.4174 26.7374C43.8728 27.1167 44.4422 27.1015 44.8294 26.6919C45.2014 26.2898 45.1938 25.683 44.7687 25.2809C44.26 24.7878 43.7438 24.3023 43.1972 23.8547C39.6975 21.0251 35.7119 19.4093 31.2101 19.0679C29.2363 18.9162 27.2701 19.0148 25.3266 19.4017C21.4246 20.1907 17.9932 21.9203 15.0476 24.5982C14.7853 24.8346 14.5578 25.1024 14.3298 25.3708ZM18.7395 30.269C18.6998 30.3473 18.66 30.4257 18.6153 30.5001C18.6305 30.5077 18.6457 30.5228 18.6609 30.5456C18.6696 30.589 18.676 30.6312 18.6824 30.6728C18.6927 30.7403 18.7028 30.8061 18.7216 30.8718C18.9721 31.6532 19.83 31.82 20.4677 31.2056C22.5326 29.2105 24.9695 27.9891 27.8239 27.6174C30.4126 27.276 32.8951 27.6629 35.2485 28.8084C36.539 29.4304 37.6702 30.2649 38.695 31.2587C39.1429 31.6987 39.7655 31.6759 40.1526 31.2587C40.5322 30.8414 40.5094 30.2422 40.0767 29.8173C38.8165 28.5808 37.3969 27.5795 35.7875 26.8512C32.9179 25.5464 29.9192 25.1899 26.8218 25.7512C23.8004 26.2898 21.2116 27.6781 19.0253 29.8249C18.9026 29.9475 18.8213 30.1078 18.7395 30.269ZM29.5472 31.9338C31.8247 32.0249 33.7681 32.829 35.4079 34.3841C35.833 34.7862 35.8634 35.3855 35.4914 35.7951C35.1118 36.2124 34.4969 36.2579 34.0566 35.8482C33.3354 35.1807 32.5459 34.6269 31.6045 34.331C29.3422 33.6179 27.2849 34.0048 25.4326 35.4993C25.3566 35.56 25.2864 35.6244 25.2162 35.6889L25.2161 35.689C25.1459 35.7534 25.0757 35.8179 24.9998 35.8786C24.5671 36.2351 23.975 36.2048 23.6106 35.8027C23.2462 35.4007 23.2538 34.8089 23.6561 34.4145C24.7417 33.3524 26.0019 32.6014 27.4823 32.2525C27.9338 32.1572 28.3919 32.0951 28.848 32.0332L28.848 32.0332L28.848 32.0332C29.082 32.0015 29.3155 31.9699 29.5472 31.9338ZM29.5473 40.9991C30.2989 40.9991 30.891 40.4074 30.891 39.6564C30.891 38.9054 30.2989 38.3137 29.5397 38.3213C28.7882 38.3289 28.2112 38.9054 28.2112 39.6488C28.2112 40.4074 28.7882 40.9991 29.5473 40.9991Z" fill="#00979D"/>
4
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg width="60" height="60" viewBox="0 0 60 60" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M23.0564 32.7835C23.2933 33.0218 23.2933 33.4065 23.0564 33.6448C22.9417 33.7604 22.7856 33.8254 22.6226 33.8254C22.4598 33.8254 22.3037 33.7604 22.1889 33.6448C20.2842 31.7032 19.2171 29.0918 19.2171 26.3719C19.2171 23.6519 20.2842 21.0407 22.1889 19.099C22.3037 18.9835 22.4598 18.9184 22.6226 18.9184C22.7856 18.9184 22.9417 18.9835 23.0564 19.099C23.2933 19.3373 23.2933 19.7223 23.0564 19.9606C21.3773 21.6735 20.4368 23.9765 20.4368 26.3752C20.4368 28.7738 21.3773 31.0768 23.0564 32.7899V32.7835ZM16.7575 26.3379C16.7502 22.9627 18.0815 19.7222 20.4598 17.3271C20.6658 17.0833 20.6492 16.7218 20.422 16.4978C20.1947 16.2736 19.8331 16.2624 19.5921 16.4719C16.9937 19.0968 15.5361 22.6414 15.5361 26.3352C15.5361 30.0289 16.9937 33.5735 19.5921 36.1986C19.7065 36.3152 19.8627 36.3812 20.026 36.3818C20.1872 36.3855 20.3422 36.3211 20.4537 36.2047C20.6906 35.9664 20.6906 35.5817 20.4537 35.3434C18.0791 32.9485 16.7501 29.7105 16.7575 26.3383L16.7575 26.3379ZM25.6343 21.6462C25.396 21.4093 25.0111 21.4093 24.7728 21.6462C23.5561 22.9001 22.8758 24.5786 22.8758 26.3258C22.8758 28.0729 23.5561 29.7514 24.7728 31.0053C25.0111 31.2421 25.396 31.2421 25.6343 31.0053C25.7499 30.8907 25.8149 30.7345 25.8149 30.5716C25.8149 30.4088 25.7499 30.2525 25.6343 30.1378C24.6396 29.112 24.0835 27.7392 24.0835 26.3105C24.0835 24.8817 24.6396 23.509 25.6343 22.483C25.8554 22.2479 25.8554 21.8812 25.6343 21.6462V21.6462ZM38.2128 19.0619C38.098 18.9463 37.942 18.8813 37.7791 18.8813C37.6161 18.8813 37.46 18.9463 37.3453 19.0619C37.1084 19.3002 37.1084 19.6849 37.3453 19.9232C39.0244 21.6363 39.9647 23.9393 39.9647 26.3379C39.9647 28.7366 39.0244 31.0396 37.3453 32.7525C37.1084 32.9908 37.1084 33.3758 37.3453 33.6141C37.46 33.7296 37.6161 33.7947 37.7791 33.7947C37.942 33.7947 38.098 33.7296 38.2128 33.6141C40.1175 31.6723 41.1847 29.061 41.1847 26.3412C41.1847 23.6213 40.1175 21.01 38.2128 19.0683V19.0619ZM40.8032 16.4717C40.6934 16.3416 40.5342 16.2633 40.3642 16.2555C40.1943 16.2479 40.0288 16.3113 39.9075 16.4308C39.7864 16.5502 39.7205 16.7149 39.7258 16.8851C39.7312 17.0551 39.8072 17.2152 39.9355 17.3269C42.3027 19.7275 43.6301 22.9634 43.6301 26.3346C43.6301 29.7062 42.3027 32.942 39.9355 35.3429C39.6986 35.5812 39.6986 35.9659 39.9355 36.2042C40.047 36.3206 40.2022 36.3851 40.3632 36.3814C40.5264 36.3808 40.6827 36.3147 40.7971 36.1981C43.3954 33.5729 44.853 30.0285 44.853 26.3347C44.853 22.6412 43.3954 19.0964 40.7971 16.4714L40.8032 16.4717ZM35.6226 21.6582C35.5136 21.5277 35.355 21.4486 35.1853 21.4396C35.0155 21.4308 34.8496 21.4932 34.7277 21.6116C34.6056 21.7302 34.5387 21.8943 34.5426 22.0643C34.5466 22.2342 34.6215 22.3948 34.7489 22.5075C35.7435 23.5333 36.2998 24.9061 36.2998 26.3348C36.2998 27.7638 35.7435 29.1365 34.7489 30.1624C34.6332 30.2771 34.5681 30.4332 34.5681 30.596C34.5681 30.759 34.6332 30.9151 34.7489 31.0298C34.9872 31.2667 35.372 31.2667 35.6103 31.0298C36.8269 29.776 37.5075 28.0974 37.5075 26.3502C37.5075 24.603 36.8269 22.9244 35.6103 21.6705L35.6226 21.6582ZM33.6065 40.7252H30.8085V28.6903C31.5829 28.4902 32.2105 27.9238 32.4887 27.1739C32.7669 26.4239 32.6603 25.5852 32.2035 24.9286C31.7468 24.272 30.9975 23.8805 30.1975 23.8805C29.3975 23.8805 28.6483 24.272 28.1915 24.9286C27.7347 25.5852 27.6281 26.4239 27.9063 27.1739C28.1845 27.9238 28.8121 28.4902 29.5865 28.6903V40.7252H26.7885C26.5579 40.7235 26.3364 40.8145 26.1734 40.9776C26.0104 41.1406 25.9193 41.3621 25.921 41.5926V43.5232C25.9193 43.7539 26.0104 43.9754 26.1734 44.1385C26.3364 44.3015 26.5579 44.3923 26.7885 44.3907H33.6063C33.8368 44.3923 34.0584 44.3015 34.2214 44.1385C34.3844 43.9754 34.4754 43.7539 34.4738 43.5232V41.5926C34.4754 41.3621 34.3844 41.1406 34.2214 40.9776C34.0584 40.8145 33.8368 40.7235 33.6063 40.7252H33.6065Z" fill="#00979D"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M29.316 0.684039C29.316 0.306255 29.6222 0 30 0C46.5685 0 60 13.4315 60 30C60 46.5685 46.5685 60 30 60C13.4315 60 0 46.5685 0 30C0 25.6182 0.939855 21.4541 2.62962 17.6997C2.78468 17.3552 3.18964 17.2016 3.53414 17.3567C3.87864 17.5117 4.03222 17.9167 3.87717 18.2612C2.26528 21.8425 1.36808 25.8156 1.36808 30C1.36808 45.813 14.187 58.6319 30 58.6319C45.813 58.6319 58.6319 45.813 58.6319 30C58.6319 14.187 45.813 1.36808 30 1.36808C29.6222 1.36808 29.316 1.06182 29.316 0.684039Z" fill="#00979D"/>
4
+ </svg>
@@ -0,0 +1,14 @@
1
+ <svg width="94" height="94" viewBox="0 0 94 94" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_12247_30556)">
3
+ <path d="M29.6912 84.4521C29.2086 84.4521 28.7345 84.6487 28.3931 84.99C28.0518 85.3321 27.8574 85.8033 27.8574 86.2881C27.8574 86.7715 28.0518 87.2448 28.3931 87.5862C28.7345 87.9275 29.2086 88.124 29.6912 88.124C30.176 88.124 30.6479 87.9275 30.9907 87.5862C31.3328 87.2448 31.5293 86.7715 31.5293 86.2881C31.5293 85.8054 31.3328 85.3321 30.9907 84.99C30.6493 84.6487 30.176 84.4521 29.6912 84.4521Z" fill="#00979D"/>
4
+ <path d="M86.6491 51.156L73.6899 38.1968C72.4492 36.9561 70.7998 36.2734 69.0456 36.2734C67.2914 36.2734 65.6419 36.9561 64.4012 38.1968C63.5966 39.0022 63.0264 39.979 62.7252 41.0454C61.7147 40.5204 60.596 40.2802 59.4844 40.3153V7.71094C59.4844 3.45888 56.0255 0 51.7734 0H7.71094C3.45959 0 0.000717163 3.45888 0.000717163 7.71094V38.7383C0.000717163 39.7516 0.822586 40.5742 1.83594 40.5742C2.85001 40.5742 3.67187 39.7516 3.67187 38.7383V15.4219H55.8125V41.5747C55.5457 41.7704 55.289 41.9863 55.048 42.2273C53.7349 43.5404 53.0952 45.2752 53.1289 47C51.4062 46.9677 49.6686 47.6067 48.3562 48.9191C47.6218 49.6535 47.0975 50.5206 46.7841 51.4435L36.1644 40.8231C34.9237 39.5824 33.2742 38.8996 31.52 38.8996C29.7659 38.8996 28.1164 39.5831 26.8757 40.8231C25.635 42.0638 24.9523 43.7132 24.9523 45.4674C24.9523 47.2223 25.635 48.8711 26.8757 50.1118L51.2621 74.4989L46.9562 73.454C43.3963 72.5898 39.7287 74.7657 38.7806 78.3042C38.7562 78.3952 38.7354 78.4863 38.7146 78.5774H3.67187V55.261C3.67187 54.2477 2.85001 53.4251 1.83594 53.4251C0.821869 53.4251 0 54.2477 0 55.261V86.2883C0 90.5404 3.45888 93.9993 7.71094 93.9993H51.7727C53.9565 93.9993 56.0104 93.0763 57.4605 91.4906L60.6404 92.6001C63.3119 93.531 66.1023 94 68.9 94C70.7747 94 72.6529 93.7899 74.501 93.3667C79.1074 92.3125 83.3078 89.9889 86.6491 86.6484C96.4348 76.8634 96.4348 60.9409 86.6491 51.156ZM3.67187 11.75V7.71094C3.67187 5.48343 5.48343 3.67188 7.71094 3.67188H51.7727C54.0002 3.67188 55.8118 5.48343 55.8118 7.71094V11.75H3.67187ZM51.7727 90.3274H7.71094C5.48343 90.3274 3.67187 88.5159 3.67187 86.2883V82.2493H38.9204C39.5781 84.1706 41.0777 85.7784 43.1123 86.4884L53.2816 90.0341C52.809 90.2241 52.2984 90.3274 51.7727 90.3274ZM84.0529 84.0515C78.2776 89.8275 69.5619 91.8213 61.8496 89.1326L44.3214 83.021C42.7809 82.4845 41.906 80.8293 42.3277 79.2544C42.6999 77.8667 43.9793 76.9344 45.3634 76.9344C45.6037 76.9344 45.8475 76.9631 46.0906 77.0219L56.752 79.6094C57.5509 79.8038 58.3828 79.4416 58.7859 78.7237C59.1882 78.0065 59.0648 77.1087 58.4832 76.527L29.4718 47.5156C28.9246 46.9684 28.6234 46.2412 28.6234 45.4681C28.6234 44.6943 28.9246 43.9671 29.4718 43.4199C30.019 42.8727 30.7462 42.5715 31.52 42.5715C32.2931 42.5715 33.0203 42.8727 33.5675 43.4199L48.3554 58.2071C48.3554 58.2078 48.3554 58.2078 48.3562 58.2085C48.3562 58.2085 48.3562 58.2085 48.3569 58.2093L57.4483 67.3007C57.8069 67.6593 58.2767 67.8386 58.7464 67.8386C59.2162 67.8386 59.6866 67.6593 60.0445 67.3007C60.7616 66.5843 60.7616 65.4218 60.0445 64.7046L50.9523 55.6117C50.9523 55.6117 50.9523 55.6117 50.9516 55.6117C49.8228 54.4822 49.8235 52.6455 50.9523 51.516C52.0811 50.3872 53.9185 50.3872 55.048 51.516L64.6128 61.0815C64.9714 61.4394 65.4411 61.6194 65.9116 61.6194C66.3813 61.6194 66.8511 61.4394 67.2096 61.0815C67.9261 60.3643 67.9261 59.2018 67.2096 58.4846L57.6441 48.9198C56.5153 47.7903 56.5153 45.9529 57.6441 44.8241C58.7737 43.6953 60.611 43.6946 61.7398 44.8241L64.4012 47.4855L71.3929 54.4764C71.7514 54.835 72.2212 55.0143 72.6909 55.0143C73.1607 55.0143 73.6311 54.835 73.989 54.4764C74.7062 53.76 74.7062 52.5975 73.989 51.8803L66.9981 44.8887C65.8686 43.7599 65.8686 41.9225 66.9981 40.793C67.5446 40.2458 68.2718 39.9445 69.0456 39.9445C69.8194 39.9445 70.5466 40.2458 71.0931 40.793L84.0529 53.7528C92.4065 62.1063 92.4065 75.6987 84.0529 84.0515Z" fill="#00979D"/>
5
+ <path d="M43.1357 30.434C43.6054 30.434 44.0752 30.2547 44.4338 29.8961C45.1509 29.1797 45.1509 28.0171 44.4338 27.3C36.9322 19.7984 24.7254 19.7984 17.2232 27.3C16.5067 28.0164 16.506 29.1789 17.2232 29.8961C17.9403 30.6133 19.1028 30.6133 19.82 29.8961C25.8901 23.826 35.7668 23.826 41.8376 29.8961C42.1962 30.2547 42.6659 30.434 43.1357 30.434Z" fill="#00979D"/>
6
+ <path d="M23.2908 33.367C22.5736 34.0841 22.5736 35.2467 23.2908 35.9638C24.008 36.6803 25.1705 36.6803 25.8876 35.9638C28.6122 33.2386 33.0449 33.2386 35.7694 35.9638C36.128 36.3224 36.5978 36.5017 37.0682 36.5017C37.538 36.5017 38.0077 36.3224 38.3663 35.9638C39.0827 35.2467 39.0827 34.0841 38.3663 33.367C34.2096 29.211 27.4468 29.211 23.2908 33.367Z" fill="#00979D"/>
7
+ <path d="M1.83691 48.8359C2.31956 48.8359 2.79361 48.6394 3.13498 48.2973C3.47635 47.956 3.67285 47.4827 3.67285 47C3.67285 46.5166 3.47635 46.0433 3.13498 45.7019C2.79361 45.3606 2.31956 45.1641 1.83691 45.1641C1.35426 45.1641 0.880219 45.3598 0.538849 45.7019C0.197479 46.0433 0.000976562 46.5152 0.000976562 47C0.000976562 47.4827 0.197479 47.956 0.538849 48.2973C0.880219 48.6394 1.35355 48.8359 1.83691 48.8359Z" fill="#00979D"/>
8
+ </g>
9
+ <defs>
10
+ <clipPath id="clip0_12247_30556">
11
+ <rect width="94" height="94" fill="white"/>
12
+ </clipPath>
13
+ </defs>
14
+ </svg>
package/index.js CHANGED
@@ -20,6 +20,7 @@ import SharedUnit from './src/commons/Unit/SharedUnit';
20
20
  import { Action } from './src/context/actionType';
21
21
  import { withRemoteControl } from './src/hoc';
22
22
  import DevModeStack from './src/navigations/Main';
23
+ import { SmartAccountStack } from './src/navigations/SmartAccountStack';
23
24
 
24
25
  export {
25
26
  AddSubUnitStack,
@@ -46,4 +47,5 @@ export {
46
47
  Action,
47
48
  withRemoteControl,
48
49
  DevModeStack,
50
+ SmartAccountStack,
49
51
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@eohjsc/react-native-smart-city",
3
3
  "title": "React Native Smart Home",
4
- "version": "0.3.31",
4
+ "version": "0.3.34",
5
5
  "description": "TODO",
6
6
  "main": "index.js",
7
7
  "files": [
@@ -39,11 +39,12 @@
39
39
  "reset-cache": "react-native start --reset-cache",
40
40
  "merge_conflict": "yarn jest && yarn update_coverage_result && yarn check_coverage_config",
41
41
  "jest": "jest --detectOpenHandles",
42
+ "jest1": "jest --detectOpenHandles --coverage=0",
42
43
  "example": "yarn --cwd example",
43
44
  "pods": "cd example && pod-install --quiet",
44
45
  "bootstrap": "yarn example && yarn && yarn pods",
45
- "build": "sync-files ./src ../EohMobile/node_modules/@eohjsc/react-native-smart-city/src",
46
- "watch": "sync-files --watch ./src ../EohMobile/node_modules/@eohjsc/react-native-smart-city/src"
46
+ "build": "syncdir ./src ../EohMobile/node_modules/@eohjsc/react-native-smart-city/src",
47
+ "watch": "syncdir ./src ../EohMobile/node_modules/@eohjsc/react-native-smart-city/src --watch"
47
48
  },
48
49
  "repository": {
49
50
  "type": "git",
@@ -139,7 +140,7 @@
139
140
  "patch-package": "^6.2.2",
140
141
  "pluralize": "^8.0.0",
141
142
  "postinstall": "^0.7.0",
142
- "pusher-js": "^7.0.3",
143
+ "pusher-js": "^7.4.0",
143
144
  "pusher-js-auth": "^4.0.1",
144
145
  "querystring": "^0.2.0",
145
146
  "react-content-loader": "^6.0.3",
@@ -150,6 +151,7 @@
150
151
  "react-native-android-keyboard-adjust": "^1.2.0",
151
152
  "react-native-android-location-enabler": "^1.2.2",
152
153
  "react-native-android-wifi": "^0.0.41",
154
+ "react-native-animated-ellipsis": "^2.0.0",
153
155
  "react-native-appearance": "^0.3.4",
154
156
  "react-native-base64": "^0.1.0",
155
157
  "react-native-ble-plx": "^2.0.1",
@@ -207,9 +209,10 @@
207
209
  "redux-persist": "^6.0.0",
208
210
  "redux-saga": "^1.1.3",
209
211
  "string-format": "^2.0.0",
210
- "sync-files": "^1.0.3",
212
+ "sync-directory": "^5.1.7",
211
213
  "timezone-mock": "^1.1.3",
212
214
  "uuid-by-string": "^3.0.2",
215
+ "uuidv4": "^6.2.13",
213
216
  "validator": "^13.1.1",
214
217
  "victory-native": "^35.0.1"
215
218
  },
Binary file
@@ -1,6 +1,6 @@
1
1
  import React, { memo, useCallback, useEffect, useState } from 'react';
2
2
  import { TouchableOpacity, View } from 'react-native';
3
- import { TESTID } from '../../configs/Constants';
3
+ import { AccessibilityLabel } from '../../configs/Constants';
4
4
  import { useSCContextSelector } from '../../context';
5
5
  import { useRemoteControl } from '../../hooks/IoT';
6
6
  import { useConfigGlobalState } from '../../iot/states';
@@ -53,7 +53,24 @@ const ItemQuickAction = memo(({ sensor, wrapperStyle, setStatus }) => {
53
53
  }, [sensor, configValues, statusCallback]);
54
54
  const userId = useSCContextSelector((state) => state?.auth.account.user.id);
55
55
  const onActionPress = useCallback(() => {
56
- sendRemoteCommand(sensor, action, null, userId);
56
+ let data = null;
57
+ if (
58
+ action?.allow_config_store_value_id === sensor?.quick_action?.config_id
59
+ ) {
60
+ if (action?.name?.toLowerCase().includes('off')) {
61
+ data = {
62
+ config_id: action?.allow_config_store_value_id,
63
+ config_value: 0,
64
+ };
65
+ } else {
66
+ data = {
67
+ config_id: action?.allow_config_store_value_id,
68
+ config_value: 1,
69
+ };
70
+ }
71
+ data = JSON.stringify(data);
72
+ }
73
+ sendRemoteCommand(sensor, action, data, userId);
57
74
  setIsSendingCommand(true);
58
75
 
59
76
  if (!sensor.quick_action) {
@@ -87,8 +104,7 @@ const ItemQuickAction = memo(({ sensor, wrapperStyle, setStatus }) => {
87
104
 
88
105
  return (
89
106
  <TouchableOpacity
90
- testID={TESTID.ITEM_QUICK_ACTION_PRESS}
91
- accessibilityLabel={`${TESTID.ITEM_QUICK_ACTION_PRESS}-${sensor?.id}`}
107
+ accessibilityLabel={`${AccessibilityLabel.ITEM_QUICK_ACTION_PRESS}-${sensor?.id}`}
92
108
  onPress={onActionPress}
93
109
  >
94
110
  <View style={wrapperStyle}>
@@ -3,7 +3,7 @@ import { TouchableOpacity } from 'react-native';
3
3
  import { act, create } from 'react-test-renderer';
4
4
  import ItemQuickAction from '../ItemQuickAction';
5
5
  import { Colors } from '../../../configs';
6
- import { TESTID } from '../../../configs/Constants';
6
+ import { AccessibilityLabel } from '../../../configs/Constants';
7
7
  import { factory } from 'factory-girl';
8
8
 
9
9
  class Sensor {}
@@ -41,10 +41,12 @@ describe('Test ItemQuickAction', () => {
41
41
 
42
42
  const sensor = {
43
43
  action: {
44
+ name: 'off',
44
45
  color: '#00979D',
45
46
  command_prefer_over_bluetooth: true,
46
47
  command_prefer_over_googlehome: false,
47
48
  command_prefer_over_internet: false,
49
+ allow_config_store_value_id: 51,
48
50
  id: 9,
49
51
  },
50
52
  quick_action: {
@@ -73,6 +75,7 @@ describe('Test ItemQuickAction', () => {
73
75
  command_prefer_over_bluetooth: true,
74
76
  command_prefer_over_googlehome: false,
75
77
  command_prefer_over_internet: false,
78
+ allow_config_store_value_id: 51,
76
79
  id: 10,
77
80
  },
78
81
  status: 'OFF',
@@ -95,7 +98,8 @@ describe('Test ItemQuickAction', () => {
95
98
  const instance = tree.root;
96
99
  const buttonOnActionPress = instance.findAll(
97
100
  (el) =>
98
- el.props.testID === TESTID.ITEM_QUICK_ACTION_PRESS &&
101
+ el.props.accessibilityLabel ===
102
+ `${AccessibilityLabel.ITEM_QUICK_ACTION_PRESS}-${sensor?.id}` &&
99
103
  el.type === TouchableOpacity
100
104
  );
101
105
  expect(buttonOnActionPress).toHaveLength(0);
@@ -117,7 +121,8 @@ describe('Test ItemQuickAction', () => {
117
121
  const instance = tree.root;
118
122
  const buttonOnActionPress = instance.find(
119
123
  (el) =>
120
- el.props.testID === TESTID.ITEM_QUICK_ACTION_PRESS &&
124
+ el.props.accessibilityLabel ===
125
+ `${AccessibilityLabel.ITEM_QUICK_ACTION_PRESS}-${sensor?.id}` &&
121
126
  el.type === TouchableOpacity
122
127
  );
123
128
  expect(buttonOnActionPress).toBeDefined();
@@ -134,7 +139,7 @@ describe('Test ItemQuickAction', () => {
134
139
  expect(mockSetState).toBeCalledWith(sensor.quick_action.off_action);
135
140
  });
136
141
 
137
- test('render with icon_outlined poweroff', () => {
142
+ test('render with icon_outlined poweroff and action have allow_config_store_value_id', () => {
138
143
  const mockSetStatus = jest.fn();
139
144
  sensor.action.icon = null;
140
145
  act(() => {
@@ -150,7 +155,8 @@ describe('Test ItemQuickAction', () => {
150
155
  const instance = tree.root;
151
156
  const buttonOnActionPress = instance.find(
152
157
  (el) =>
153
- el.props.testID === TESTID.ITEM_QUICK_ACTION_PRESS &&
158
+ el.props.accessibilityLabel ===
159
+ `${AccessibilityLabel.ITEM_QUICK_ACTION_PRESS}-${sensor?.id}` &&
154
160
  el.type === TouchableOpacity
155
161
  );
156
162
  expect(buttonOnActionPress).toBeDefined();
@@ -159,7 +165,12 @@ describe('Test ItemQuickAction', () => {
159
165
  act(() => {
160
166
  buttonOnActionPress.props.onPress();
161
167
  });
162
- expect(mockSendRemoteControl).toBeCalled();
168
+ expect(mockSendRemoteControl).toBeCalledWith(
169
+ sensor,
170
+ sensor.action,
171
+ JSON.stringify({ config_id: 51, config_value: 0 }),
172
+ undefined
173
+ );
163
174
  expect(mockSetState).toBeCalledTimes(1);
164
175
 
165
176
  jest.runAllTimers();
@@ -196,7 +207,8 @@ describe('Test ItemQuickAction', () => {
196
207
  const instance = tree.root;
197
208
  const buttonOnActionPress = instance.find(
198
209
  (el) =>
199
- el.props.testID === TESTID.ITEM_QUICK_ACTION_PRESS &&
210
+ el.props.accessibilityLabel ===
211
+ `${AccessibilityLabel.ITEM_QUICK_ACTION_PRESS}-${sensor?.id}` &&
200
212
  el.type === TouchableOpacity
201
213
  );
202
214
 
@@ -219,7 +231,8 @@ describe('Test ItemQuickAction', () => {
219
231
  const instance = tree.root;
220
232
  const buttonOnActionPress = instance.find(
221
233
  (el) =>
222
- el.props.testID === TESTID.ITEM_QUICK_ACTION_PRESS &&
234
+ el.props.accessibilityLabel ===
235
+ `${AccessibilityLabel.ITEM_QUICK_ACTION_PRESS}-${sensor?.id}` &&
223
236
  el.type === TouchableOpacity
224
237
  );
225
238
  expect(buttonOnActionPress).toBeDefined();
@@ -235,7 +248,8 @@ describe('Test ItemQuickAction', () => {
235
248
  const instance = tree.root;
236
249
  const buttonOnActionPress = instance.find(
237
250
  (el) =>
238
- el.props.testID === TESTID.ITEM_QUICK_ACTION_PRESS &&
251
+ el.props.accessibilityLabel ===
252
+ `${AccessibilityLabel.ITEM_QUICK_ACTION_PRESS}-${sensor?.id}` &&
239
253
  el.type === TouchableOpacity
240
254
  );
241
255
  expect(buttonOnActionPress).toBeDefined();
@@ -243,10 +257,12 @@ describe('Test ItemQuickAction', () => {
243
257
  test('trigger action with quick action no auto update', () => {
244
258
  const noAutoUpdateSensor = {
245
259
  action: {
260
+ name: 'on',
246
261
  color: '#00979D',
247
262
  command_prefer_over_bluetooth: true,
248
263
  command_prefer_over_googlehome: false,
249
264
  command_prefer_over_internet: false,
265
+ allow_config_store_value_id: 51,
250
266
  id: 9,
251
267
  icon: 'caret-up',
252
268
  },
@@ -282,7 +298,8 @@ describe('Test ItemQuickAction', () => {
282
298
  const instance = tree.root;
283
299
  const buttonOnActionPress = instance.find(
284
300
  (el) =>
285
- el.props.testID === TESTID.ITEM_QUICK_ACTION_PRESS &&
301
+ el.props.accessibilityLabel ===
302
+ `${AccessibilityLabel.ITEM_QUICK_ACTION_PRESS}-${sensor?.id}` &&
286
303
  el.type === TouchableOpacity
287
304
  );
288
305
 
@@ -290,6 +307,12 @@ describe('Test ItemQuickAction', () => {
290
307
  act(() => {
291
308
  buttonOnActionPress.props.onPress();
292
309
  });
310
+ expect(mockSendRemoteControl).toBeCalledWith(
311
+ noAutoUpdateSensor,
312
+ noAutoUpdateSensor.action,
313
+ JSON.stringify({ config_id: 51, config_value: 1 }),
314
+ undefined
315
+ );
293
316
  expect(mockSetState).toBeCalledTimes(1);
294
317
 
295
318
  jest.runAllTimers();
@@ -313,7 +336,8 @@ describe('Test ItemQuickAction', () => {
313
336
  const instance = tree.root;
314
337
  const buttonOnActionPress = instance.find(
315
338
  (el) =>
316
- el.props.testID === TESTID.ITEM_QUICK_ACTION_PRESS &&
339
+ el.props.accessibilityLabel ===
340
+ `${AccessibilityLabel.ITEM_QUICK_ACTION_PRESS}-${sensor?.id}` &&
317
341
  el.type === TouchableOpacity
318
342
  );
319
343
 
@@ -3,7 +3,7 @@ import { TouchableOpacity, View, Switch, Image } from 'react-native';
3
3
  import { Icon } from '@ant-design/react-native';
4
4
  import styles from './CurtainButtonTemplateStyle';
5
5
  import Text from '../Text';
6
- import { TESTID } from '../../configs/Constants';
6
+ import { AccessibilityLabel } from '../../configs/Constants';
7
7
  import { Colors, Images } from '../../configs';
8
8
 
9
9
  const CurtainButtonTemplate = memo(({ actionGroup, doAction, sensor }) => {
@@ -50,21 +50,21 @@ const CurtainButtonTemplate = memo(({ actionGroup, doAction, sensor }) => {
50
50
  icon: Images.buttonLeftCurtain,
51
51
  text: text1,
52
52
  onPress: onButtonClosePress,
53
- testID: TESTID.BUTTON_TEMPLATE_1,
53
+ accessibilityLabel: AccessibilityLabel.BUTTON_TEMPLATE_1,
54
54
  },
55
55
  {
56
56
  style: styles.buttonActionCurtainCenter,
57
57
  icon: Images.buttonPauseCurtain,
58
58
  text: '',
59
59
  onPress: onButtonStopPress,
60
- testID: TESTID.BUTTON_TEMPLATE_2,
60
+ accessibilityLabel: AccessibilityLabel.BUTTON_TEMPLATE_2,
61
61
  },
62
62
  {
63
63
  style: styles.buttonActionCurtain,
64
64
  icon: Images.buttonRightCurtain,
65
65
  text: text3,
66
66
  onPress: onButtonOpenPress,
67
- testID: TESTID.BUTTON_TEMPLATE_3,
67
+ accessibilityLabel: AccessibilityLabel.BUTTON_TEMPLATE_3,
68
68
  },
69
69
  ];
70
70
 
@@ -72,7 +72,7 @@ const CurtainButtonTemplate = memo(({ actionGroup, doAction, sensor }) => {
72
72
  <>
73
73
  {buttons.map((item, index) => (
74
74
  <TouchableOpacity
75
- testID={item.testID}
75
+ accessibilityLabel={item.accessibilityLabel}
76
76
  style={item?.style}
77
77
  onPress={item.onPress}
78
78
  underlayColor={Colors.Gray2}
@@ -91,7 +91,7 @@ const CurtainButtonTemplate = memo(({ actionGroup, doAction, sensor }) => {
91
91
  <Icon name={icon} size={15} color={color} style={styles.iconLock} />
92
92
  <Text
93
93
  style={styles.textLockDoor}
94
- testID={TESTID.TEXT_DOOR_LOOK_ON_OFF}
94
+ accessibilityLabel={AccessibilityLabel.TEXT_DOOR_LOOK_ON_OFF}
95
95
  >
96
96
  {text_door_lock}{' '}
97
97
  </Text>
@@ -8,7 +8,7 @@ import { useConfigGlobalState } from '../../iot/states';
8
8
  import { useUnwatchLGDeviceConfigControl } from '../../hooks/IoT';
9
9
  import styles from './NumberUpDownActionTemplateStyle';
10
10
  import { watchMultiConfigs } from '../../iot/Monitor';
11
- import { DEVICE_TYPE, TESTID } from '../../configs/Constants';
11
+ import { DEVICE_TYPE, AccessibilityLabel } from '../../configs/Constants';
12
12
 
13
13
  const NumberUpDownActionTemplate = ({
14
14
  actionGroup = {},
@@ -29,16 +29,19 @@ const NumberUpDownActionTemplate = ({
29
29
  // eslint-disable-next-line no-unused-vars
30
30
  const [configValues, setConfigValues] = useConfigGlobalState('configValues');
31
31
  const valueDefault = 28;
32
- const [value, setValue] = useState(valueDefault);
32
+ const [value, setValue] = useState();
33
33
 
34
34
  useEffect(() => {
35
35
  if (!config) {
36
+ setValue(valueDefault);
36
37
  return;
37
38
  }
38
39
 
39
40
  const configValue = configValues[config];
40
41
  if (configValue?.value !== null && configValue?.value !== undefined) {
41
42
  setValue(configValue.value);
43
+ } else {
44
+ setValue(valueDefault);
42
45
  }
43
46
  // eslint-disable-next-line react-hooks/exhaustive-deps
44
47
  }, [JSON.stringify(configValues)]);
@@ -50,7 +53,7 @@ const NumberUpDownActionTemplate = ({
50
53
  data = { temperature: actionValue };
51
54
  if (allow_config_store_value && config) {
52
55
  data.config_id = config;
53
- data.value = actionValue;
56
+ data.config_value = actionValue;
54
57
  }
55
58
  data = JSON.stringify(data);
56
59
  }
@@ -114,12 +117,12 @@ const NumberUpDownActionTemplate = ({
114
117
  <TouchableOpacity
115
118
  style={styles.downButton}
116
119
  onPress={doActionDown}
117
- testID={TESTID.NUMBER_ACTION_DOWN}
120
+ accessibilityLabel={AccessibilityLabel.NUMBER_ACTION_DOWN}
118
121
  >
119
122
  <IconOutline name="down" size={32} color={Colors.Primary} />
120
123
  </TouchableOpacity>
121
124
 
122
- <Text testID={'abcd'} type="H2">
125
+ <Text accessibilityLabel={'abcd'} type="H2">
123
126
  {value !== undefined ? (
124
127
  text_format.replace('{number}', value)
125
128
  ) : (
@@ -130,7 +133,7 @@ const NumberUpDownActionTemplate = ({
130
133
  <TouchableOpacity
131
134
  style={styles.upButton}
132
135
  onPress={doActionUp}
133
- testID={TESTID.NUMBER_ACTION_UP}
136
+ accessibilityLabel={AccessibilityLabel.NUMBER_ACTION_UP}
134
137
  >
135
138
  <IconOutline name="up" size={32} color={Colors.Primary} />
136
139
  </TouchableOpacity>
@@ -14,10 +14,13 @@ const ButtonWrapper = memo(
14
14
  isButtonReLockTiming,
15
15
  toggleSwitch,
16
16
  isEnabled,
17
- testID,
17
+ accessibilityLabel,
18
18
  }) => {
19
19
  return (
20
- <View style={styles.buttonWrapper} testID={testID}>
20
+ <View
21
+ style={styles.buttonWrapper}
22
+ accessibilityLabel={accessibilityLabel}
23
+ >
21
24
  {isButtonReLockTiming ? (
22
25
  <View style={styles.wrapHeadline}>
23
26
  <SvgBrightnessBlack />
@@ -4,7 +4,7 @@ import { Switch } from 'react-native';
4
4
 
5
5
  import AutoLock from '../index';
6
6
  import { mockSCStore } from '../../../../../context/mockStore';
7
- import { TESTID } from '../../../../../configs/Constants';
7
+ import { AccessibilityLabel } from '../../../../../configs/Constants';
8
8
  import { SCProvider } from '../../../../../context';
9
9
 
10
10
  const wrapComponent = () => (
@@ -18,13 +18,19 @@ describe('Test AutoLock', () => {
18
18
 
19
19
  const getElement = (instance) => {
20
20
  const buttonEnable = instance.findAll(
21
- (item) => item.props.testID === TESTID.AUTO_LOCK_BUTTON_ENABLE
21
+ (item) =>
22
+ item.props.accessibilityLabel ===
23
+ AccessibilityLabel.AUTO_LOCK_BUTTON_ENABLE
22
24
  );
23
25
  const buttonInstant = instance.findAll(
24
- (item) => item.props.testID === TESTID.AUTO_LOCK_BUTTON_INSTANT
26
+ (item) =>
27
+ item.props.accessibilityLabel ===
28
+ AccessibilityLabel.AUTO_LOCK_BUTTON_INSTANT
25
29
  );
26
30
  const buttonRelockTiming = instance.findAll(
27
- (item) => item.props.testID === TESTID.AUTO_LOCK_BUTTON_RELOCK_TIMING
31
+ (item) =>
32
+ item.props.accessibilityLabel ===
33
+ AccessibilityLabel.AUTO_LOCK_BUTTON_RELOCK_TIMING
28
34
  );
29
35
  return {
30
36
  buttonEnable,
@@ -4,7 +4,7 @@ import Slider from 'react-native-slider';
4
4
  import Text from '../../../Text';
5
5
  import { HeaderCustom } from '../../../Header';
6
6
  import ButtonWrapper from './ButtonWrapper';
7
- import { TESTID } from '../../../../configs/Constants';
7
+ import { AccessibilityLabel } from '../../../../configs/Constants';
8
8
  import styles from './AutoLockStyles';
9
9
  import t from '../../../../hooks/Common/useTranslations';
10
10
  import { Colors } from '../../../../configs';
@@ -25,16 +25,16 @@ const AutoLock = memo(() => {
25
25
  isButtonEnable
26
26
  toggleSwitch={handleToggleSwitch}
27
27
  isEnabled={isEnabled}
28
- testID={TESTID.AUTO_LOCK_BUTTON_ENABLE}
28
+ accessibilityLabel={AccessibilityLabel.AUTO_LOCK_BUTTON_ENABLE}
29
29
  />
30
30
  <ButtonWrapper
31
31
  isButtonInstant
32
- testID={TESTID.AUTO_LOCK_BUTTON_INSTANT}
32
+ accessibilityLabel={AccessibilityLabel.AUTO_LOCK_BUTTON_INSTANT}
33
33
  />
34
34
  <ButtonWrapper
35
35
  isButtonReLockTiming
36
36
  isEnabled={isEnabled}
37
- testID={TESTID.AUTO_LOCK_BUTTON_RELOCK_TIMING}
37
+ accessibilityLabel={AccessibilityLabel.AUTO_LOCK_BUTTON_RELOCK_TIMING}
38
38
  />
39
39
  <View style={styles.slider}>
40
40
  <Slider
@@ -8,7 +8,7 @@ import ButtonUnLock from '../../../../assets/images/Device/button-unlock.svg';
8
8
  import { useConfigGlobalState } from '../../../iot/states';
9
9
  import { useUnwatchLGDeviceConfigControl } from '../../../hooks/IoT';
10
10
  import { watchMultiConfigs } from '../../../iot/Monitor';
11
- import { DEVICE_TYPE, TESTID } from '../../../configs/Constants';
11
+ import { DEVICE_TYPE, AccessibilityLabel } from '../../../configs/Constants';
12
12
 
13
13
  const OnOffSmartLock = memo(({ actionGroup = {}, doAction, sensor = {} }) => {
14
14
  const t = useTranslations();
@@ -60,7 +60,7 @@ const OnOffSmartLock = memo(({ actionGroup = {}, doAction, sensor = {} }) => {
60
60
  <View>
61
61
  <TouchableOpacity
62
62
  onPress={handleActionSmartLock}
63
- testID={TESTID.BUTTON_ON_OFF}
63
+ accessibilityLabel={AccessibilityLabel.BUTTON_ON_OFF}
64
64
  style={styles.wrapButtonSmartLock}
65
65
  >
66
66
  {isUnlock ? (
@@ -19,7 +19,7 @@ const ButtonWrapper = ({ item, textHeadline }) => {
19
19
  };
20
20
 
21
21
  const ItemPasscode = memo(({ route }) => {
22
- const { item = {} } = route.params || {};
22
+ const { item = {} } = route?.params || {};
23
23
 
24
24
  return (
25
25
  <SafeAreaView style={styles.container}>
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { act, create } from 'react-test-renderer';
3
3
 
4
4
  import { mockSCStore } from '../../../../../context/mockStore';
5
- import { TESTID } from '../../../../../configs/Constants';
5
+ import { AccessibilityLabel } from '../../../../../configs/Constants';
6
6
  import { SCProvider } from '../../../../../context';
7
7
  import PasscodeList from '../index';
8
8
  import { TouchableOpacity } from 'react-native';
@@ -38,7 +38,7 @@ describe('Test SetupGeneratePasscode', () => {
38
38
  const instance = tree.root;
39
39
  const passcode_list = instance.findAll(
40
40
  (item) =>
41
- item.props.testID === TESTID.PASSCODE_LIST &&
41
+ item.props.accessibilityLabel === AccessibilityLabel.PASSCODE_LIST &&
42
42
  item.type === TouchableOpacity
43
43
  );
44
44
 
@@ -9,7 +9,7 @@ import t from '../../../../hooks/Common/useTranslations';
9
9
  import { Colors } from '../../../../configs';
10
10
  import Routes from '../../../../utils/Route';
11
11
  import styles from './PasscodeListStyles';
12
- import { TESTID } from '../../../../configs/Constants';
12
+ import { AccessibilityLabel } from '../../../../configs/Constants';
13
13
 
14
14
  const PasscodeList = memo(() => {
15
15
  const navigation = useNavigation();
@@ -51,7 +51,7 @@ const PasscodeList = memo(() => {
51
51
  <TouchableOpacity
52
52
  onPress={handleClickButton(item)}
53
53
  style={styles.buttonWrapper}
54
- testID={TESTID.PASSCODE_LIST}
54
+ accessibilityLabel={AccessibilityLabel.PASSCODE_LIST}
55
55
  >
56
56
  <View>
57
57
  <Text style={styles.textCode}>{item.code}</Text>