@eohjsc/react-native-smart-city 0.7.3 → 0.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (274) hide show
  1. package/assets/images/Automation-fill.svg +85 -0
  2. package/assets/images/Map/LocationPin.svg +10 -0
  3. package/assets/images/Scenario-filled.svg +22 -0
  4. package/assets/images/schedule-fill.svg +48 -0
  5. package/package.json +20 -17
  6. package/src/commons/Action/ItemQuickAction.js +1 -1
  7. package/src/commons/Action/__test__/ItemQuickAction.test.js +6 -6
  8. package/src/commons/ActionGroup/NumberUpDownActionTemplate.js +3 -3
  9. package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/ButtonWrapper.js +3 -3
  10. package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/__test__/index.test.js +5 -5
  11. package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/index.js +3 -3
  12. package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/ButtonWrapper.js +2 -2
  13. package/src/commons/ActionGroup/OnOffTemplate/OnOffSimpleTemplate.js +2 -2
  14. package/src/commons/ActionGroup/OptionsDropdownActionTemplate.js +2 -2
  15. package/src/commons/ActionGroup/SliderRangeTemplate.js +7 -7
  16. package/src/commons/ActionGroup/SmartTiviActionTemplate/SmartTiviActionTemplate.js +2 -2
  17. package/src/commons/ActionGroup/SmartTiviActionTemplate/component/CircleButton.js +5 -5
  18. package/src/commons/ActionGroup/SmartTiviActionTemplate/component/ControlPlay.js +5 -5
  19. package/src/commons/ActionGroup/TerminalBoxTemplate.js +2 -2
  20. package/src/commons/ActionGroup/TextBoxTemplate.js +2 -2
  21. package/src/commons/ActionGroup/ThreeButtonTemplate/__test__/ThreeButtonCircle.test.js +2 -2
  22. package/src/commons/ActionGroup/ThreeButtonTemplate/__test__/ThreeButtonDefault.test.js +2 -2
  23. package/src/commons/ActionGroup/TimerActionTemplate.js +6 -3
  24. package/src/commons/ActionGroup/TwoButtonTemplate/index.js +2 -2
  25. package/src/commons/ActionGroup/__test__/ColorPickerTemplate.test.js +9 -10
  26. package/src/commons/ActionGroup/__test__/OnOffSmartLock.test.js +5 -5
  27. package/src/commons/ActionGroup/__test__/OnOffTemplate.test.js +5 -5
  28. package/src/commons/ActionGroup/__test__/OptionsDropdownTemplate.test.js +8 -8
  29. package/src/commons/ActionGroup/__test__/StatesGridActionTemplate.test.js +3 -3
  30. package/src/commons/ActionGroup/__test__/TimerActionTemplate.test.js +6 -6
  31. package/src/commons/ActionGroup/__test__/TwoButtonTemplate.test.js +1 -1
  32. package/src/commons/ActionGroup/__test__/index.test.js +6 -6
  33. package/src/commons/ActionGroup/index.js +2 -2
  34. package/src/commons/ActionTemplate/__test__/index.test.js +4 -4
  35. package/src/commons/Automate/ItemAutomate.js +9 -41
  36. package/src/commons/Automate/ItemConditionScriptDetail.js +67 -0
  37. package/src/commons/Automate/ItemConditionScriptDetailStyles.js +46 -0
  38. package/src/commons/Automate/__test__/ItemAutomate.test.js +0 -21
  39. package/src/commons/BackDefault/index.js +2 -2
  40. package/src/commons/BottomButtonView/index.js +1 -0
  41. package/src/commons/ButtonPopup/index.js +3 -2
  42. package/src/commons/ChartAggregationOption/__test__/FourButtonFilterHistory.test.js +2 -2
  43. package/src/commons/Dashboard/MyPinnedSharedUnit/__test__/MyPinnedSharedUnit.test.js +8 -9
  44. package/src/commons/Dashboard/MyUnit/__test__/MyUnit.test.js +7 -7
  45. package/src/commons/DateTimeRangeChange/DateTimeButton.js +3 -3
  46. package/src/commons/DateTimeRangeChange/index.js +1 -1
  47. package/src/commons/Device/ConnectedViewHeader.js +2 -2
  48. package/src/commons/Device/Emergency/EmergencyDetail.js +3 -3
  49. package/src/commons/Device/Emergency/__test__/EmergencyButton.test.js +1 -1
  50. package/src/commons/Device/FlatListItems.js +20 -19
  51. package/src/commons/Device/Hanet/ItemHanetDevice.js +3 -3
  52. package/src/commons/Device/Hanet/ItemHanetDevice.test.js +3 -3
  53. package/src/commons/Device/HorizontalBarChart.js +54 -34
  54. package/src/commons/Device/ItemAddNew/index.js +2 -2
  55. package/src/commons/Device/ItemDevice.js +5 -21
  56. package/src/commons/Device/SonosSpeaker/index.js +3 -3
  57. package/src/commons/Device/WaterPurifierStatus/AlertStatusMachine.js +2 -2
  58. package/src/commons/Device/WaterQualitySensor/QualityIndicatorsItem.js +6 -2
  59. package/src/commons/DisplayChecking/index.js +2 -2
  60. package/src/commons/EmergencyButton/AlertSendConfirm.js +2 -2
  61. package/src/commons/FieldTemplate/ChooseUserField/index.js +2 -2
  62. package/src/commons/FieldTemplate/PasscodeField/__test__/index.test.js +3 -3
  63. package/src/commons/FieldTemplate/ScheduleField/__test__/index.test.js +6 -6
  64. package/src/commons/FlatListDnD/__test__/index.test.js +4 -4
  65. package/src/commons/FlatListDnD/index.js +12 -9
  66. package/src/commons/Grid/GridItem.js +10 -2
  67. package/src/commons/GroupCheckBox/__test__/GroupCheckBox.test.js +3 -3
  68. package/src/commons/Header/HeaderCustom.js +2 -2
  69. package/src/commons/Header/__test__/HeaderCT.test.js +3 -3
  70. package/src/commons/HeaderAni/index.js +2 -2
  71. package/src/commons/IconComponent/index.js +3 -3
  72. package/src/commons/ImagePicker/__test__/ImagePicker.test.js +5 -5
  73. package/src/commons/MediaPlayerDetail/__test__/MediaPlayerDetail.test.js +6 -4
  74. package/src/commons/MenuActionMore/MenuActionMoreStyles.js +2 -1
  75. package/src/commons/MenuActionMore/index.js +1 -1
  76. package/src/commons/NavBar/NavBarStyles.js +1 -1
  77. package/src/commons/NavBar/index.js +2 -2
  78. package/src/commons/OneTapTemplate/NumberUpDownActionTemplate.js +3 -3
  79. package/src/commons/OneTapTemplate/__test__/StatesGridActionTemplate.test.js +1 -1
  80. package/src/commons/Popover/__test__/index.test.js +3 -3
  81. package/src/commons/Processing/__test__/Connecting.test.js +4 -4
  82. package/src/commons/SearchLocation/index.js +3 -3
  83. package/src/commons/SelectActionCard/index.js +2 -2
  84. package/src/commons/SelectSubUnit/index.js +6 -2
  85. package/src/commons/SelectUnit/__test__/SelectUnit.test.js +5 -5
  86. package/src/commons/Sharing/BtnRemoveMember.js +2 -2
  87. package/src/commons/Sharing/StationDevicePermissions.js +2 -2
  88. package/src/commons/SubUnit/DeviceTemplate/ConfigAndEvaluation/ConfigAndEvaluation.js +2 -2
  89. package/src/commons/SubUnit/DeviceTemplate/ConfigValue/ConfigValue.js +2 -2
  90. package/src/commons/SubUnit/DeviceTemplate/EvaluationOverConfig/EvaluationOverConfig.js +2 -2
  91. package/src/commons/SubUnit/OneTap/ItemOneTap.js +6 -7
  92. package/src/commons/SubUnit/OneTap/__test__/SubUnitAutomate.test.js +0 -2
  93. package/src/commons/SubUnit/OneTap/index.js +9 -8
  94. package/src/commons/SubUnit/__test__/ShortDetail.test.js +8 -8
  95. package/src/commons/Unit/HeaderUnit/index.js +30 -22
  96. package/src/commons/Unit/SharedUnit.js +7 -7
  97. package/src/commons/Widgets/IFrame/__tests__/IFrame.test.js +9 -13
  98. package/src/commons/Widgets/IFrameWithConfig/IFrameWithConfig.js +34 -2
  99. package/src/commons/Widgets/IFrameWithConfig/__tests__/IFrameWithConfig.test.js +88 -8
  100. package/src/commons/WrapParallaxScrollView/index.js +9 -10
  101. package/src/configs/API.js +1 -1
  102. package/src/configs/AccessibilityLabel.js +2 -0
  103. package/src/configs/Constants.js +3 -3
  104. package/src/configs/Theme.js +1 -1
  105. package/src/hooks/Common/__test__/useAndroidTranslucentStatusBar.test.js +5 -5
  106. package/src/hooks/IoT/__test__/useHomeAssistantConnection.test.js +12 -12
  107. package/src/hooks/IoT/__test__/useRemoteControl.test.js +14 -7
  108. package/src/hooks/IoT/__test__/useWatchConfigs.test.js +3 -3
  109. package/src/hooks/IoT/useRemoteControl.js +24 -13
  110. package/src/hooks/useMqtt.js +2 -2
  111. package/src/iot/RemoteControl/Bluetooth.js +19 -22
  112. package/src/iot/RemoteControl/Internet.js +13 -5
  113. package/src/iot/RemoteControl/__test__/Internet.test.js +7 -7
  114. package/src/navigations/EmergencyContactsStack.js +4 -3
  115. package/src/navigations/SharedStack.js +2 -0
  116. package/src/navigations/UnitStack.js +56 -57
  117. package/src/screens/AQIGuide/index.js +0 -2
  118. package/src/screens/ActivityLog/index.js +2 -2
  119. package/src/screens/AddLocationMaps/__test__/index.test.js +12 -12
  120. package/src/screens/AddLocationMaps/index.js +16 -19
  121. package/src/screens/AddLocationMaps/indexStyle.js +1 -0
  122. package/src/screens/AddNewGateway/RenameNewDevices.js +2 -2
  123. package/src/screens/AddNewGateway/SelectDeviceType.js +1 -1
  124. package/src/screens/AddNewGateway/ShareWifiPassword.js +16 -15
  125. package/src/screens/AddNewGateway/__test__/AddNewGateway.test.js +7 -7
  126. package/src/screens/AddNewGateway/__test__/ConnectingWifiDevice.test.js +8 -8
  127. package/src/screens/AddNewGateway/__test__/ConnectingZigbeeDevice.test.js +7 -7
  128. package/src/screens/AddNewGateway/__test__/RenameNewDevices.test.js +8 -8
  129. package/src/screens/AddNewGateway/__test__/ScanGatewayQR.test.js +5 -5
  130. package/src/screens/AddNewGateway/__test__/SelectDeviceUnit.test.js +4 -4
  131. package/src/screens/AddNewGateway/__test__/SelectModbusGateway.test.js +6 -6
  132. package/src/screens/AddNewGateway/__test__/SelectZigbeeGateway.test.js +6 -6
  133. package/src/screens/AddNewGateway/__test__/ShareWifiPassword.test.js +0 -4
  134. package/src/screens/AddNewGateway/hooks/__Tests__/useWifiManage.test.js +2 -2
  135. package/src/screens/AllGateway/DetailConfigActionModbus/__test__/index.test.js +6 -6
  136. package/src/screens/AllGateway/DeviceInternalDetail/__test__/index.test.js +19 -17
  137. package/src/screens/AllGateway/DeviceModbusDetail/__test__/index.test.js +19 -17
  138. package/src/screens/AllGateway/DeviceZigbeeDetail/__test__/index.test.js +18 -16
  139. package/src/screens/AllGateway/GatewayDetail/__test__/index.test.js +43 -35
  140. package/src/screens/AllGateway/GatewayInfo/__test__/index.test.js +38 -22
  141. package/src/screens/AllGateway/__test__/index.test.js +6 -6
  142. package/src/screens/AllGateway/components/Detail/__test__/index.test.js +3 -5
  143. package/src/screens/AllGateway/components/GatewayItem/__test__/index.test.js +3 -3
  144. package/src/screens/AllGateway/components/TabPaneCT/__test__/index.test.js +6 -6
  145. package/src/screens/AllGateway/hooks/__test__/index.test.js +2 -2
  146. package/src/screens/AllGateway/test-utils.js +3 -4
  147. package/src/screens/Automate/AddNewAction/ChooseAction.js +17 -3
  148. package/src/screens/Automate/AddNewAction/ChooseConfig.js +7 -6
  149. package/src/screens/Automate/AddNewAction/NewActionWrapper.js +8 -8
  150. package/src/screens/Automate/AddNewAction/SelectControlDevices.js +30 -20
  151. package/src/screens/Automate/AddNewAction/SelectMonitorDevices.js +17 -10
  152. package/src/screens/Automate/AddNewAction/SetupConfigCondition.js +58 -44
  153. package/src/screens/Automate/AddNewAction/SetupScriptDelay.js +1 -1
  154. package/src/screens/Automate/AddNewAction/SetupScriptNotify.js +3 -3
  155. package/src/screens/Automate/AddNewAction/Styles/SetupSensorStyles.js +20 -4
  156. package/src/screens/Automate/AddNewAction/__test__/ChooseAction.test.js +12 -12
  157. package/src/screens/Automate/AddNewAction/__test__/SelectControlDevices.test.js +14 -8
  158. package/src/screens/Automate/AddNewAction/__test__/SelectMonitorDevices.test.js +13 -7
  159. package/src/screens/Automate/AddNewAction/__test__/SetupConfigCondition.test.js +54 -15
  160. package/src/screens/Automate/AddNewAction/__test__/SetupScriptDelay.test.js +9 -9
  161. package/src/screens/Automate/AddNewAction/__test__/SetupScriptNotify.test.js +39 -10
  162. package/src/screens/Automate/AddNewAutoSmart/AddTypeSmart.js +10 -10
  163. package/src/screens/Automate/AddNewAutoSmart/__test__/AddNewAutoSmart.test.js +13 -8
  164. package/src/screens/Automate/Components/InputName.js +10 -7
  165. package/src/screens/Automate/EditActionsList/__tests__/UpdateActionScript.test.js +8 -8
  166. package/src/screens/Automate/EditActionsList/__tests__/UpdateDelayScript.test.js +6 -6
  167. package/src/screens/Automate/EditActionsList/__tests__/UpdateNotifyScript.test.js +7 -7
  168. package/src/screens/Automate/EditActionsList/index.js +19 -17
  169. package/src/screens/Automate/MultiUnits.js +19 -22
  170. package/src/screens/Automate/OneTap/__test__/AddNewOneTap.test.js +18 -8
  171. package/src/screens/Automate/Scenario/__test__/AddNewOneTap.test.js +15 -7
  172. package/src/screens/Automate/ScriptDetail/Components/AddActionScript.js +14 -6
  173. package/src/screens/Automate/ScriptDetail/Components/RenameScript.js +4 -7
  174. package/src/screens/Automate/ScriptDetail/__test__/index.test.js +56 -18
  175. package/src/screens/Automate/ScriptDetail/__test__/useStarredScript.test.js +6 -6
  176. package/src/screens/Automate/ScriptDetail/index.js +105 -41
  177. package/src/screens/Automate/SetSchedule/__test__/SelectWeekday.test.js +4 -4
  178. package/src/screens/Automate/SetSchedule/__test__/index.test.js +29 -18
  179. package/src/screens/Automate/SetSchedule/components/RowItem.js +5 -5
  180. package/src/screens/Automate/SetSchedule/index.js +8 -7
  181. package/src/screens/Automate/Styles/indexStyles.js +1 -1
  182. package/src/screens/Automate/__test__/MultiUnits.test.js +1 -4
  183. package/src/screens/Automate/__test__/index.test.js +0 -1
  184. package/src/screens/Automate/index.js +36 -34
  185. package/src/screens/ChangePosition/__test__/index.test.js +6 -6
  186. package/src/screens/ChangePosition/index.js +2 -1
  187. package/src/screens/Device/EditDevice/__test__/EditDevice.test.js +13 -13
  188. package/src/screens/Device/EditDevice/index.js +4 -4
  189. package/src/screens/Device/__test__/BluetoothDevice.test.js +300 -0
  190. package/src/screens/Device/__test__/detail.test.js +14 -14
  191. package/src/screens/Device/__test__/mqttDetail.test.js +9 -9
  192. package/src/screens/Device/components/BluetoothDevice.js +135 -0
  193. package/src/screens/Device/components/SensorDisplayItem.js +9 -8
  194. package/src/screens/Device/detail.js +70 -62
  195. package/src/screens/Device/hooks/useEvaluateValue.js +1 -1
  196. package/src/screens/Drawer/Drawer.test.js +2 -2
  197. package/src/screens/Drawer/index.js +3 -3
  198. package/src/screens/EmergencyContacts/EmergencyContactsList.js +8 -4
  199. package/src/screens/EmergencyContacts/EmergencyContactsSelectContacts.js +3 -3
  200. package/src/screens/EmergencyContacts/__test__/EmergencyContactsSelectContacts.test.js +7 -7
  201. package/src/screens/EmergencySetting/components/DropDownItem.js +2 -2
  202. package/src/screens/EnterPassword/__test__/EnterPassword.test.js +8 -8
  203. package/src/screens/GuestInfo/components/RowGuestInfo.js +2 -2
  204. package/src/screens/GuestInfo/components/__test__/AccessScheduleSheet.test.js +3 -3
  205. package/src/screens/GuestInfo/index.js +2 -2
  206. package/src/screens/HanetCamera/ManageAccess.js +3 -3
  207. package/src/screens/HanetCamera/MemberInfo.js +2 -2
  208. package/src/screens/HanetCamera/__test__/Detail.test.js +9 -9
  209. package/src/screens/HanetCamera/__test__/MemberInfo.test.js +10 -10
  210. package/src/screens/HanetCamera/components/RequestFaceIDPopup.js +2 -2
  211. package/src/screens/ManageAccess/index.js +3 -3
  212. package/src/screens/MoveToAnotherSubUnit/__test__/index.test.js +9 -9
  213. package/src/screens/Notification/__test__/Notification.test.js +9 -9
  214. package/src/screens/Notification/components/NotificationItem.js +3 -4
  215. package/src/screens/Notification/index.js +3 -3
  216. package/src/screens/Notification/styles/NotificationItemStyles.js +0 -1
  217. package/src/screens/PlayBackCamera/__test__/index.test.js +1 -1
  218. package/src/screens/ScanChipQR/components/QRScan/__test__/QRScan.test.js +1 -1
  219. package/src/screens/ScanChipQR/components/QRScan/index.js +3 -3
  220. package/src/screens/SelectUnit/__test__/index.test.js +8 -8
  221. package/src/screens/SelectUnit/index.js +4 -4
  222. package/src/screens/SharedUnit/TabHeader.js +2 -2
  223. package/src/screens/Sharing/Components/EndDevice.js +3 -3
  224. package/src/screens/Sharing/UnitMemberList.js +2 -2
  225. package/src/screens/Sharing/__test__/UpdateShareDevice.test.js +7 -7
  226. package/src/screens/SideMenuDetail/__test__/index.test.js +8 -8
  227. package/src/screens/SmartAccount/Connecting/index.js +5 -5
  228. package/src/screens/SmartAccount/ListDevice/__test__/ListDevice.test.js +8 -8
  229. package/src/screens/SmartAccount/SuccessfullyConnected/__test__/SuccessfullyConnected.test.js +7 -7
  230. package/src/screens/SmartAccount/SuccessfullyConnected/index.js +2 -2
  231. package/src/screens/SmartAccount/__test__/Connecting.test.js +6 -6
  232. package/src/screens/SmartAccount/__test__/SmartAccount.test.js +10 -10
  233. package/src/screens/SmartIr/__test__/GroupButtonByType.test.js +3 -2
  234. package/src/screens/SmartIr/components/GroupButtonByType/GroupButtonByType.js +2 -2
  235. package/src/screens/SmartIr/components/SelectBrand.js +2 -2
  236. package/src/screens/SubUnit/AddSubUnit.js +28 -26
  237. package/src/screens/SubUnit/AddSubUnitStyles.js +10 -4
  238. package/src/screens/SubUnit/EditSubUnit.js +12 -11
  239. package/src/screens/SubUnit/ManageSubUnit.js +3 -3
  240. package/src/screens/SubUnit/__test__/AddSubUnit.test.js +13 -13
  241. package/src/screens/SubUnit/__test__/EditSubUnit.test.js +3 -3
  242. package/src/screens/Template/EditTemplate.js +6 -4
  243. package/src/screens/Template/__test__/EditTemplate.test.js +7 -7
  244. package/src/screens/Template/__test__/detail.test.js +4 -4
  245. package/src/screens/Template/__test__/index.test.js +1 -1
  246. package/src/screens/UVIndexGuide/index.js +2 -4
  247. package/src/screens/Unit/Detail.js +1 -5
  248. package/src/screens/Unit/MoreMenu.js +6 -5
  249. package/src/screens/Unit/SelectAddToFavorites.js +2 -2
  250. package/src/screens/Unit/SelectAddress.js +16 -12
  251. package/src/screens/Unit/Station/__test__/index.test.js +1 -1
  252. package/src/screens/Unit/__test__/MoreMenu.test.js +5 -1
  253. package/src/screens/Unit/__test__/SelectAddToFavorites.test.js +9 -9
  254. package/src/screens/Unit/__test__/SelectAddress.test.js +11 -17
  255. package/src/screens/Unit/__test__/Summaries.test.js +7 -7
  256. package/src/screens/Unit/components/AutomateScript/index.js +5 -5
  257. package/src/screens/Unit/components/ButtonWrapper/index.js +3 -3
  258. package/src/screens/Unit/components/Header/index.js +2 -2
  259. package/src/screens/Unit/components/SharedUnit/index.js +5 -5
  260. package/src/screens/Unit/components/__test__/AutomateScript.test.js +3 -3
  261. package/src/screens/Unit/components/__test__/SharedUnit.test.js +8 -8
  262. package/src/screens/Unit/hook/__test__/useUnitConnectRemoteDevices.test.js +2 -2
  263. package/src/screens/UnitSummary/components/AirQuality/index.js +6 -11
  264. package/src/screens/UnitSummary/components/WaterQuality/Item/index.js +5 -5
  265. package/src/screens/UnitSummary/index.js +6 -2
  266. package/src/utils/Apis/axios.js +5 -5
  267. package/src/utils/Functions/ShortEmail.js +1 -0
  268. package/src/utils/I18n/translations/en.js +6 -3
  269. package/src/utils/I18n/translations/vi.js +8 -4
  270. package/src/utils/__test__/Utils.test.js +16 -16
  271. package/src/utils/bluetooth.js +3 -0
  272. package/assets/images/OneTap.svg +0 -14
  273. package/assets/images/Schedule.svg +0 -39
  274. package/assets/images/ValueChange.svg +0 -49
@@ -239,6 +239,7 @@ export default {
239
239
  BUTTON_ADD_SCRIPT_ACTION: 'BUTTON_ADD_SCRIPT_ACTION',
240
240
  ICON_CLOSE: 'ICON_CLOSE',
241
241
  ICON_MORE: 'ICON_MORE',
242
+ ICON_MENU_POPUP: 'ICON_MENU_POPUP',
242
243
  ICON_ARROW_RIGHT: 'ICON_ARROW_RIGHT',
243
244
  TEXT_AUTOMATE_NAME: 'TEXT_AUTOMATE_NAME',
244
245
  AUTOMATE_LIST_SCRIPT_ACTION: 'AUTOMATE_LIST_SCRIPT_ACTION',
@@ -698,6 +699,7 @@ export default {
698
699
  'GATEWAY_INFO_BUTTON_GOTO_CONNECTION_METHODS',
699
700
  GATEWAY_INFO_BUTTON_DELETE_GATEWAY: 'GATEWAY_INFO_BUTTON_DELETE_GATEWAY',
700
701
  MENU_POPPER_MORE: 'MENU_POPPER_MORE',
702
+ MENU_POPPER_MORE_2: 'MENU_POPPER_MORE_2',
701
703
  GATEWAY_CONNECTION_METHODS_TEXT: 'GATEWAY_CONNECTION_METHODS_TEXT',
702
704
  //Notification
703
705
  CUSTOM_TEXT: 'CUSTOM_TEXT',
@@ -1,9 +1,9 @@
1
1
  export { default as AccessibilityLabel } from './AccessibilityLabel';
2
2
  import { Platform, Dimensions, StatusBar } from 'react-native';
3
3
  import { RFValue } from 'react-native-responsive-fontsize';
4
- import OneTap from '../../assets/images/OneTap.svg';
5
- import ValueChange from '../../assets/images/ValueChange.svg';
6
- import Schedule from '../../assets/images/Schedule.svg';
4
+ import OneTap from '../../assets/images/Scenario-filled.svg';
5
+ import ValueChange from '../../assets/images/Automation-fill.svg';
6
+ import Schedule from '../../assets/images/schedule-fill.svg';
7
7
  import Event from '../../assets/images/Event.svg';
8
8
 
9
9
  const X_WIDTH = 375;
@@ -86,7 +86,7 @@ export default StyleSheet.create({
86
86
  alignItems: 'center',
87
87
  },
88
88
  menuIcon: {
89
- paddingLeft: 16,
89
+ paddingRight: 10,
90
90
  height: '100%',
91
91
  justifyContent: 'center',
92
92
  },
@@ -1,10 +1,10 @@
1
+ import { useNavigation } from '@react-navigation/native';
2
+ import { renderHook } from '@testing-library/react-hooks';
1
3
  import React from 'react';
2
4
  import { Platform } from 'react-native';
3
- import { renderHook } from '@testing-library/react-hooks';
4
- import { useAndroidTranslucentStatusBar } from '../index';
5
5
  import { SCProvider } from '../../../context';
6
6
  import { mockSCStore } from '../../../context/mockStore';
7
- import { useNavigation } from '@react-navigation/native';
7
+ import { useAndroidTranslucentStatusBar } from '../index';
8
8
 
9
9
  const mockedSetAction = jest.fn();
10
10
 
@@ -28,7 +28,7 @@ describe('test useAndroidTranslucentStatusBar', () => {
28
28
  wrapper,
29
29
  }
30
30
  );
31
- expect(addListener).not.toBeCalled();
31
+ expect(addListener).not.toHaveBeenCalled();
32
32
  });
33
33
 
34
34
  it('test useAndroidTranslucentStatusBar ios', async () => {
@@ -39,6 +39,6 @@ describe('test useAndroidTranslucentStatusBar', () => {
39
39
  wrapper,
40
40
  }
41
41
  );
42
- expect(addListener).not.toBeCalled();
42
+ expect(addListener).not.toHaveBeenCalled();
43
43
  });
44
44
  });
@@ -1,13 +1,13 @@
1
- import React from 'react';
2
1
  import { act, renderHook } from '@testing-library/react-hooks';
3
- import { createConnection, getStates } from 'home-assistant-js-websocket';
4
2
  import MockAdapter from 'axios-mock-adapter';
5
- import api from '../../../utils/Apis/axios';
6
- import { useHomeAssistantConnection } from '../index';
3
+ import { createConnection, getStates } from 'home-assistant-js-websocket';
4
+ import React from 'react';
5
+ import { API } from '../../../configs';
7
6
  import { SCProvider } from '../../../context';
8
- import { mockSCStore } from '../../../context/mockStore';
9
7
  import { Action } from '../../../context/actionType';
10
- import { API } from '../../../configs';
8
+ import { mockSCStore } from '../../../context/mockStore';
9
+ import api from '../../../utils/Apis/axios';
10
+ import { useHomeAssistantConnection } from '../index';
11
11
 
12
12
  const mock = new MockAdapter(api.axiosInstance);
13
13
 
@@ -124,7 +124,7 @@ describe('Test useHomeAssistantConnection', () => {
124
124
  await act(async () => {
125
125
  await result.current.connectHomeAssistant(options);
126
126
  });
127
- expect(mockedSetAction).toBeCalledWith(
127
+ expect(mockedSetAction).toHaveBeenCalledWith(
128
128
  Action.SET_HOME_ASSISTANT_CONNECTIONS,
129
129
  conns
130
130
  );
@@ -145,7 +145,7 @@ describe('Test useHomeAssistantConnection', () => {
145
145
  await act(async () => {
146
146
  await result.current.connectHomeAssistant(options);
147
147
  });
148
- expect(mockedSetAction).toBeCalledWith(
148
+ expect(mockedSetAction).toHaveBeenCalledWith(
149
149
  Action.SET_HOME_ASSISTANT_CONNECTIONS,
150
150
  conns
151
151
  );
@@ -167,12 +167,12 @@ describe('Test useHomeAssistantConnection', () => {
167
167
  await act(async () => {
168
168
  await result.current.connectHomeAssistant(options);
169
169
  });
170
- expect(mockedSetAction).toBeCalledTimes(2);
171
- expect(mockedSetAction).toBeCalledWith(
170
+ expect(mockedSetAction).toHaveBeenCalledTimes(2);
171
+ expect(mockedSetAction).toHaveBeenCalledWith(
172
172
  Action.SET_HOME_ASSISTANT_CONNECTIONS,
173
173
  conns
174
174
  );
175
- expect(mockedSetAction).toBeCalledWith(Action.LIST_DEVICE_TYPES, {
175
+ expect(mockedSetAction).toHaveBeenCalledWith(Action.LIST_DEVICE_TYPES, {
176
176
  chipId: options[0].chip_id,
177
177
  sentEmail: true,
178
178
  });
@@ -190,7 +190,7 @@ describe('Test useHomeAssistantConnection', () => {
190
190
  await act(async () => {
191
191
  await result.current.disconnectHomeAssistant(conns, options);
192
192
  });
193
- expect(mockedSetAction).toBeCalledWith(
193
+ expect(mockedSetAction).toHaveBeenCalledWith(
194
194
  Action.SET_HOME_ASSISTANT_CONNECTIONS,
195
195
  {}
196
196
  );
@@ -81,7 +81,8 @@ describe('Test useRemoteControl', () => {
81
81
  sensor,
82
82
  action,
83
83
  data,
84
- userId
84
+ userId,
85
+ false
85
86
  );
86
87
  expect(sendCommandOverInternet).not.toBeCalled();
87
88
  expect(sendCommandOverHomeAssistant).not.toBeCalled();
@@ -106,13 +107,15 @@ describe('Test useRemoteControl', () => {
106
107
  sensor,
107
108
  action,
108
109
  data,
109
- userId
110
+ userId,
111
+ false
110
112
  );
111
113
  expect(sendCommandOverInternet).toBeCalledWith(
112
114
  sensor,
113
115
  action,
114
116
  data,
115
- 'bluetooth'
117
+ 'bluetooth',
118
+ false
116
119
  );
117
120
  expect(sendCommandOverInternet).toBeCalledTimes(1);
118
121
  expect(sendCommandOverHomeAssistant).not.toBeCalled();
@@ -143,7 +146,8 @@ describe('Test useRemoteControl', () => {
143
146
  sensor,
144
147
  action,
145
148
  data,
146
- userId
149
+ userId,
150
+ false
147
151
  );
148
152
  expect(sendCommandOverInternet).not.toBeCalled();
149
153
  expect(sendCommandOverHomeAssistant).not.toBeCalled();
@@ -181,7 +185,8 @@ describe('Test useRemoteControl', () => {
181
185
  sensor,
182
186
  action,
183
187
  data,
184
- userId
188
+ userId,
189
+ false
185
190
  );
186
191
  expect(sendCommandOverHomeAssistant).not.toBeCalled();
187
192
  });
@@ -202,7 +207,8 @@ describe('Test useRemoteControl', () => {
202
207
  sensor,
203
208
  action,
204
209
  data,
205
- 'internet'
210
+ 'internet',
211
+ false
206
212
  );
207
213
  expect(sendCommandOverInternet).toBeCalledTimes(1);
208
214
  expect(sendCommandOverBluetooth).not.toBeCalled();
@@ -303,7 +309,8 @@ describe('Test useRemoteControl', () => {
303
309
  sensor,
304
310
  action,
305
311
  data,
306
- 'bluetooth'
312
+ 'bluetooth',
313
+ false
307
314
  );
308
315
  expect(sendCommandOverBluetooth).toBeCalledTimes(6);
309
316
  expect(sendCommandOverInternet).toBeCalledTimes(1);
@@ -1,9 +1,9 @@
1
- import React, { useContext } from 'react';
2
1
  import { renderHook } from '@testing-library/react-hooks';
2
+ import React, { useContext } from 'react';
3
3
  import { SCProvider } from '../../../context';
4
4
  import { mockSCStore } from '../../../context/mockStore';
5
+ import { unwatchMultiConfigs, watchMultiConfigs } from '../../../iot/Monitor';
5
6
  import { useWatchConfigs } from '../index';
6
- import { watchMultiConfigs, unwatchMultiConfigs } from '../../../iot/Monitor';
7
7
 
8
8
  const mockedSetAction = jest.fn();
9
9
 
@@ -27,6 +27,6 @@ describe('Test useWatchConfigs', () => {
27
27
  wrapper,
28
28
  });
29
29
  jest.runOnlyPendingTimers();
30
- expect(watchMultiConfigs).toBeCalledWith([1]);
30
+ expect(watchMultiConfigs).toHaveBeenCalledWith([1]);
31
31
  });
32
32
  });
@@ -1,15 +1,15 @@
1
+ import NetInfo from '@react-native-community/netinfo';
2
+ import { t } from 'i18n-js';
1
3
  import { useCallback } from 'react';
2
4
  import { useSCContextSelector } from '../../context';
3
- import { sendCommandOverHomeAssistant } from '../../iot/RemoteControl/HomeAssistant';
4
- import { sendCommandOverInternet } from '../../iot/RemoteControl/Internet';
5
5
  import {
6
- sendCommandOverBluetooth,
7
- SEND_COMMAND_OVER_BLUETOOTH_FAIL,
8
6
  BLUETOOOH_DEVICE_UNSTABLE,
7
+ SEND_COMMAND_OVER_BLUETOOTH_FAIL,
8
+ sendCommandOverBluetooth,
9
9
  } from '../../iot/RemoteControl/Bluetooth';
10
+ import { sendCommandOverHomeAssistant } from '../../iot/RemoteControl/HomeAssistant';
11
+ import { sendCommandOverInternet } from '../../iot/RemoteControl/Internet';
10
12
  import { ToastBottomHelper } from '../../utils/Utils';
11
- import { t } from 'i18n-js';
12
- import NetInfo from '@react-native-community/netinfo';
13
13
 
14
14
  const handleReconnectionDeviceBle = async (device, action, data, userId) => {
15
15
  for (let i = 0; i < 5; i++) {
@@ -26,13 +26,13 @@ const handleReconnectionDeviceBle = async (device, action, data, userId) => {
26
26
  return SEND_COMMAND_OVER_BLUETOOTH_FAIL;
27
27
  };
28
28
 
29
- const useRemoteControl = () => {
29
+ const useRemoteControl = (bluetoothDevice) => {
30
30
  const homeAssistantConnections = useSCContextSelector(
31
31
  (state) => state.iot.homeassistant.connections
32
32
  );
33
33
 
34
34
  const sendRemoteCommand = useCallback(
35
- async (device, action, data, userId) => {
35
+ async (device, action, data, userId, silent = false) => {
36
36
  // No action, raise not authorized
37
37
  let result = false;
38
38
  if (!action) {
@@ -41,9 +41,18 @@ const useRemoteControl = () => {
41
41
  );
42
42
  return result;
43
43
  }
44
-
45
44
  if (action.command_prefer_over_bluetooth) {
46
- let res = await sendCommandOverBluetooth(device, action, data, userId);
45
+ // custom control for i/o pin over bluetooth
46
+ if (bluetoothDevice?.isConnected && action.arduino_action) {
47
+ return bluetoothDevice.control(action, data, silent);
48
+ }
49
+ let res = await sendCommandOverBluetooth(
50
+ device,
51
+ action,
52
+ data,
53
+ userId,
54
+ silent
55
+ );
47
56
  if (res === BLUETOOOH_DEVICE_UNSTABLE) {
48
57
  res = await handleReconnectionDeviceBle(device, action, data, userId);
49
58
  }
@@ -57,7 +66,8 @@ const useRemoteControl = () => {
57
66
  device,
58
67
  action,
59
68
  data,
60
- 'bluetooth'
69
+ 'bluetooth',
70
+ silent
61
71
  );
62
72
  }
63
73
  return result;
@@ -80,7 +90,8 @@ const useRemoteControl = () => {
80
90
  device,
81
91
  action,
82
92
  data,
83
- action.command_prefer_over_bluetooth ? 'bluetooth' : 'internet'
93
+ action.command_prefer_over_bluetooth ? 'bluetooth' : 'internet',
94
+ silent
84
95
  );
85
96
  }
86
97
 
@@ -95,7 +106,7 @@ const useRemoteControl = () => {
95
106
 
96
107
  return await sendCommandOverInternet(device, action, data, 'internet');
97
108
  },
98
- [homeAssistantConnections]
109
+ [bluetoothDevice, homeAssistantConnections]
99
110
  );
100
111
 
101
112
  return sendRemoteCommand;
@@ -1,9 +1,9 @@
1
1
  import mqtt from 'precompiled-mqtt/dist/mqtt.browser';
2
- import { useState, useEffect, useMemo, useRef } from 'react';
2
+ import { useEffect, useMemo, useRef, useState } from 'react';
3
3
 
4
4
  import API from '../configs/API';
5
- import { axiosGet } from '../utils/Apis/axios';
6
5
  import { handleMqttMessage } from '../iot/mqtt';
6
+ import { axiosGet } from '../utils/Apis/axios';
7
7
 
8
8
  const useChipJsonConfiguration = (dashboardId) => {
9
9
  const [chips, setChips] = useState([]);
@@ -1,15 +1,15 @@
1
1
  /* eslint-disable promise/prefer-await-to-callbacks */
2
2
  import base64 from 'react-native-base64';
3
- import { BleManager, ScanMode } from 'react-native-ble-plx';
3
+ import { ScanMode } from 'react-native-ble-plx';
4
4
  import CryptoAesCbc from 'react-native-crypto-aes-cbc';
5
5
 
6
6
  import { base64ToHex, ToastBottomHelper } from '../../utils/Utils';
7
7
  import { BLE } from '../../configs';
8
8
  import t from '../../hooks/Common/useTranslations';
9
+ import { bleManager } from '../../utils/bluetooth';
9
10
 
10
11
  const bluetoothDevices = {};
11
12
  const needToScanDevices = [];
12
- const bleManager = new BleManager();
13
13
 
14
14
  let isScanning = false;
15
15
 
@@ -98,7 +98,8 @@ export const sendCommandOverBluetooth = async (
98
98
  sensor,
99
99
  action,
100
100
  data,
101
- userID
101
+ userID,
102
+ silent
102
103
  ) => {
103
104
  const bluetooth = sensor?.remote_control_options?.bluetooth;
104
105
  let device = null;
@@ -115,7 +116,8 @@ export const sendCommandOverBluetooth = async (
115
116
  user: userID,
116
117
  },
117
118
  false,
118
- bluetooth?.is_use_secret_key
119
+ bluetooth?.is_use_secret_key,
120
+ silent
119
121
  );
120
122
  return result;
121
123
  };
@@ -124,18 +126,6 @@ export const getDeviceByName = (name) => {
124
126
  return bluetoothDevices[name];
125
127
  };
126
128
 
127
- export const isDeviceConnected = (deviceName) => {
128
- return !!bluetoothDevices[deviceName];
129
- };
130
-
131
- export const subcribeCharacteristicNotify = async (device, onListener) => {
132
- return await device.monitorCharacteristicForService(
133
- BLE.BLE_REMOTE_SERVICE_UUID,
134
- BLE.BLE_REMOTE_CHARACTERISTIC_UUID_TX,
135
- onListener
136
- );
137
- };
138
-
139
129
  export const readCharacteristic = async (
140
130
  device,
141
131
  serviceUUID = BLE.BLE_REMOTE_SERVICE_UUID,
@@ -151,13 +141,16 @@ export const sendDataOverBluetooth = async (
151
141
  device = null,
152
142
  data,
153
143
  keepConnect = false,
154
- isUseSecretKey = false
144
+ isUseSecretKey = false,
145
+ silent
155
146
  ) => {
156
147
  if (!device) {
157
148
  return SEND_COMMAND_OVER_BLUETOOTH_FAIL;
158
149
  }
159
150
 
160
- ToastBottomHelper.error(t('Sending command via bluetooth'));
151
+ if (!silent) {
152
+ ToastBottomHelper.info(t('Sending command via bluetooth'));
153
+ }
161
154
 
162
155
  let connectedDevice = null;
163
156
  let fullDataDevice = null;
@@ -196,9 +189,11 @@ export const sendDataOverBluetooth = async (
196
189
  hasResponse = true;
197
190
  const notify = error ? '' : base64.decode(characteristic.value);
198
191
  if (notify === BLE.BLE_RESPONSE_OK) {
199
- ToastBottomHelper.success(
200
- t('control_device_via_bluetooth_successfully')
201
- );
192
+ if (!silent) {
193
+ ToastBottomHelper.success(
194
+ t('control_device_via_bluetooth_successfully')
195
+ );
196
+ }
202
197
  if (!keepConnect) {
203
198
  await connectedDevice.cancelConnection();
204
199
  }
@@ -234,7 +229,9 @@ export const sendDataOverBluetooth = async (
234
229
  base64.encode(JSON.stringify(data))
235
230
  );
236
231
  }
237
- ToastBottomHelper.error(t('command_is_sent_to_device_via_bluetooth'));
232
+ if (!silent) {
233
+ ToastBottomHelper.info(t('command_is_sent_to_device_via_bluetooth'));
234
+ }
238
235
  } catch (e) {
239
236
  await connectedDevice.cancelConnection();
240
237
  ToastBottomHelper.error(t('command_is_fail_to_send_via_bluetooth'));
@@ -1,10 +1,16 @@
1
1
  import t from '../../hooks/Common/useTranslations';
2
2
 
3
- import { ToastBottomHelper } from '../../utils/Utils';
4
- import { axiosPost } from '../../utils/Apis/axios';
5
3
  import { API } from '../../configs';
4
+ import { axiosPost } from '../../utils/Apis/axios';
5
+ import { ToastBottomHelper } from '../../utils/Utils';
6
6
 
7
- export const sendCommandOverInternet = async (sensor, action, data, source) => {
7
+ export const sendCommandOverInternet = async (
8
+ sensor,
9
+ action,
10
+ data,
11
+ source,
12
+ silent
13
+ ) => {
8
14
  if (data !== null) {
9
15
  if (Number.isInteger(data)) {
10
16
  data = data.toString(16).toUpperCase();
@@ -13,13 +19,15 @@ export const sendCommandOverInternet = async (sensor, action, data, source) => {
13
19
  if (typeof data === 'object') {
14
20
  data = JSON.stringify(data);
15
21
  }
16
- ToastBottomHelper.success(t('Sending command via internet'));
22
+ if (!silent) {
23
+ ToastBottomHelper.info(t('Sending command via internet'));
24
+ }
17
25
  const { success } = await axiosPost(API.DEVICE.TRIGGER_ACTION(sensor.id), {
18
26
  key: action.key,
19
27
  data,
20
28
  source,
21
29
  });
22
- if (success) {
30
+ if (success && !silent) {
23
31
  ToastBottomHelper.success(t('Command is sent to device via internet'));
24
32
  }
25
33
  return success;
@@ -1,8 +1,8 @@
1
- import Toast from 'react-native-toast-message';
2
1
  import MockAdapter from 'axios-mock-adapter';
3
- import { sendCommandOverInternet } from '../Internet';
4
- import api from '../../../utils/Apis/axios';
2
+ import Toast from 'react-native-toast-message';
5
3
  import { API } from '../../../configs';
4
+ import api from '../../../utils/Apis/axios';
5
+ import { sendCommandOverInternet } from '../Internet';
6
6
 
7
7
  const mock = new MockAdapter(api.axiosInstance);
8
8
 
@@ -14,24 +14,24 @@ describe('Test IOT Remote Control Internet', () => {
14
14
  it('Trigger action via request POST', async () => {
15
15
  mock.onPost(API.DEVICE.TRIGGER_ACTION()).reply(200);
16
16
  await sendCommandOverInternet({}, {}, 'internet');
17
- expect(Toast.show).toBeCalledTimes(2);
17
+ expect(Toast.show).toHaveBeenCalledTimes(2);
18
18
  });
19
19
 
20
20
  it('Trigger action via request POST with data isInteger', async () => {
21
21
  mock.onPost(API.DEVICE.TRIGGER_ACTION()).reply(200);
22
22
  await sendCommandOverInternet({}, {}, 1);
23
- expect(Toast.show).toBeCalledTimes(2);
23
+ expect(Toast.show).toHaveBeenCalledTimes(2);
24
24
  });
25
25
 
26
26
  it('Trigger action via request POST with data is null', async () => {
27
27
  mock.onPost(API.DEVICE.TRIGGER_ACTION()).reply(200);
28
28
  await sendCommandOverInternet({}, {}, null);
29
- expect(Toast.show).toBeCalledTimes(2);
29
+ expect(Toast.show).toHaveBeenCalledTimes(2);
30
30
  });
31
31
 
32
32
  it('Trigger action fail show error', async () => {
33
33
  mock.onPost(API.DEVICE.TRIGGER_ACTION()).reply(400);
34
34
  await sendCommandOverInternet({}, {}, 'internet');
35
- expect(Toast.show).toBeCalled();
35
+ expect(Toast.show).toHaveBeenCalled();
36
36
  });
37
37
  });
@@ -1,4 +1,4 @@
1
- import AntDesign from 'react-native-vector-icons/AntDesign';
1
+ import { IconOutline } from '@ant-design/icons-react-native';
2
2
  import { createNativeStackNavigator } from '@react-navigation/native-stack';
3
3
  import React, { memo } from 'react';
4
4
  import { StyleSheet } from 'react-native';
@@ -19,7 +19,7 @@ export const EmergencyContactsStack = memo(() => {
19
19
  ...screenOptions,
20
20
  headerTitleAlign: 'center',
21
21
  headerBackImage: () => (
22
- <AntDesign
22
+ <IconOutline
23
23
  name="left"
24
24
  size={27}
25
25
  color={Colors.Black}
@@ -32,7 +32,8 @@ export const EmergencyContactsStack = memo(() => {
32
32
  borderBottomWidth: Device.isIOS === 'android' ? 1 : 0,
33
33
  borderColor: Colors.Gray4,
34
34
  },
35
- headerBackTitle: true,
35
+ headerTintColor: Colors.Black,
36
+ headerBackTitleVisible: false,
36
37
  }}
37
38
  >
38
39
  <Stack.Screen
@@ -50,6 +50,8 @@ export default SharedStack;
50
50
 
51
51
  const styles = StyleSheet.create({
52
52
  btnMenu: {
53
+ paddingLeft: 0,
54
+ paddingRight: 10,
53
55
  paddingHorizontal: 16,
54
56
  height: '100%',
55
57
  justifyContent: 'center',