@eohjsc/react-native-smart-city 0.2.67 → 0.2.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/images/Popover/Dashboard/SmartAccount.svg +5 -0
- package/assets/images/scan-qr-gateway.svg +14 -0
- package/assets/images/wifi-gateway.svg +18 -0
- package/assets/images/wifi.svg +3 -0
- package/package.json +3 -1
- package/src/commons/Action/ItemQuickAction.js +4 -3
- package/src/commons/Dashboard/MyPinnedSharedUnit/__test__/MyPinnedSharedUnit.test.js +70 -0
- package/src/commons/Device/HistoryChart.js +18 -18
- package/src/commons/Device/HorizontalBarChart.js +1 -2
- package/src/commons/Device/ItemDevice.js +1 -13
- package/src/commons/Device/LinearChart.js +13 -3
- package/src/commons/UnitSummary/ConfigHistoryChart/__test__/ConfigHistoryChart.test.js +29 -0
- package/src/commons/UnitSummary/ConfigHistoryChart.js +4 -6
- package/src/configs/API.js +2 -0
- package/src/configs/BLE.js +3 -0
- package/src/iot/RemoteControl/Bluetooth.js +34 -6
- package/src/iot/RemoteControl/__test__/Bluetooth.test.js +1 -0
- package/src/iot/RemoteControl/__test__/index.mock.js +1 -0
- package/src/iot/RemoteControl/index.js +7 -2
- package/src/navigations/AddDeviceStack.js +2 -0
- package/src/navigations/AddGatewayStack.js +11 -0
- package/src/navigations/AddLGDeviceStack.js +2 -0
- package/src/navigations/AddMemberStack.js +2 -0
- package/src/navigations/AddSubUnitStack.js +2 -0
- package/src/navigations/AddUnitStack.js +2 -0
- package/src/navigations/EmergencyContactsStack.js +2 -0
- package/src/navigations/SharedStack.js +2 -0
- package/src/navigations/UnitStack.js +2 -0
- package/src/screens/AddCommon/SelectSubUnit.js +2 -0
- package/src/screens/AddNewGateway/PlugAndPlay/ConnectWifiWarning.js +190 -0
- package/src/screens/AddNewGateway/PlugAndPlay/FirstWarning.js +73 -0
- package/src/screens/AddNewGateway/PlugAndPlay/GatewayWifiList.js +154 -0
- package/src/screens/AddNewGateway/PlugAndPlay/__test__/FirstWarning.test.js +60 -0
- package/src/screens/AddNewGateway/PlugAndPlay/__test__/GatewayWifiList.test.js +35 -0
- package/src/screens/AddNewGateway/__test__/SetupGateway.test.js +90 -0
- package/src/screens/Device/components/SensorDisplayItem.js +4 -2
- package/src/screens/ScanChipQR/hooks/index.js +14 -5
- package/src/screens/Unit/AddMenu.js +15 -0
- package/src/screens/Unit/Detail.js +13 -2
- package/src/screens/Unit/components/__test__/MyUnitDevice.test.js +10 -6
- package/src/screens/UnitSummary/components/PowerConsumption/index.js +2 -4
- package/src/screens/UnitSummary/components/RunningDevices/__test__/index.test.js +10 -6
- package/src/utils/I18n/translations/en.json +25 -3
- package/src/utils/I18n/translations/vi.json +25 -3
- package/src/utils/Route/index.js +4 -0
- package/src/utils/Utils.js +0 -4
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg width="41" height="41" viewBox="0 0 41 41" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<rect x="0.666504" y="1.09277" width="39" height="39" rx="19.5" fill="white"/>
|
|
3
|
+
<path d="M23.6665 20.0929C23.6665 22.0929 21.1665 23.5929 21.1665 25.0929H19.1665C19.1665 23.5929 16.6665 22.0929 16.6665 20.0929C16.6665 18.1629 18.2365 16.5929 20.1665 16.5929C22.0965 16.5929 23.6665 18.1629 23.6665 20.0929ZM21.1665 26.0929H19.1665V27.5929H21.1665V26.0929ZM30.1665 20.5929C30.1665 17.8329 29.0465 15.3329 27.2365 13.5229L26.1765 14.5829C27.7165 16.1229 28.6665 18.2529 28.6665 20.5929C28.6665 22.9329 27.7165 25.0629 26.1765 26.6029L27.2365 27.6629C29.0465 25.8529 30.1665 23.3529 30.1665 20.5929ZM11.6665 20.5929C11.6665 18.2529 12.6165 16.1229 14.1565 14.5829L13.0965 13.5229C11.2865 15.3329 10.1665 17.8329 10.1665 20.5929C10.1665 23.3529 11.2865 25.8529 13.0965 27.6629L14.1565 26.6029C12.6165 25.0629 11.6665 22.9329 11.6665 20.5929ZM25.6665 20.5929C25.6665 22.1129 25.0465 23.483 24.0565 24.483L25.1165 25.5429C26.3865 24.2729 27.1665 22.5229 27.1665 20.5929C27.1665 18.6629 26.3865 16.9129 25.1165 15.6429L24.0565 16.7029C25.0465 17.7029 25.6665 19.0729 25.6665 20.5929ZM15.2165 25.5429L16.2765 24.483C15.2765 23.483 14.6665 22.1129 14.6665 20.5929C14.6665 19.0729 15.2865 17.7029 16.2765 16.7029L15.2165 15.6429C13.9465 16.9129 13.1665 18.6629 13.1665 20.5929C13.1665 22.5229 13.9465 24.2729 15.2165 25.5429Z" fill="#262626"/>
|
|
4
|
+
<rect x="0.666504" y="1.09277" width="39" height="39" rx="19.5" stroke="#D9D9D9"/>
|
|
5
|
+
</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_6592_22563)">
|
|
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_6592_22563">
|
|
11
|
+
<rect width="94" height="94" fill="white"/>
|
|
12
|
+
</clipPath>
|
|
13
|
+
</defs>
|
|
14
|
+
</svg>
|
|
@@ -0,0 +1,18 @@
|
|
|
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_6501_22142)">
|
|
3
|
+
<path d="M26.9874 85.4397L26.9229 85.406C26.0264 84.9326 24.9155 85.2762 24.4429 86.1733C23.9696 87.0705 24.3138 88.1814 25.2103 88.654L25.2748 88.6877C25.5481 88.8319 25.8407 88.9 26.1297 88.9C26.7888 88.9 27.4263 88.5436 27.7548 87.9196C28.2281 87.0224 27.8839 85.9123 26.9874 85.4397Z" fill="#00979D"/>
|
|
4
|
+
<path d="M65.4908 7.80542L65.546 7.83123C65.7999 7.95172 66.0681 8.00837 66.3313 8.00837C67.0183 8.00837 67.6774 7.6211 67.9915 6.95916C68.4261 6.04334 68.036 4.94824 67.1194 4.51364L67.0585 4.48495C66.1419 4.05178 65.0476 4.44407 64.6144 5.36061C64.1819 6.27786 64.5742 7.37225 65.4908 7.80542Z" fill="#00979D"/>
|
|
5
|
+
<path d="M84.2484 18.3403C85.7315 15.9343 85.4332 12.7336 83.3498 10.6502C80.9165 8.21686 76.9563 8.21686 74.5223 10.6502C72.0889 13.0842 72.0889 17.0444 74.5223 19.4785C75.7393 20.6955 77.3378 21.3037 78.9364 21.3037C79.8049 21.3037 80.6727 21.1222 81.4802 20.7629C87.196 28.2723 90.3285 37.5252 90.3285 47.0003C90.3285 53.4455 88.9473 59.6475 86.2242 65.4321C85.7918 66.3494 86.1855 67.443 87.1027 67.8755C87.3559 67.9938 87.622 68.0505 87.8837 68.0505C88.5729 68.0505 89.2334 67.6611 89.5461 66.9963C92.5015 60.7182 94.0004 53.9905 94.0004 47.0003C94.0004 36.638 90.5458 26.5217 84.2484 18.3403ZM77.1191 16.8816C76.1165 15.8797 76.1165 14.2489 77.1191 13.247C77.6197 12.7457 78.2781 12.4955 78.9364 12.4955C79.5948 12.4955 80.2524 12.7457 80.7537 13.247C81.7556 14.2489 81.7556 15.8797 80.7537 16.8816C80.7458 16.8902 80.7372 16.8967 80.7286 16.9046C80.7279 16.9053 80.7272 16.9053 80.7264 16.906C80.7107 16.9189 80.697 16.934 80.6813 16.9476C79.6744 17.8806 78.098 17.8606 77.1191 16.8816Z" fill="#00979D"/>
|
|
6
|
+
<path d="M12.5202 73.2361C6.80444 65.7274 3.67188 56.4752 3.67188 46.9994C3.67188 41.0146 4.86882 35.22 7.23044 29.776C7.63348 28.8458 7.20677 27.7643 6.27661 27.3613C5.34717 26.9575 4.26497 27.3842 3.86192 28.3144C1.2995 34.2224 0 40.5083 0 46.9994C0 57.3616 3.45457 67.478 9.75198 75.6593C8.26889 78.0654 8.56723 81.2661 10.6506 83.3495C11.8669 84.5658 13.4655 85.1747 15.064 85.1747C16.6626 85.1747 18.2611 84.5658 19.4781 83.3495C21.9122 80.9154 21.9122 76.9553 19.4781 74.5212C17.5999 72.643 14.813 72.2155 12.5202 73.2361ZM16.882 80.7526C15.8794 81.7552 14.2486 81.7552 13.2467 80.7526C12.2448 79.7508 12.2448 78.1199 13.2467 77.1181C13.2546 77.1095 13.2639 77.103 13.2718 77.0951C13.2725 77.0944 13.2733 77.0944 13.274 77.0937C13.2897 77.0808 13.3034 77.0664 13.3184 77.0528C13.8097 76.5967 14.4365 76.3658 15.064 76.3658C15.7224 76.3658 16.3807 76.6168 16.8813 77.1181C17.8839 78.1199 17.8839 79.7508 16.882 80.7526Z" fill="#00979D"/>
|
|
7
|
+
<path d="M74.5214 74.5216C72.6431 76.3998 72.2157 79.1867 73.2362 81.4795C65.7275 87.1953 56.4747 90.3278 46.9995 90.3278C42.0181 90.3278 37.1356 89.4902 32.4863 87.8378C31.531 87.4979 30.4811 87.9971 30.1419 88.9523C29.8019 89.9083 30.3011 90.9582 31.2571 91.2974C36.3016 93.0903 41.5978 93.9997 46.9995 93.9997C57.3618 93.9997 67.4781 90.5459 75.6595 84.2477C76.6599 84.8645 77.7974 85.175 78.9355 85.175C80.534 85.175 82.1326 84.5661 83.3489 83.3498C85.783 80.9158 85.783 76.9556 83.3489 74.5216C80.9156 72.0882 76.9554 72.0875 74.5214 74.5216ZM80.7528 80.753C79.7509 81.7556 78.1201 81.7556 77.1175 80.753C77.1096 80.7451 77.1031 80.7365 77.096 80.7286C77.0952 80.7279 77.0945 80.7265 77.0938 80.7257C77.0766 80.7057 77.0587 80.6877 77.0415 80.6684C76.1192 79.6607 76.1429 78.093 77.1175 77.1184C78.1201 76.1158 79.7509 76.1158 80.7528 77.1184C81.7547 78.1203 81.7547 79.7511 80.7528 80.753Z" fill="#00979D"/>
|
|
8
|
+
<path d="M10.6507 19.4781C11.867 20.6952 13.4656 21.3033 15.0642 21.3033C16.6627 21.3033 18.2613 20.6952 19.4783 19.4781C21.3565 17.5999 21.784 14.813 20.7635 12.5202C28.2721 6.80444 37.5243 3.67188 47.0001 3.67188C51.3533 3.67188 55.6484 4.31517 59.7671 5.58311C60.736 5.88145 61.7637 5.33784 62.062 4.36896C62.3603 3.40007 61.8167 2.37238 60.8478 2.07404C56.3785 0.6978 51.7198 0 47.0001 0C36.6379 0 26.5208 3.45386 18.3402 9.75198C15.9341 8.26889 12.7334 8.56651 10.6507 10.6506C8.21668 13.0839 8.21668 17.0441 10.6507 19.4781ZM13.2469 13.2467C14.2495 12.2448 15.8796 12.2441 16.8814 13.2467C16.8893 13.2546 16.8958 13.2632 16.9037 13.2711C16.9044 13.2718 16.9051 13.2733 16.9058 13.274C16.9123 13.2819 16.9202 13.2883 16.9266 13.2969C17.8812 14.3024 17.8683 15.8959 16.8822 16.882C15.8796 17.8839 14.2487 17.8839 13.2469 16.882C12.245 15.8794 12.245 14.2486 13.2469 13.2467Z" fill="#00979D"/>
|
|
9
|
+
<path d="M47.0002 35.1943C54.7054 35.1943 61.9494 38.1957 67.3977 43.6439C68.4383 44.6838 69.821 45.2568 71.2926 45.2568C72.7635 45.2568 74.1462 44.6838 75.1868 43.6432C77.3347 41.496 77.3347 38.002 75.1868 35.8541C67.6581 28.3253 57.6479 24.1787 47.0002 24.1787C36.3532 24.1787 26.3423 28.3253 18.8135 35.8541C16.6663 38.0013 16.6663 41.496 18.8135 43.6439C19.8541 44.6838 21.2368 45.2568 22.7084 45.2568C24.1793 45.2568 25.5627 44.6838 26.6033 43.6439C32.0509 38.1957 39.295 35.1943 47.0002 35.1943Z" fill="#00979D"/>
|
|
10
|
+
<path d="M38.6334 55.6744C40.8638 53.444 43.835 52.2155 46.9999 52.2155C50.1647 52.2155 53.1359 53.444 55.3663 55.6744C56.4062 56.7143 57.7896 57.2873 59.2612 57.2873C60.7328 57.2873 62.1155 56.7143 63.1554 55.6744C65.3033 53.5272 65.3033 50.0325 63.1554 47.8853C54.2475 38.9774 39.7522 38.9767 30.8443 47.8853C28.6964 50.0325 28.6964 53.5272 30.8443 55.6744C32.9915 57.8223 36.4855 57.8223 38.6334 55.6744Z" fill="#00979D"/>
|
|
11
|
+
<path d="M43.1058 60.4193C42.0803 61.4448 41.4922 62.8641 41.4922 64.3135C41.4922 65.7621 42.0803 67.1821 43.1058 68.2077C44.1321 69.2332 45.5513 69.8213 47 69.8213C48.4494 69.8213 49.8687 69.2332 50.8942 68.2077C51.9197 67.1814 52.5078 65.7621 52.5078 64.3135C52.5078 62.8641 51.9197 61.4448 50.8942 60.4186C49.8687 59.3937 48.4494 58.8057 47 58.8057C45.5513 58.8057 44.1321 59.393 43.1058 60.4193Z" fill="#00979D"/>
|
|
12
|
+
</g>
|
|
13
|
+
<defs>
|
|
14
|
+
<clipPath id="clip0_6501_22142">
|
|
15
|
+
<rect width="94" height="94" fill="white"/>
|
|
16
|
+
</clipPath>
|
|
17
|
+
</defs>
|
|
18
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="24" height="19" viewBox="0 0 24 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M20.5004 6.5C20.8604 6.5 21.2104 6.54 21.5504 6.61L23.6404 4C23.1903 3.66 18.7104 0 12.0004 0C5.28035 0 0.810352 3.66 0.360352 4L12.0004 18.5L15.5004 14.14V11.5C15.5004 8.7 17.7004 6.5 20.5004 6.5ZM23.0004 13V11.5C23.0004 10.1 21.9004 9 20.5004 9C19.1004 9 18.0004 10.1 18.0004 11.5V13C17.5004 13 17.0004 13.5 17.0004 14V18C17.0004 18.5 17.5004 19 18.0004 19H23.0004C23.5004 19 24.0004 18.5 24.0004 18V14C24.0004 13.5 23.5004 13 23.0004 13ZM22.0004 13H19.0004V11.5C19.0004 10.7 19.7004 10 20.5004 10C21.3004 10 22.0004 10.7 22.0004 11.5V13Z" fill="#262626"/>
|
|
3
|
+
</svg>
|
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.2.
|
|
4
|
+
"version": "0.2.68",
|
|
5
5
|
"description": "TODO",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"files": [
|
|
@@ -183,11 +183,13 @@
|
|
|
183
183
|
"react-native-super-grid": "^4.0.3",
|
|
184
184
|
"react-native-svg": "^12.1.0",
|
|
185
185
|
"react-native-toast-message": "^1.3.2",
|
|
186
|
+
"react-native-udp": "^4.1.3",
|
|
186
187
|
"react-native-unimodules": "^0.11.0",
|
|
187
188
|
"react-native-version-check": "^3.4.2",
|
|
188
189
|
"react-native-vlc-media-player": "^1.0.39",
|
|
189
190
|
"react-native-webview": "^10.9.3",
|
|
190
191
|
"react-native-wheel-scrollview-picker": "^1.2.2",
|
|
192
|
+
"react-native-wifi-reborn": "^4.5.0",
|
|
191
193
|
"react-navigation": "^2.2.0",
|
|
192
194
|
"react-redux": "^7.2.1",
|
|
193
195
|
"redux": "^4.0.5",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { memo, useCallback, useEffect, useState } from 'react';
|
|
2
2
|
import { TouchableOpacity, View } from 'react-native';
|
|
3
3
|
import { TESTID } from '../../configs/Constants';
|
|
4
|
+
import { useSCContextSelector } from '../../context';
|
|
4
5
|
import { watchMultiConfigs } from '../../iot/Monitor';
|
|
5
6
|
import { sendRemoteCommand } from '../../iot/RemoteControl';
|
|
6
7
|
import { useConfigGlobalState } from '../../iot/states';
|
|
@@ -55,9 +56,9 @@ const ItemQuickAction = memo(({ sensor, wrapperStyle, setStatus, unit }) => {
|
|
|
55
56
|
const configValue = configValues[sensor.quick_action.config_id];
|
|
56
57
|
statusCallback(configValue);
|
|
57
58
|
}, [sensor, configValues, statusCallback]);
|
|
58
|
-
|
|
59
|
+
const userId = useSCContextSelector((state) => state?.auth.account.user.id);
|
|
59
60
|
const onActionPress = useCallback(() => {
|
|
60
|
-
sendRemoteCommand(sensor, action);
|
|
61
|
+
sendRemoteCommand(sensor, action, null, userId);
|
|
61
62
|
sensor.quick_action && watchMultiConfigs([sensor.quick_action.config_id]);
|
|
62
63
|
setIsSendingCommand(true);
|
|
63
64
|
|
|
@@ -77,7 +78,7 @@ const ItemQuickAction = memo(({ sensor, wrapperStyle, setStatus, unit }) => {
|
|
|
77
78
|
statusCallback(action.id === sensor.quick_action.on_action.id);
|
|
78
79
|
}, sensor.quick_action.interval);
|
|
79
80
|
}
|
|
80
|
-
}, [action,
|
|
81
|
+
}, [sensor, action, userId, revertActionUpdate, statusCallback]);
|
|
81
82
|
|
|
82
83
|
if (!action) {
|
|
83
84
|
return <View />;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { act, create } from 'react-test-renderer';
|
|
3
|
+
|
|
4
|
+
import MyPinnedSharedUnit from '../index';
|
|
5
|
+
import { Text } from 'react-native';
|
|
6
|
+
import { getTranslate } from '../../../../utils/I18n';
|
|
7
|
+
import { SCProvider } from '../../../../context';
|
|
8
|
+
import { mockSCStore } from '../../../../context/mockStore';
|
|
9
|
+
import { TESTID } from '../../../../configs/Constants';
|
|
10
|
+
import { API } from '../../../../configs';
|
|
11
|
+
import { TouchableOpacity } from 'react-native';
|
|
12
|
+
import axios from 'axios';
|
|
13
|
+
|
|
14
|
+
jest.mock('axios');
|
|
15
|
+
|
|
16
|
+
const mockedNavigate = jest.fn();
|
|
17
|
+
jest.mock('@react-navigation/native', () => {
|
|
18
|
+
return {
|
|
19
|
+
...jest.requireActual('@react-navigation/native'),
|
|
20
|
+
useNavigation: () => ({
|
|
21
|
+
navigate: mockedNavigate,
|
|
22
|
+
}),
|
|
23
|
+
useIsFocused: () => true,
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const wrapComponent = (route) => (
|
|
28
|
+
<SCProvider initState={mockSCStore({})}>
|
|
29
|
+
<MyPinnedSharedUnit />
|
|
30
|
+
</SCProvider>
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
describe('Test MyPinnedSharedUnit', () => {
|
|
34
|
+
let tree;
|
|
35
|
+
afterEach(() => {
|
|
36
|
+
axios.get.mockClear();
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
test('create', async () => {
|
|
40
|
+
const response = {
|
|
41
|
+
status: 200,
|
|
42
|
+
data: [{ id: 1 }],
|
|
43
|
+
};
|
|
44
|
+
axios.get.mockImplementation(async () => {
|
|
45
|
+
return response;
|
|
46
|
+
});
|
|
47
|
+
await act(async () => {
|
|
48
|
+
tree = await create(wrapComponent());
|
|
49
|
+
});
|
|
50
|
+
const instance = tree.root;
|
|
51
|
+
const texts = instance.findAllByType(Text);
|
|
52
|
+
expect(texts).toHaveLength(2);
|
|
53
|
+
expect(texts[0].props.children).toEqual(
|
|
54
|
+
getTranslate('en', 'text_shared_units')
|
|
55
|
+
);
|
|
56
|
+
expect(texts[1].props.children).toEqual(getTranslate('en', 'view_all'));
|
|
57
|
+
|
|
58
|
+
const goToAllSharedUnits = instance.find(
|
|
59
|
+
(el) =>
|
|
60
|
+
el.props.testID === TESTID.DASHBOARD_VIEW_ALL_SHARED_UNITS &&
|
|
61
|
+
el.type === TouchableOpacity
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
act(() => {
|
|
65
|
+
goToAllSharedUnits.props.onPress();
|
|
66
|
+
});
|
|
67
|
+
expect(mockedNavigate).toHaveBeenCalled();
|
|
68
|
+
expect(axios.get).toHaveBeenCalledWith(API.UNIT.SHARED_UNITS(), {});
|
|
69
|
+
});
|
|
70
|
+
});
|
|
@@ -45,8 +45,8 @@ const HistoryChart = memo(
|
|
|
45
45
|
const [eventPicker, setEventPicker] = useState({
|
|
46
46
|
showModalEnd: false,
|
|
47
47
|
showModalStart: false,
|
|
48
|
-
startTime: startDate ? startDate : moment().subtract(1, 'day')
|
|
49
|
-
endTime: endDate ? endDate : moment()
|
|
48
|
+
startTime: startDate ? startDate : moment().subtract(1, 'day'),
|
|
49
|
+
endTime: endDate ? endDate : moment(),
|
|
50
50
|
});
|
|
51
51
|
const [price, setPrice] = useState(null);
|
|
52
52
|
|
|
@@ -71,21 +71,21 @@ const HistoryChart = memo(
|
|
|
71
71
|
onCancel();
|
|
72
72
|
return state;
|
|
73
73
|
}
|
|
74
|
-
if (moment(date)
|
|
75
|
-
setStartDate(moment(date)
|
|
74
|
+
if (moment(date) < state.endTime) {
|
|
75
|
+
setStartDate(moment(date));
|
|
76
76
|
return {
|
|
77
77
|
...state,
|
|
78
78
|
showModalStart: false,
|
|
79
|
-
startTime: moment(date)
|
|
79
|
+
startTime: moment(date),
|
|
80
80
|
};
|
|
81
81
|
} else {
|
|
82
|
-
setStartDate(moment(date)
|
|
83
|
-
setEndDate(moment(date).add(1, 'day')
|
|
82
|
+
setStartDate(moment(date));
|
|
83
|
+
setEndDate(moment(date).add(1, 'day'));
|
|
84
84
|
return {
|
|
85
85
|
...state,
|
|
86
86
|
showModalStart: false,
|
|
87
|
-
startTime: moment(date)
|
|
88
|
-
endTime: moment(date).add(1, 'day')
|
|
87
|
+
startTime: moment(date),
|
|
88
|
+
endTime: moment(date).add(1, 'day'),
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
91
|
});
|
|
@@ -100,21 +100,21 @@ const HistoryChart = memo(
|
|
|
100
100
|
onCancel();
|
|
101
101
|
return state;
|
|
102
102
|
}
|
|
103
|
-
if (moment(date).
|
|
104
|
-
setEndDate(moment(date)
|
|
103
|
+
if (moment(date).add(1, 'day') > state.startTime) {
|
|
104
|
+
setEndDate(moment(date));
|
|
105
105
|
return {
|
|
106
106
|
...state,
|
|
107
107
|
showModalEnd: false,
|
|
108
|
-
endTime: moment(date)
|
|
108
|
+
endTime: moment(date),
|
|
109
109
|
};
|
|
110
110
|
} else {
|
|
111
|
-
setStartDate(moment(date).add(-1, 'day')
|
|
112
|
-
setEndDate(moment(date)
|
|
111
|
+
setStartDate(moment(date).add(-1, 'day'));
|
|
112
|
+
setEndDate(moment(date));
|
|
113
113
|
return {
|
|
114
114
|
...state,
|
|
115
115
|
showModalEnd: false,
|
|
116
|
-
startTime: moment(date).add(-1, 'day')
|
|
117
|
-
endTime: moment(date)
|
|
116
|
+
startTime: moment(date).add(-1, 'day'),
|
|
117
|
+
endTime: moment(date),
|
|
118
118
|
};
|
|
119
119
|
}
|
|
120
120
|
});
|
|
@@ -230,7 +230,7 @@ const HistoryChart = memo(
|
|
|
230
230
|
)}
|
|
231
231
|
<DateTimePickerModal
|
|
232
232
|
isVisible={eventPicker.showModalStart}
|
|
233
|
-
date={eventPicker.startTime}
|
|
233
|
+
date={eventPicker.startTime.toDate()}
|
|
234
234
|
mode={formatType || 'datetime'}
|
|
235
235
|
onConfirm={onConfirmStart}
|
|
236
236
|
onCancel={onCancel}
|
|
@@ -238,7 +238,7 @@ const HistoryChart = memo(
|
|
|
238
238
|
/>
|
|
239
239
|
<DateTimePickerModal
|
|
240
240
|
isVisible={eventPicker.showModalEnd}
|
|
241
|
-
date={eventPicker.
|
|
241
|
+
date={eventPicker.startTime.toDate()}
|
|
242
242
|
mode={formatType || 'datetime'}
|
|
243
243
|
onConfirm={onConfirmEnd}
|
|
244
244
|
onCancel={onCancel}
|
|
@@ -5,7 +5,6 @@ import { isEmpty } from 'lodash';
|
|
|
5
5
|
|
|
6
6
|
import { Colors } from '../../configs';
|
|
7
7
|
import { getMaxValueIndex } from '../../utils/chartHelper/getMaxValueIndex';
|
|
8
|
-
import { arePropsEqual } from '../../utils/Utils';
|
|
9
8
|
|
|
10
9
|
const HorizontalBarChart = memo(({ datas, config }) => {
|
|
11
10
|
const [chartOptions, setChartOptions] = useState({
|
|
@@ -146,7 +145,7 @@ const HorizontalBarChart = memo(({ datas, config }) => {
|
|
|
146
145
|
/>
|
|
147
146
|
</View>
|
|
148
147
|
);
|
|
149
|
-
}
|
|
148
|
+
});
|
|
150
149
|
|
|
151
150
|
export default HorizontalBarChart;
|
|
152
151
|
|
|
@@ -62,11 +62,7 @@ const ItemDevice = memo(
|
|
|
62
62
|
<TouchableOpacity onPress={goToSensorDisplay}>
|
|
63
63
|
{displayIconSensor()}
|
|
64
64
|
</TouchableOpacity>
|
|
65
|
-
<ItemQuickAction
|
|
66
|
-
sensor={sensor}
|
|
67
|
-
unit={unit}
|
|
68
|
-
wrapperStyle={styles.iconCircle}
|
|
69
|
-
/>
|
|
65
|
+
<ItemQuickAction sensor={sensor} unit={unit} />
|
|
70
66
|
</View>
|
|
71
67
|
<TouchableOpacity onPress={goToSensorDisplay}>
|
|
72
68
|
<Text
|
|
@@ -137,12 +133,4 @@ const styles = StyleSheet.create({
|
|
|
137
133
|
height: 40,
|
|
138
134
|
resizeMode: 'contain',
|
|
139
135
|
},
|
|
140
|
-
iconCircle: {
|
|
141
|
-
width: 32,
|
|
142
|
-
height: 32,
|
|
143
|
-
backgroundColor: Colors.Gray3,
|
|
144
|
-
borderRadius: 16,
|
|
145
|
-
justifyContent: 'center',
|
|
146
|
-
alignItems: 'center',
|
|
147
|
-
},
|
|
148
136
|
});
|
|
@@ -3,7 +3,6 @@ import { StyleSheet, View } from 'react-native';
|
|
|
3
3
|
import HighchartsReactNative from '@highcharts/highcharts-react-native';
|
|
4
4
|
import moment from 'moment';
|
|
5
5
|
import { Colors } from '../../configs';
|
|
6
|
-
import { arePropsEqual } from '../../utils/Utils';
|
|
7
6
|
|
|
8
7
|
const convertData = (data = []) => {
|
|
9
8
|
let arr = [];
|
|
@@ -61,7 +60,13 @@ const chartOptions = {
|
|
|
61
60
|
series: {
|
|
62
61
|
events: {
|
|
63
62
|
legendItemClick: function () {
|
|
64
|
-
const { index, visible } = this;
|
|
63
|
+
const { index, visible, chart } = this;
|
|
64
|
+
const { series } = chart;
|
|
65
|
+
series.forEach((serie, i) => {
|
|
66
|
+
if (i !== index) {
|
|
67
|
+
serie.visible ? serie.show() : serie.hide();
|
|
68
|
+
}
|
|
69
|
+
});
|
|
65
70
|
const isHiding = (serie, i) => {
|
|
66
71
|
if (i === index) {
|
|
67
72
|
return visible;
|
|
@@ -97,6 +102,11 @@ function LinearChart({ datas }) {
|
|
|
97
102
|
data: arr,
|
|
98
103
|
type: 'spline',
|
|
99
104
|
color: datas[i].color,
|
|
105
|
+
states: {
|
|
106
|
+
inactive: {
|
|
107
|
+
opacity: 1,
|
|
108
|
+
},
|
|
109
|
+
},
|
|
100
110
|
});
|
|
101
111
|
}
|
|
102
112
|
return series;
|
|
@@ -120,7 +130,7 @@ function LinearChart({ datas }) {
|
|
|
120
130
|
);
|
|
121
131
|
}
|
|
122
132
|
|
|
123
|
-
export default memo(LinearChart
|
|
133
|
+
export default memo(LinearChart);
|
|
124
134
|
|
|
125
135
|
const styles = StyleSheet.create({
|
|
126
136
|
container: {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { act, create } from 'react-test-renderer';
|
|
3
|
+
import ConfigHistoryChart from '../';
|
|
4
|
+
import { SCProvider } from '../../../../context';
|
|
5
|
+
import { mockSCStore } from '../../../../context/mockStore';
|
|
6
|
+
import HistoryChart from '../../../../commons/Device/HistoryChart';
|
|
7
|
+
|
|
8
|
+
const wrapComponent = (configs = []) => (
|
|
9
|
+
<SCProvider initState={mockSCStore({})}>
|
|
10
|
+
<ConfigHistoryChart configs={configs} />
|
|
11
|
+
</SCProvider>
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
describe('Test HistoryChart', () => {
|
|
15
|
+
let tree;
|
|
16
|
+
|
|
17
|
+
beforeAll(() => {
|
|
18
|
+
jest.useFakeTimers();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('Test render', async () => {
|
|
22
|
+
await act(() => {
|
|
23
|
+
tree = create(wrapComponent());
|
|
24
|
+
});
|
|
25
|
+
const instance = tree.root;
|
|
26
|
+
const HistoryCharts = instance.findAllByType(HistoryChart);
|
|
27
|
+
expect(HistoryCharts).toHaveLength(0);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
@@ -13,10 +13,8 @@ export const dateTimeType = {
|
|
|
13
13
|
|
|
14
14
|
const ConfigHistoryChart = memo(({ configs }) => {
|
|
15
15
|
const [chartData, setChartData] = useState(configs);
|
|
16
|
-
const [startDate, setStartDate] = useState(
|
|
17
|
-
|
|
18
|
-
);
|
|
19
|
-
const [endDate, setEndDate] = useState(moment().valueOf());
|
|
16
|
+
const [startDate, setStartDate] = useState(moment().subtract(1, 'days'));
|
|
17
|
+
const [endDate, setEndDate] = useState(moment());
|
|
20
18
|
|
|
21
19
|
useEffect(() => {
|
|
22
20
|
const fetchData = async () => {
|
|
@@ -25,8 +23,8 @@ const ConfigHistoryChart = memo(({ configs }) => {
|
|
|
25
23
|
configuration.map((item) => {
|
|
26
24
|
params.append('config', item.id);
|
|
27
25
|
});
|
|
28
|
-
params.append('date_from', startDate / 1000);
|
|
29
|
-
params.append('date_to', endDate / 1000);
|
|
26
|
+
params.append('date_from', startDate.valueOf() / 1000);
|
|
27
|
+
params.append('date_to', endDate.valueOf() / 1000);
|
|
30
28
|
const { success, data } = await axiosGet(API.CONFIG.DISPLAY_HISTORY(), {
|
|
31
29
|
params,
|
|
32
30
|
});
|
package/src/configs/API.js
CHANGED
|
@@ -33,6 +33,8 @@ const API = {
|
|
|
33
33
|
SCConfig.apiRoot + `/property_manager/units/${id}/device_control/`,
|
|
34
34
|
DEVICE_SENSOR: (id) =>
|
|
35
35
|
SCConfig.apiRoot + `/property_manager/units/${id}/device_sensor/`,
|
|
36
|
+
ADD_GATEWAY: (id) =>
|
|
37
|
+
SCConfig.apiRoot + `/property_manager/units/${id}/add_gateway/`,
|
|
36
38
|
},
|
|
37
39
|
SUB_UNIT: {
|
|
38
40
|
REMOVE_SUB_UNIT: (unitId, id) =>
|
package/src/configs/BLE.js
CHANGED
|
@@ -3,4 +3,7 @@ export default {
|
|
|
3
3
|
BLE_REMOTE_CHARACTERISTIC_UUID: 'b32f3620-2846-4d1c-88aa-5dd06c0ad15e',
|
|
4
4
|
BLE_REMOTE_CHARACTERISTIC_UUID_TX: 'fba737c2-9f19-4779-9ef2-9446c29d0bf5',
|
|
5
5
|
BLE_REMOTE_CHARACTERISTIC_UUID_RX: '54173c1f-3a6a-4812-90fb-9a222f445f0c',
|
|
6
|
+
BLE_RESPONSE_OK: 'OK',
|
|
7
|
+
BLE_RESPONSE_FAILED: 'FAILED',
|
|
8
|
+
BLE_LISTER_RESPONSE_CONTROL: 'LISTER_RESPONSE_CONTROL',
|
|
6
9
|
};
|
|
@@ -87,7 +87,12 @@ const realScanBluetoothDevices = () => {
|
|
|
87
87
|
}, 15000);
|
|
88
88
|
};
|
|
89
89
|
|
|
90
|
-
export const sendCommandOverBluetooth = async (
|
|
90
|
+
export const sendCommandOverBluetooth = async (
|
|
91
|
+
sensor,
|
|
92
|
+
action,
|
|
93
|
+
data,
|
|
94
|
+
userID
|
|
95
|
+
) => {
|
|
91
96
|
const bluetooth = sensor.remote_control_options.bluetooth;
|
|
92
97
|
let device = null;
|
|
93
98
|
if (bluetooth) {
|
|
@@ -99,6 +104,7 @@ export const sendCommandOverBluetooth = async (sensor, action, data) => {
|
|
|
99
104
|
command: action.key,
|
|
100
105
|
password: bluetooth ? bluetooth.password : '',
|
|
101
106
|
data,
|
|
107
|
+
user: userID,
|
|
102
108
|
});
|
|
103
109
|
return result;
|
|
104
110
|
};
|
|
@@ -139,20 +145,39 @@ export const sendDataOverBluetooth = async (
|
|
|
139
145
|
|
|
140
146
|
let connectedDevice = null;
|
|
141
147
|
let fullDataDevice = null;
|
|
142
|
-
let result =
|
|
148
|
+
let result = true;
|
|
149
|
+
const responseTime = 2000;
|
|
143
150
|
try {
|
|
144
151
|
connectedDevice = await device.connect();
|
|
145
152
|
fullDataDevice =
|
|
146
153
|
await connectedDevice.discoverAllServicesAndCharacteristics();
|
|
154
|
+
await fullDataDevice.monitorCharacteristicForService(
|
|
155
|
+
BLE.BLE_REMOTE_SERVICE_UUID,
|
|
156
|
+
BLE.BLE_REMOTE_CHARACTERISTIC_UUID_TX,
|
|
157
|
+
(error, characteristic) => {
|
|
158
|
+
const notify = error ? '' : base64.decode(characteristic.value);
|
|
159
|
+
if (notify === BLE.BLE_RESPONSE_OK) {
|
|
160
|
+
ToastBottomHelper.success(
|
|
161
|
+
t('control_device_via_bluetooth_successfully')
|
|
162
|
+
);
|
|
163
|
+
if (!keepConnect) {
|
|
164
|
+
bleManager.cancelTransaction(BLE.BLE_LISTER_RESPONSE_CONTROL);
|
|
165
|
+
device.cancelConnection();
|
|
166
|
+
}
|
|
167
|
+
} else if (notify === BLE.BLE_RESPONSE_FAILED) {
|
|
168
|
+
ToastBottomHelper.error(t('control_device_via_bluetooth_failed'));
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
BLE.BLE_LISTER_RESPONSE_CONTROL
|
|
172
|
+
);
|
|
147
173
|
await fullDataDevice.writeCharacteristicWithResponseForService(
|
|
148
174
|
BLE.BLE_REMOTE_SERVICE_UUID,
|
|
149
175
|
BLE.BLE_REMOTE_CHARACTERISTIC_UUID,
|
|
150
176
|
base64.encode(JSON.stringify(data))
|
|
151
177
|
);
|
|
152
|
-
ToastBottomHelper.
|
|
153
|
-
result = true;
|
|
178
|
+
ToastBottomHelper.error(t('command_is_sent_to_device_via_bluetooth'));
|
|
154
179
|
} catch (e) {
|
|
155
|
-
ToastBottomHelper.error(t('
|
|
180
|
+
ToastBottomHelper.error(t('command_is_fail_to_send_via_bluetooth'));
|
|
156
181
|
throw SEND_COMMAND_OVER_BLUETOOTH_FAIL;
|
|
157
182
|
}
|
|
158
183
|
|
|
@@ -160,7 +185,10 @@ export const sendDataOverBluetooth = async (
|
|
|
160
185
|
return result;
|
|
161
186
|
}
|
|
162
187
|
|
|
163
|
-
|
|
188
|
+
// eslint-disable-next-line no-shadow
|
|
189
|
+
setTimeout(async (device) => {
|
|
190
|
+
await device.cancelConnection();
|
|
191
|
+
}, responseTime);
|
|
164
192
|
return result;
|
|
165
193
|
};
|
|
166
194
|
|
|
@@ -221,6 +221,7 @@ describe('Test IOT Bluetooth', () => {
|
|
|
221
221
|
connect: async () => ({
|
|
222
222
|
discoverAllServicesAndCharacteristics: async () => ({
|
|
223
223
|
writeCharacteristicWithResponseForService: async () => ({}),
|
|
224
|
+
monitorCharacteristicForService: async () => ({}),
|
|
224
225
|
}),
|
|
225
226
|
}),
|
|
226
227
|
};
|
|
@@ -8,7 +8,12 @@ import { ToastBottomHelper } from '../../utils/Utils';
|
|
|
8
8
|
import t from '../../hooks/Common/useTranslations';
|
|
9
9
|
import { sendCommandOverLGThinq } from './LG';
|
|
10
10
|
|
|
11
|
-
export const sendRemoteCommand = async (
|
|
11
|
+
export const sendRemoteCommand = async (
|
|
12
|
+
sensor,
|
|
13
|
+
action,
|
|
14
|
+
data,
|
|
15
|
+
userId = null
|
|
16
|
+
) => {
|
|
12
17
|
// No action, raise not authorized
|
|
13
18
|
let result = false;
|
|
14
19
|
if (!action) {
|
|
@@ -19,7 +24,7 @@ export const sendRemoteCommand = async (sensor, action, data) => {
|
|
|
19
24
|
}
|
|
20
25
|
if (action.command_prefer_over_bluetooth) {
|
|
21
26
|
try {
|
|
22
|
-
result = await sendCommandOverBluetooth(sensor, action, data);
|
|
27
|
+
result = await sendCommandOverBluetooth(sensor, action, data, userId);
|
|
23
28
|
} catch (err) {
|
|
24
29
|
if (err === SEND_COMMAND_OVER_BLUETOOTH_FAIL) {
|
|
25
30
|
result = await sendCommandOverInternet(
|
|
@@ -8,6 +8,7 @@ import ConnectDevices from '../screens/AddNewDevice/ConnectDevices';
|
|
|
8
8
|
import ConnectingDevices from '../screens/AddNewDevice/ConnectingDevices';
|
|
9
9
|
import ScanSensorQR from '../screens/ScanSensorQR';
|
|
10
10
|
import Route from '../utils/Route';
|
|
11
|
+
import { screenOptions } from './utils';
|
|
11
12
|
|
|
12
13
|
const Stack = createStackNavigator();
|
|
13
14
|
|
|
@@ -15,6 +16,7 @@ export const AddDeviceStack = memo(() => {
|
|
|
15
16
|
return (
|
|
16
17
|
<Stack.Navigator
|
|
17
18
|
screenOptions={{
|
|
19
|
+
...screenOptions,
|
|
18
20
|
headerShown: false,
|
|
19
21
|
}}
|
|
20
22
|
>
|
|
@@ -8,6 +8,10 @@ import ConnectedGateway from '../screens/AddNewGateway/ConnectedGateway';
|
|
|
8
8
|
import ConnectingGateway from '../screens/AddNewGateway/ConnectingGateway';
|
|
9
9
|
import SetupGatewayWifi from '../screens/AddNewGateway/SetupGatewayWifi';
|
|
10
10
|
import AddCommonSelectSubUnit from '../screens/AddCommon/SelectSubUnit';
|
|
11
|
+
import FirstWarning from '../screens/AddNewGateway/PlugAndPlay/FirstWarning';
|
|
12
|
+
import ConnectWifiWarning from '../screens/AddNewGateway/PlugAndPlay/ConnectWifiWarning';
|
|
13
|
+
import GatewayWifiList from '../screens/AddNewGateway/PlugAndPlay/GatewayWifiList';
|
|
14
|
+
import { screenOptions } from './utils';
|
|
11
15
|
|
|
12
16
|
const Stack = createStackNavigator();
|
|
13
17
|
|
|
@@ -15,6 +19,7 @@ export const AddGatewayStack = memo(() => {
|
|
|
15
19
|
return (
|
|
16
20
|
<Stack.Navigator
|
|
17
21
|
screenOptions={{
|
|
22
|
+
...screenOptions,
|
|
18
23
|
headerShown: false,
|
|
19
24
|
}}
|
|
20
25
|
>
|
|
@@ -36,6 +41,12 @@ export const AddGatewayStack = memo(() => {
|
|
|
36
41
|
name={Route.ConnectedGateway}
|
|
37
42
|
component={ConnectedGateway}
|
|
38
43
|
/>
|
|
44
|
+
<Stack.Screen name={Route.FirstWarning} component={FirstWarning} />
|
|
45
|
+
<Stack.Screen
|
|
46
|
+
name={Route.ConnectWifiWarning}
|
|
47
|
+
component={ConnectWifiWarning}
|
|
48
|
+
/>
|
|
49
|
+
<Stack.Screen name={Route.GatewayWifiList} component={GatewayWifiList} />
|
|
39
50
|
</Stack.Navigator>
|
|
40
51
|
);
|
|
41
52
|
});
|
|
@@ -4,6 +4,7 @@ import React, { memo } from 'react';
|
|
|
4
4
|
import AddCommonSelectUnit from '../screens/AddCommon/SelectUnit';
|
|
5
5
|
import AddLGDevice from '../screens/SyncLGDevice/AddLGDevice';
|
|
6
6
|
import Routes from '../utils/Route';
|
|
7
|
+
import { screenOptions } from './utils';
|
|
7
8
|
|
|
8
9
|
const Stack = createStackNavigator();
|
|
9
10
|
|
|
@@ -11,6 +12,7 @@ export const AddLGDeviceStack = memo(() => {
|
|
|
11
12
|
return (
|
|
12
13
|
<Stack.Navigator
|
|
13
14
|
screenOptions={{
|
|
15
|
+
...screenOptions,
|
|
14
16
|
headerShown: false,
|
|
15
17
|
}}
|
|
16
18
|
>
|
|
@@ -5,6 +5,7 @@ import AddCommonSelectUnit from '../screens/AddCommon/SelectUnit';
|
|
|
5
5
|
import SharingSelectPermission from '../screens/Sharing/SelectPermission';
|
|
6
6
|
import SharingInviteMembers from '../screens/Sharing/SelectUser';
|
|
7
7
|
import Route from '../utils/Route';
|
|
8
|
+
import { screenOptions } from './utils';
|
|
8
9
|
|
|
9
10
|
const Stack = createStackNavigator();
|
|
10
11
|
|
|
@@ -12,6 +13,7 @@ export const AddMemberStack = memo(() => {
|
|
|
12
13
|
return (
|
|
13
14
|
<Stack.Navigator
|
|
14
15
|
screenOptions={{
|
|
16
|
+
...screenOptions,
|
|
15
17
|
headerShown: false,
|
|
16
18
|
}}
|
|
17
19
|
>
|
|
@@ -4,6 +4,7 @@ import React, { memo } from 'react';
|
|
|
4
4
|
import AddCommonSelectUnit from '../screens/AddCommon/SelectUnit';
|
|
5
5
|
import AddSubUnit from '../screens/SubUnit/AddSubUnit';
|
|
6
6
|
import Route from '../utils/Route';
|
|
7
|
+
import { screenOptions } from './utils';
|
|
7
8
|
|
|
8
9
|
const Stack = createStackNavigator();
|
|
9
10
|
|
|
@@ -11,6 +12,7 @@ export const AddSubUnitStack = memo(() => {
|
|
|
11
12
|
return (
|
|
12
13
|
<Stack.Navigator
|
|
13
14
|
screenOptions={{
|
|
15
|
+
...screenOptions,
|
|
14
16
|
headerShown: false,
|
|
15
17
|
}}
|
|
16
18
|
>
|