@eohjsc/react-native-smart-city 0.3.29 → 0.3.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -5
- package/src/Images/DevMode/close.png +0 -0
- package/src/Images/DevMode/close@2x.png +0 -0
- package/src/Images/DevMode/close@3x.png +0 -0
- package/src/Images/DevMode/plus.png +0 -0
- package/src/Images/DevMode/plus@2x.png +0 -0
- package/src/Images/DevMode/plus@3x.png +0 -0
- package/src/Images/DevMode/remove_circle.png +0 -0
- package/src/Images/DevMode/remove_circle@2x.png +0 -0
- package/src/Images/DevMode/remove_circle@3x.png +0 -0
- package/src/commons/Action/ItemQuickAction.js +2 -2
- package/src/commons/Action/__test__/ItemQuickAction.test.js +17 -9
- package/src/commons/ActionGroup/ColorPickerTemplate.js +36 -17
- package/src/commons/ActionGroup/CurtainButtonTemplate.js +6 -6
- package/src/commons/ActionGroup/NumberUpDownActionTemplate.js +18 -13
- package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/ButtonWrapper.js +5 -2
- package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/__test__/index.test.js +10 -4
- package/src/commons/ActionGroup/OnOffSmartLock/AutoLock/index.js +4 -4
- package/src/commons/ActionGroup/OnOffSmartLock/OnOffSmartLock.js +38 -45
- package/src/commons/ActionGroup/OnOffSmartLock/OnOffSmartLockStyle.js +1 -0
- package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/ItemPasscode.js +1 -1
- package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/__test__/index.test.js +2 -2
- package/src/commons/ActionGroup/OnOffSmartLock/PasscodeList/index.js +2 -2
- package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/ButtonWrapper.js +2 -2
- package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/__test__/index.test.js +12 -6
- package/src/commons/ActionGroup/OnOffSmartLock/SetupGeneratePasscode/index.js +8 -4
- package/src/commons/ActionGroup/OnOffTemplate/OnOffButtonTemplate.js +9 -10
- package/src/commons/ActionGroup/OnOffTemplate/index.js +2 -2
- package/src/commons/ActionGroup/OneBigButtonTemplate.js +5 -5
- package/src/commons/ActionGroup/OptionsDropdownActionTemplate.js +38 -22
- package/src/commons/ActionGroup/SliderRangeTemplate.js +24 -16
- package/src/commons/ActionGroup/SmartTiviActionTemplate/SmartTiviActionTemplate.js +25 -9
- package/src/commons/ActionGroup/SmartTiviActionTemplate/__test__/ControlPlay.test.js +13 -7
- package/src/commons/ActionGroup/SmartTiviActionTemplate/__test__/RectangleButton.test.js +9 -5
- package/src/commons/ActionGroup/SmartTiviActionTemplate/__test__/SmartTiviActionTemplate.test.js +25 -9
- package/src/commons/ActionGroup/SmartTiviActionTemplate/component/CircleButton.js +16 -6
- package/src/commons/ActionGroup/SmartTiviActionTemplate/component/ControlPlay.js +10 -4
- package/src/commons/ActionGroup/SmartTiviActionTemplate/component/RectangleButton.js +7 -3
- package/src/commons/ActionGroup/StatesGridActionTemplate.js +2 -2
- package/src/commons/ActionGroup/ThreeButtonTemplate.js +50 -60
- package/src/commons/ActionGroup/TwoButtonTemplate/index.js +135 -133
- package/src/commons/ActionGroup/__test__/NumberUpDownTemplate.test.js +7 -7
- package/src/commons/ActionGroup/__test__/OnOffSmartLock.test.js +3 -3
- package/src/commons/ActionGroup/__test__/OnOffTemplate.test.js +3 -3
- package/src/commons/ActionGroup/__test__/OptionsDropdownTemplate.test.js +9 -5
- package/src/commons/ActionGroup/__test__/index.test.js +7 -5
- package/src/commons/ActionGroup/index.js +35 -10
- package/src/commons/AlertAction/index.js +2 -2
- package/src/commons/Auth/AccountItem.js +9 -3
- package/src/commons/Auth/__test__/AccountItem.test.js +6 -3
- package/src/commons/Automate/ItemAutomate.js +13 -3
- package/src/commons/BackDefault/index.js +2 -2
- package/src/commons/BottomButtonView/index.js +4 -4
- package/src/commons/Button/index.js +2 -2
- package/src/commons/ButtonPopup/index.js +3 -3
- package/src/commons/Dashboard/MyPinnedSharedUnit/__test__/MyPinnedSharedUnit.test.js +3 -2
- package/src/commons/Dashboard/MyPinnedSharedUnit/index.js +4 -2
- package/src/commons/Dashboard/MyUnit/__test__/MyUnit.test.js +6 -3
- package/src/commons/Dashboard/MyUnit/index.js +5 -3
- package/src/commons/DevMode/CardDevMode.js +42 -0
- package/src/commons/DevMode/EmptyComponent.js +18 -0
- package/src/commons/DevMode/Item.js +21 -0
- package/src/commons/DevMode/Styles/CardStyles.js +40 -0
- package/src/commons/DevMode/Styles/EmptyComponentStyles.js +15 -0
- package/src/commons/DevMode/Styles/ItemStyles.js +27 -0
- package/src/commons/DevMode/Styles/TextWithLabelStyles.js +36 -0
- package/src/commons/DevMode/TextWithLabel.js +30 -0
- package/src/commons/DevMode/index.js +5 -1
- package/src/commons/Device/ConnectedViewHeader.js +2 -2
- package/src/commons/Device/DeviceAlertStatus.js +3 -3
- package/src/commons/Device/DisconnectedView.js +2 -2
- package/src/commons/Device/Emergency/EmergencyButton.js +2 -2
- package/src/commons/Device/Emergency/EmergencyDetail.js +1 -1
- package/src/commons/Device/Emergency/__test__/EmergencyButton.test.js +3 -2
- package/src/commons/Device/FlatListItems.js +2 -2
- package/src/commons/Device/ItemAddNew/index.js +10 -11
- package/src/commons/Device/ItemDevice.js +27 -20
- package/src/commons/Device/PMSensor/PMSensorIndicatior.js +1 -1
- package/src/commons/Device/RainningSensor/CurrentRainSensor.js +1 -1
- package/src/commons/Device/SensorConnectedStatus.js +5 -2
- package/src/commons/Device/WindDirection/Compass/index.js +6 -3
- package/src/commons/Device/WindSpeed/Anemometer/index.js +1 -1
- package/src/commons/Device/__test__/DeviceAlertStatus.test.js +8 -4
- package/src/commons/Device/__test__/FlatListItems.test.js +3 -2
- package/src/commons/Device/__test__/SensorConnectedStatus.test.js +4 -2
- package/src/commons/Explore/ActivityIndicator/index.js +5 -2
- package/src/commons/Explore/SearchBox/__test__/SearchBox.test.js +3 -3
- package/src/commons/Explore/SearchBox/index.js +2 -2
- package/src/commons/FieldTemplate/ChooseUserField/ChoosePopup.js +4 -4
- package/src/commons/FieldTemplate/ChooseUserField/__test__/index.test.js +11 -8
- package/src/commons/FieldTemplate/ChooseUserField/index.js +2 -2
- package/src/commons/FieldTemplate/PasscodeField/__test__/index.test.js +3 -2
- package/src/commons/FieldTemplate/PasscodeField/index.js +2 -2
- package/src/commons/FieldTemplate/ScheduleField/__test__/index.test.js +12 -7
- package/src/commons/Form/TextInput.js +2 -2
- package/src/commons/Form/TextInputPassword.js +2 -2
- package/src/commons/GroupCheckBox/__test__/GroupCheckBox.test.js +5 -3
- package/src/commons/GroupCheckBox/index.js +2 -2
- package/src/commons/Header/HeaderCustom.js +8 -2
- package/src/commons/HeaderAni/index.js +2 -3
- package/src/commons/MediaPlayerDetail/index.js +2 -2
- package/src/commons/MenuActionList/index.js +2 -2
- package/src/commons/MenuActionMore/index.js +6 -5
- package/src/commons/NavBar/index.js +4 -4
- package/src/commons/OneTapTemplate/NumberUpDownActionTemplate.js +11 -5
- package/src/commons/OneTapTemplate/OptionsDropdownActionTemplate.js +7 -3
- package/src/commons/OneTapTemplate/StatesGridActionTemplate.js +4 -2
- package/src/commons/OneTapTemplate/__test__/NumberUpDownActionTemplate.test.js +11 -8
- package/src/commons/OneTapTemplate/__test__/OptionsDropdownActionTemplate.test.js +9 -5
- package/src/commons/OneTapTemplate/__test__/StatesGridActionTemplate.test.js +5 -3
- package/src/commons/Popover/index.js +2 -12
- package/src/commons/PreventAccess/__test__/PreventAccess.test.js +5 -3
- package/src/commons/PreventAccess/index.js +3 -3
- package/src/commons/{Connecting → Processing}/__test__/Connecting.test.js +5 -4
- package/src/commons/Processing/index.js +93 -0
- package/src/commons/{Connecting → Processing}/styles.js +9 -1
- package/src/commons/SelectGateway/index.js +105 -0
- package/src/commons/SelectGateway/styles.js +55 -0
- package/src/commons/SelectSubUnit/__test__/SelectSubUnit.test.js +106 -0
- package/src/commons/SelectSubUnit/index.js +124 -0
- package/src/commons/SelectSubUnit/styles.js +55 -0
- package/src/commons/SelectUnit/__test__/SelectUnit.test.js +120 -0
- package/src/commons/SelectUnit/index.js +106 -0
- package/src/commons/SelectUnit/styles.js +54 -0
- package/src/commons/Sharing/WrapHeaderScrollable.js +6 -4
- package/src/commons/SubUnit/OneTap/ItemOneTap.js +7 -4
- package/src/commons/SubUnit/OneTap/__test__/SubUnitAutomate.test.js +25 -10
- package/src/commons/SubUnit/OneTap/index.js +9 -4
- package/src/commons/SubUnit/ShortDetail.js +11 -29
- package/src/commons/SubUnit/__test__/ShortDetail.test.js +15 -10
- package/src/commons/SummaryItem/index.js +2 -2
- package/src/commons/Unit/HeaderUnit/index.js +4 -5
- package/src/commons/Unit/SharedUnit.js +10 -8
- package/src/commons/Unit/__test__/HeaderUnit.test.js +13 -5
- package/src/commons/Unit/__test__/SharedUnit.test.js +30 -11
- package/src/commons/UnitSummary/AirQuality/__test__/index.test.js +13 -8
- package/src/commons/UnitSummary/AirQuality/index.js +7 -3
- package/src/commons/UnitSummary/TotalPowerBox.js +2 -2
- package/src/commons/UnitSummary/TotalPowerConsumption/index.js +2 -2
- package/src/commons/UnitSummary/__test__/TotalPowerBox.test.js +3 -2
- package/src/commons/UnitSummary/__test__/TotalPowerConsumption.test.js +4 -2
- package/src/commons/ViewButtonBottom/index.js +4 -4
- package/src/commons/WheelDateTimePicker/index.js +5 -3
- package/src/commons/WrapParallaxScrollView/index.js +2 -1
- package/src/configs/API.js +12 -14
- package/src/configs/AccessibilityLabel.js +608 -0
- package/src/configs/Colors.js +4 -0
- package/src/configs/Constants.js +1 -593
- package/src/configs/Images.js +3 -0
- package/src/context/actionType.ts +19 -3
- package/src/context/mockStore.ts +18 -3
- package/src/context/reducer.ts +66 -9
- package/src/hoc/withRemoteControl.js +1 -0
- package/src/hooks/Common/index.js +2 -2
- package/src/hooks/Common/useDevicesStatus.js +1 -1
- package/src/hooks/Common/{useGGHomeDeviceConnected.js → useHomeAssistantDeviceConnected.js} +3 -3
- package/src/hooks/Common/usePopover.js +6 -1
- package/src/hooks/IoT/__test__/{useGGHomeConnection.test.js → useHomeAssistantConnection.test.js} +18 -18
- package/src/hooks/IoT/__test__/useRemoteControl.test.js +17 -12
- package/src/hooks/IoT/index.js +2 -2
- package/src/hooks/IoT/useHomeAssistantConnection.js +91 -0
- package/src/hooks/IoT/useRemoteControl.js +6 -6
- package/src/hooks/IoT/useValueEvaluation.js +10 -19
- package/src/iot/RemoteControl/{GoogleHome.js → HomeAssistant.js} +27 -23
- package/src/iot/RemoteControl/LG.js +2 -1
- package/src/iot/RemoteControl/__test__/{GoogleHome.test.js → HomeAssistant.test.js} +30 -30
- package/src/navigations/AddDeviceStack.js +0 -14
- package/src/navigations/AddGatewayStack.js +51 -21
- package/src/navigations/Main.js +28 -4
- package/src/navigations/SmartIrStack.js +3 -3
- package/src/navigations/UnitStack.js +5 -8
- package/src/screens/AQIGuide/__test__/AQIGuide.test.js +5 -3
- package/src/screens/AQIGuide/index.js +5 -3
- package/src/screens/ActivityLog/FilterPopup.js +2 -2
- package/src/screens/ActivityLog/__test__/FilterPopup.test.js +2 -2
- package/src/screens/ActivityLog/__test__/index.test.js +3 -2
- package/src/screens/ActivityLog/index.js +3 -3
- package/src/screens/AddCommon/SelectSubUnit.js +44 -191
- package/src/screens/AddCommon/SelectUnit.js +51 -204
- package/src/screens/AddCommon/__test__/SelectSubUnit.test.js +7 -50
- package/src/screens/AddCommon/__test__/SelectUnit.test.js +28 -26
- package/src/screens/AddLocationMaps/__test__/index.test.js +13 -7
- package/src/screens/AddLocationMaps/index.js +3 -3
- package/src/screens/AddNewAction/Device/index.js +5 -1
- package/src/screens/AddNewAction/SelectAction.js +36 -20
- package/src/screens/AddNewAction/SelectSensorDevices.js +3 -3
- package/src/screens/AddNewAction/__test__/SelectAction.test.js +3 -2
- package/src/screens/AddNewAction/__test__/SelectSensorDevices.test.js +8 -3
- package/src/screens/AddNewAutoSmart/__test__/AddNewAutoSmart.test.js +11 -7
- package/src/screens/AddNewAutoSmart/index.js +11 -12
- package/src/screens/AddNewDevice/ConnectingDevices.js +1 -1
- package/src/screens/AddNewDevice/__test__/AddNewDevice.test.js +7 -4
- package/src/screens/AddNewDevice/index.js +4 -4
- package/src/screens/AddNewGateway/ConnectingDevice.js +40 -0
- package/src/screens/AddNewGateway/ConnectingModbusDevice.js +61 -0
- package/src/screens/AddNewGateway/ConnectingWifiDevice.js +70 -0
- package/src/screens/AddNewGateway/ConnectingZigbeeDevice.js +60 -0
- package/src/screens/AddNewGateway/PlugAndPlay/FirstWarning.js +21 -8
- package/src/screens/AddNewGateway/PlugAndPlay/__test__/FirstWarning.test.js +23 -4
- package/src/screens/AddNewGateway/RenameNewDevices.js +141 -0
- package/src/screens/AddNewGateway/RenameNewDevicesStyles.js +75 -0
- package/src/screens/AddNewGateway/ScanGatewayQR.js +57 -0
- package/src/screens/AddNewGateway/ScanModbusQR.js +53 -0
- package/src/screens/AddNewGateway/ScanWifiDeviceQR.js +55 -0
- package/src/screens/AddNewGateway/SelectDeviceSubUnit.js +31 -0
- package/src/screens/AddNewGateway/SelectDeviceType.js +52 -0
- package/src/screens/AddNewGateway/SelectDeviceUnit.js +29 -0
- package/src/screens/AddNewGateway/SelectModbusGateway.js +34 -0
- package/src/screens/AddNewGateway/SelectZigbeeGateway.js +34 -0
- package/src/screens/AddNewGateway/ShareWifiPassword.js +302 -0
- package/src/screens/AddNewGateway/ShareWifiPasswordStyles.js +44 -0
- package/src/screens/AddNewGateway/__test__/AddNewGateway.test.js +7 -4
- package/src/screens/AddNewGateway/__test__/ConnectingModbusDevice.test.js +63 -0
- package/src/screens/AddNewGateway/__test__/{SelectGateway.test.js → ConnectingWifiDevice.test.js} +15 -10
- package/src/screens/AddNewGateway/__test__/ConnectingZigbeeDevice.test.js +62 -0
- package/src/screens/AddNewGateway/__test__/RenameNewDevices.test.js +191 -0
- package/src/screens/AddNewGateway/__test__/ScanGatewayQR.test.js +73 -0
- package/src/screens/AddNewGateway/__test__/ScanModbusQR.test.js +75 -0
- package/src/screens/AddNewGateway/__test__/ScanWifiDeviceQR.test.js +73 -0
- package/src/screens/AddNewGateway/__test__/SelectDeviceSubUnit.test.js +47 -0
- package/src/screens/AddNewGateway/__test__/SelectDeviceType.test.js +89 -0
- package/src/screens/AddNewGateway/__test__/SelectDeviceUnit.test.js +48 -0
- package/src/screens/AddNewGateway/__test__/SelectModbusGateway.test.js +77 -0
- package/src/screens/AddNewGateway/__test__/SelectZigbeeGateway.test.js +77 -0
- package/src/screens/AddNewGateway/__test__/ShareWifiPassword.test.js +294 -0
- package/src/screens/AddNewGateway/hooks/__Tests__/index.test.js +27 -0
- package/src/screens/AddNewGateway/index.js +4 -4
- package/src/screens/AddNewOneTap/__test__/AddNewOneTap.test.js +5 -4
- package/src/screens/AddNewOneTap/index.js +4 -4
- package/src/screens/Automate/__test__/index.test.js +2 -2
- package/src/screens/Automate/index.js +6 -2
- package/src/screens/ConfirmUnitDeletion/__test__/ConfirmUnitDeletion.test.js +3 -2
- package/src/screens/ConfirmUnitDeletion/index.js +3 -3
- package/src/screens/Device/EditDevice/__test__/EditDevice.test.js +5 -5
- package/src/screens/Device/EditDevice/index.js +3 -3
- package/src/screens/Device/__test__/detail.test.js +38 -22
- package/src/screens/Device/components/DetailHistoryChart.js +7 -5
- package/src/screens/Device/components/SensorConnectStatusViewHeader.js +16 -17
- package/src/screens/Device/components/SensorDisplayItem.js +51 -26
- package/src/screens/Device/detail.js +65 -38
- package/src/screens/Device/hooks/useEvaluateValue.js +0 -2
- package/src/screens/Device/hooks/useFavoriteDevice.js +4 -2
- package/src/screens/DeviceInfo/__test__/index.test.js +8 -4
- package/src/screens/DeviceInfo/index.js +10 -6
- package/src/screens/Drawer/index.js +30 -13
- package/src/screens/EmergencyContacts/EmergencyContactsAddNew.js +11 -7
- package/src/screens/EmergencyContacts/EmergencyContactsList.js +1 -1
- package/src/screens/EmergencyContacts/EmergencyContactsSelectContacts.js +9 -10
- package/src/screens/EmergencyContacts/__test__/EmergencyContactAddNew.test.js +9 -5
- package/src/screens/EmergencyContacts/__test__/EmergencyContactList.test.js +7 -3
- package/src/screens/EmergencyContacts/__test__/EmergencyContactsSelectContacts.test.js +7 -3
- package/src/screens/EmergencySetting/__test__/DropDownItem.test.js +3 -2
- package/src/screens/EmergencySetting/components/DropDownItem.js +2 -2
- package/src/screens/EnterPassword/__test__/EnterPassword.test.js +6 -3
- package/src/screens/EnterPassword/index.js +5 -3
- package/src/screens/GuestInfo/__test__/index.test.js +18 -12
- package/src/screens/GuestInfo/components/AccessScheduleItem.js +2 -2
- package/src/screens/GuestInfo/components/AccessScheduleSheet.js +3 -3
- package/src/screens/GuestInfo/components/HeaderGuestInfo.js +2 -2
- package/src/screens/GuestInfo/components/RecurringDetail.js +4 -4
- package/src/screens/GuestInfo/components/TemporaryDetail.js +3 -3
- package/src/screens/GuestInfo/index.js +1 -1
- package/src/screens/HanetCamera/Detail.js +10 -4
- package/src/screens/HanetCamera/ManageAccess.js +4 -4
- package/src/screens/HanetCamera/MemberInfo.js +1 -1
- package/src/screens/HanetCamera/__test__/Detail.test.js +5 -3
- package/src/screens/HanetCamera/__test__/ManageAccess.test.js +10 -4
- package/src/screens/HanetCamera/__test__/MemberInfo.test.js +4 -2
- package/src/screens/HanetCamera/components/RequestFaceIDPopup.js +2 -2
- package/src/screens/ManageAccess/index.js +1 -1
- package/src/screens/MoveToAnotherSubUnit/__test__/index.test.js +4 -4
- package/src/screens/MoveToAnotherSubUnit/index.js +2 -2
- package/src/screens/Notification/__test__/NotificationItem.test.js +6 -30
- package/src/screens/Notification/components/NotificationItem.js +3 -19
- package/src/screens/PlayBackCamera/__test__/index.test.js +9 -6
- package/src/screens/PlayBackCamera/index.js +6 -6
- package/src/screens/ScanChipQR/components/QRScan/__test__/QRScan.test.js +1 -1
- package/src/screens/ScanChipQR/components/QRScan/index.js +10 -3
- package/src/screens/ScriptDetail/__test__/index.test.js +8 -4
- package/src/screens/ScriptDetail/index.js +7 -5
- package/src/screens/SelectUnit/__test__/index.test.js +4 -3
- package/src/screens/SelectUnit/index.js +3 -3
- package/src/screens/SetSchedule/index.js +1 -1
- package/src/screens/Sharing/Components/SensorItem.js +6 -3
- package/src/screens/Sharing/Components/Styles/SensorItemStyles.js +4 -0
- package/src/screens/Sharing/Components/Styles/TitleCheckBoxStyles.js +4 -0
- package/src/screens/Sharing/Components/TitleCheckBox.js +17 -8
- package/src/screens/Sharing/Components/__test__/SensorItem.test.js +4 -2
- package/src/screens/Sharing/InfoMemberUnit.js +7 -6
- package/src/screens/Sharing/MemberList.js +4 -4
- package/src/screens/Sharing/SelectPermission.js +9 -4
- package/src/screens/Sharing/SelectUser.js +9 -5
- package/src/screens/Sharing/__test__/InfoMemberUnit.test.js +3 -2
- package/src/screens/Sharing/__test__/SelectUser.test.js +7 -4
- package/src/screens/SideMenuDetail/__test__/index.test.js +11 -7
- package/src/screens/SideMenuDetail/index.js +2 -2
- package/src/screens/SmartIr/__test__/GroupButtonByType.test.js +4 -2
- package/src/screens/SmartIr/__test__/SelectDeviceType.test.js +5 -5
- package/src/screens/SmartIr/__test__/SmartIr.test.js +14 -6
- package/src/screens/SmartIr/components/GroupButtonByType/GroupButtonByType.js +4 -2
- package/src/screens/SmartIr/components/{SelectDeviceType.js → SelectIrDeviceType.js} +2 -2
- package/src/screens/SmartIr/index.js +1 -1
- package/src/screens/SubUnit/AddSubUnit.js +7 -3
- package/src/screens/SubUnit/Detail.js +6 -6
- package/src/screens/SubUnit/EditSubUnit.js +10 -6
- package/src/screens/SubUnit/ManageSubUnit.js +2 -2
- package/src/screens/SubUnit/__test__/AddSubUnit.test.js +6 -3
- package/src/screens/SubUnit/__test__/Detail.test.js +5 -3
- package/src/screens/SubUnit/__test__/EditSubUnit.test.js +9 -5
- package/src/screens/SubUnit/__test__/ManageSubUnit.test.js +3 -2
- package/src/screens/SyncLGDevice/AddLGDevice.js +4 -4
- package/src/screens/SyncLGDevice/__test__/AddLGDevice.test.js +7 -4
- package/src/screens/TDSGuide/__test__/TDSGuide.test.js +4 -2
- package/src/screens/TDSGuide/index.js +2 -2
- package/src/screens/Template/EditTemplate.js +152 -0
- package/src/screens/Template/GatewayList.js +51 -0
- package/src/screens/Template/Information.js +41 -0
- package/src/screens/Template/Styles/EditTemplateStyle.js +109 -0
- package/src/screens/Template/Styles/GatewayStyles.js +46 -0
- package/src/screens/Template/Styles/InformationStyles.js +16 -0
- package/src/screens/Template/Styles/detailStyles.js +35 -0
- package/src/screens/Template/Styles/indexStyles.js +2 -33
- package/src/screens/Template/__test__/EditTemplate.test.js +89 -0
- package/src/screens/Template/__test__/GatewayList.test.js +26 -0
- package/src/screens/Template/__test__/Information.test.js +16 -0
- package/src/screens/Template/__test__/detail.test.js +68 -0
- package/src/screens/Template/__test__/index.test.js +26 -1
- package/src/screens/Template/detail.js +154 -0
- package/src/screens/Template/index.js +38 -32
- package/src/screens/UVIndexGuide/__test__/UVIndexGuide.test.js +3 -2
- package/src/screens/UVIndexGuide/index.js +2 -2
- package/src/screens/Unit/AddMenu.js +6 -20
- package/src/screens/Unit/ChooseLocation.js +1 -1
- package/src/screens/Unit/Detail.js +14 -9
- package/src/screens/Unit/ManageUnit.js +21 -15
- package/src/screens/Unit/MyAllUnit/index.js +1 -1
- package/src/screens/Unit/SelectAddToFavorites.js +11 -2
- package/src/screens/Unit/SelectAddress.js +4 -4
- package/src/screens/Unit/SmartAccount.js +1 -1
- package/src/screens/Unit/SmartAccountItem.js +3 -3
- package/src/screens/Unit/Station/__test__/index.test.js +19 -3
- package/src/screens/Unit/Station/index.js +2 -2
- package/src/screens/Unit/Summaries.js +2 -2
- package/src/screens/Unit/__test__/CheckSendEmail.test.js +6 -6
- package/src/screens/Unit/__test__/Detail.test.js +90 -55
- package/src/screens/Unit/__test__/ManageUnit.test.js +40 -18
- package/src/screens/Unit/__test__/SelectAddress.test.js +15 -8
- package/src/screens/Unit/__test__/SmartAccount.test.js +42 -25
- package/src/screens/Unit/__test__/SmartAccountItem.test.js +4 -3
- package/src/screens/Unit/components/AutomateScript/index.js +8 -2
- package/src/screens/Unit/components/ListMyAllUnit/index.js +1 -1
- package/src/screens/Unit/components/MyAllUnit/__test__/Header.test.js +9 -5
- package/src/screens/Unit/components/MyAllUnit/index.js +1 -1
- package/src/screens/Unit/components/MyUnitDevice/index.js +8 -5
- package/src/screens/Unit/components/SharedUnit/index.js +12 -6
- package/src/screens/Unit/components/__test__/MyUnitDevice.test.js +2 -2
- package/src/screens/Unit/components/__test__/SharedUnit.test.js +24 -9
- package/src/screens/Unit/hook/useUnitConnectRemoteDevices.js +25 -11
- package/src/screens/UnitSummary/__test__/index.test.js +4 -2
- package/src/screens/UnitSummary/components/3PPowerConsumption/__test__/3PPowerConsumption.test.js +4 -2
- package/src/screens/UnitSummary/components/3PPowerConsumption/index.js +2 -2
- package/src/screens/UnitSummary/components/PowerConsumption/__test__/PowerConsumption.test.js +4 -2
- package/src/screens/UnitSummary/components/PowerConsumption/index.js +2 -2
- package/src/screens/UnitSummary/components/RunningDevices/__test__/index.test.js +5 -4
- package/src/screens/UnitSummary/components/RunningDevices/index.js +6 -3
- package/src/screens/UnitSummary/components/TotalPowerBox/index.js +2 -2
- package/src/screens/UnitSummary/components/TotalPowerConsumption/index.js +2 -2
- package/src/screens/UnitSummary/components/__test__/TotalPowerBox.test.js +3 -2
- package/src/screens/UnitSummary/components/__test__/TotalPowerConsumption.test.js +4 -2
- package/src/screens/UnitSummary/index.js +10 -8
- package/src/screens/WaterQualityGuide/__test__/index.test.js +17 -12
- package/src/screens/WaterQualityGuide/index.js +26 -10
- package/src/utils/Apis/axios.js +1 -0
- package/src/utils/I18n/translations/en.json +25 -10
- package/src/utils/I18n/translations/vi.json +22 -9
- package/src/utils/Route/index.js +22 -10
- package/src/commons/Connecting/index.js +0 -67
- package/src/commons/ConnectingProcess/DeviceItem/DeviceItem.js +0 -28
- package/src/commons/ConnectingProcess/DeviceItem/DeviceItemStyles.js +0 -41
- package/src/commons/ConnectingProcess/__test__/Connecting.test.js +0 -163
- package/src/commons/ConnectingProcess/__test__/DeviceItem.test.js +0 -19
- package/src/commons/ConnectingProcess/index.js +0 -213
- package/src/commons/ConnectingProcess/styles.js +0 -69
- package/src/hooks/IoT/useGGHomeConnection.js +0 -91
- package/src/iot/RemoteControl/index.js +0 -55
- package/src/screens/AddNewDevice/ConnectDevices.js +0 -184
- package/src/screens/AddNewDevice/__test__/ConnectDevices.test.js +0 -131
- package/src/screens/AddNewGateway/ConnectedGateway.js +0 -139
- package/src/screens/AddNewGateway/ConnectingGateway.js +0 -137
- package/src/screens/AddNewGateway/PlugAndPlay/ConnectWifiWarning.js +0 -214
- package/src/screens/AddNewGateway/PlugAndPlay/GatewayWifiList.js +0 -307
- package/src/screens/AddNewGateway/PlugAndPlay/__test__/ConnectWifiWarning.test.js +0 -75
- package/src/screens/AddNewGateway/PlugAndPlay/__test__/GatewayWifiList.test.js +0 -130
- package/src/screens/AddNewGateway/SelectGateway.js +0 -133
- package/src/screens/AddNewGateway/SetupGatewayWifi.js +0 -207
- package/src/screens/AddNewGateway/__test__/ConnectedGateway.test.js +0 -71
- package/src/screens/AddNewGateway/__test__/ConnectingGateway.test.js +0 -96
- package/src/screens/AddNewGateway/__test__/SetupGateway.test.js +0 -120
- package/src/screens/ScanChipQR/__test__/ScanChipQR.test.js +0 -115
- package/src/screens/ScanChipQR/hooks/index.js +0 -120
- package/src/screens/ScanChipQR/index.js +0 -29
- package/src/screens/ScanSensorQR/__test__/ScanSensorQR.test.js +0 -111
- package/src/screens/ScanSensorQR/hooks/index.js +0 -40
- package/src/screens/ScanSensorQR/index.js +0 -39
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.
|
|
4
|
+
"version": "0.3.32",
|
|
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": "
|
|
46
|
-
"watch": "
|
|
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
|
|
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",
|
|
@@ -207,9 +208,10 @@
|
|
|
207
208
|
"redux-persist": "^6.0.0",
|
|
208
209
|
"redux-saga": "^1.1.3",
|
|
209
210
|
"string-format": "^2.0.0",
|
|
210
|
-
"sync-
|
|
211
|
+
"sync-directory": "^5.1.7",
|
|
211
212
|
"timezone-mock": "^1.1.3",
|
|
212
213
|
"uuid-by-string": "^3.0.2",
|
|
214
|
+
"uuidv4": "^6.2.13",
|
|
213
215
|
"validator": "^13.1.1",
|
|
214
216
|
"victory-native": "^35.0.1"
|
|
215
217
|
},
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
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 {
|
|
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';
|
|
@@ -87,7 +87,7 @@ const ItemQuickAction = memo(({ sensor, wrapperStyle, setStatus }) => {
|
|
|
87
87
|
|
|
88
88
|
return (
|
|
89
89
|
<TouchableOpacity
|
|
90
|
-
|
|
90
|
+
accessibilityLabel={`${AccessibilityLabel.ITEM_QUICK_ACTION_PRESS}-${sensor?.id}`}
|
|
91
91
|
onPress={onActionPress}
|
|
92
92
|
>
|
|
93
93
|
<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 {
|
|
6
|
+
import { AccessibilityLabel } from '../../../configs/Constants';
|
|
7
7
|
import { factory } from 'factory-girl';
|
|
8
8
|
|
|
9
9
|
class Sensor {}
|
|
@@ -95,7 +95,8 @@ describe('Test ItemQuickAction', () => {
|
|
|
95
95
|
const instance = tree.root;
|
|
96
96
|
const buttonOnActionPress = instance.findAll(
|
|
97
97
|
(el) =>
|
|
98
|
-
el.props.
|
|
98
|
+
el.props.accessibilityLabel ===
|
|
99
|
+
`${AccessibilityLabel.ITEM_QUICK_ACTION_PRESS}-${sensor?.id}` &&
|
|
99
100
|
el.type === TouchableOpacity
|
|
100
101
|
);
|
|
101
102
|
expect(buttonOnActionPress).toHaveLength(0);
|
|
@@ -117,7 +118,8 @@ describe('Test ItemQuickAction', () => {
|
|
|
117
118
|
const instance = tree.root;
|
|
118
119
|
const buttonOnActionPress = instance.find(
|
|
119
120
|
(el) =>
|
|
120
|
-
el.props.
|
|
121
|
+
el.props.accessibilityLabel ===
|
|
122
|
+
`${AccessibilityLabel.ITEM_QUICK_ACTION_PRESS}-${sensor?.id}` &&
|
|
121
123
|
el.type === TouchableOpacity
|
|
122
124
|
);
|
|
123
125
|
expect(buttonOnActionPress).toBeDefined();
|
|
@@ -150,7 +152,8 @@ describe('Test ItemQuickAction', () => {
|
|
|
150
152
|
const instance = tree.root;
|
|
151
153
|
const buttonOnActionPress = instance.find(
|
|
152
154
|
(el) =>
|
|
153
|
-
el.props.
|
|
155
|
+
el.props.accessibilityLabel ===
|
|
156
|
+
`${AccessibilityLabel.ITEM_QUICK_ACTION_PRESS}-${sensor?.id}` &&
|
|
154
157
|
el.type === TouchableOpacity
|
|
155
158
|
);
|
|
156
159
|
expect(buttonOnActionPress).toBeDefined();
|
|
@@ -196,7 +199,8 @@ describe('Test ItemQuickAction', () => {
|
|
|
196
199
|
const instance = tree.root;
|
|
197
200
|
const buttonOnActionPress = instance.find(
|
|
198
201
|
(el) =>
|
|
199
|
-
el.props.
|
|
202
|
+
el.props.accessibilityLabel ===
|
|
203
|
+
`${AccessibilityLabel.ITEM_QUICK_ACTION_PRESS}-${sensor?.id}` &&
|
|
200
204
|
el.type === TouchableOpacity
|
|
201
205
|
);
|
|
202
206
|
|
|
@@ -219,7 +223,8 @@ describe('Test ItemQuickAction', () => {
|
|
|
219
223
|
const instance = tree.root;
|
|
220
224
|
const buttonOnActionPress = instance.find(
|
|
221
225
|
(el) =>
|
|
222
|
-
el.props.
|
|
226
|
+
el.props.accessibilityLabel ===
|
|
227
|
+
`${AccessibilityLabel.ITEM_QUICK_ACTION_PRESS}-${sensor?.id}` &&
|
|
223
228
|
el.type === TouchableOpacity
|
|
224
229
|
);
|
|
225
230
|
expect(buttonOnActionPress).toBeDefined();
|
|
@@ -235,7 +240,8 @@ describe('Test ItemQuickAction', () => {
|
|
|
235
240
|
const instance = tree.root;
|
|
236
241
|
const buttonOnActionPress = instance.find(
|
|
237
242
|
(el) =>
|
|
238
|
-
el.props.
|
|
243
|
+
el.props.accessibilityLabel ===
|
|
244
|
+
`${AccessibilityLabel.ITEM_QUICK_ACTION_PRESS}-${sensor?.id}` &&
|
|
239
245
|
el.type === TouchableOpacity
|
|
240
246
|
);
|
|
241
247
|
expect(buttonOnActionPress).toBeDefined();
|
|
@@ -282,7 +288,8 @@ describe('Test ItemQuickAction', () => {
|
|
|
282
288
|
const instance = tree.root;
|
|
283
289
|
const buttonOnActionPress = instance.find(
|
|
284
290
|
(el) =>
|
|
285
|
-
el.props.
|
|
291
|
+
el.props.accessibilityLabel ===
|
|
292
|
+
`${AccessibilityLabel.ITEM_QUICK_ACTION_PRESS}-${sensor?.id}` &&
|
|
286
293
|
el.type === TouchableOpacity
|
|
287
294
|
);
|
|
288
295
|
|
|
@@ -313,7 +320,8 @@ describe('Test ItemQuickAction', () => {
|
|
|
313
320
|
const instance = tree.root;
|
|
314
321
|
const buttonOnActionPress = instance.find(
|
|
315
322
|
(el) =>
|
|
316
|
-
el.props.
|
|
323
|
+
el.props.accessibilityLabel ===
|
|
324
|
+
`${AccessibilityLabel.ITEM_QUICK_ACTION_PRESS}-${sensor?.id}` &&
|
|
317
325
|
el.type === TouchableOpacity
|
|
318
326
|
);
|
|
319
327
|
|
|
@@ -1,41 +1,55 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, {
|
|
2
|
+
memo,
|
|
3
|
+
useState,
|
|
4
|
+
useEffect,
|
|
5
|
+
useContext,
|
|
6
|
+
useCallback,
|
|
7
|
+
} from 'react';
|
|
2
8
|
import { View } from 'react-native';
|
|
3
9
|
import styles from './ColorPickerTemplateStyles';
|
|
4
10
|
import ColorPicker from 'react-native-wheel-color-picker';
|
|
5
11
|
import { useConfigGlobalState } from '../../iot/states';
|
|
12
|
+
import { SCContext } from '../../context';
|
|
13
|
+
import { Action } from '../../context/actionType';
|
|
6
14
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const WheelColorPicker = ({ valueColor, onChangeColor }) => {
|
|
15
|
+
const WheelColorPicker = ({ valueColor, onChangeColor, onStart }) => {
|
|
10
16
|
return (
|
|
11
17
|
<ColorPicker
|
|
12
18
|
style={styles.colorPicker}
|
|
13
19
|
sliderHidden={true}
|
|
14
20
|
swatches={false}
|
|
15
21
|
color={valueColor}
|
|
22
|
+
onInteractionStart={onStart}
|
|
16
23
|
onColorChangeComplete={onChangeColor}
|
|
17
24
|
thumbSize={16}
|
|
18
25
|
/>
|
|
19
26
|
);
|
|
20
27
|
};
|
|
21
28
|
|
|
22
|
-
|
|
23
|
-
|
|
29
|
+
let isFirstTime = true;
|
|
30
|
+
const ColorPickerTemplate = memo(({ actionGroup = {}, doAction, sensor }) => {
|
|
31
|
+
const { configuration = {} } = actionGroup;
|
|
24
32
|
const [valueColorComplete, setValueColorComplete] = useState('');
|
|
25
33
|
const [configValues] = useConfigGlobalState('configValues');
|
|
34
|
+
const { setAction } = useContext(SCContext);
|
|
26
35
|
|
|
27
|
-
const onChangeColor = (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
36
|
+
const onChangeColor = useCallback(
|
|
37
|
+
(color) => {
|
|
38
|
+
setAction(Action.SET_LOCK_VIEW_PICK_COLOR, false);
|
|
39
|
+
const to = setTimeout(() => {
|
|
40
|
+
isFirstTime = false;
|
|
41
|
+
clearTimeout(to);
|
|
42
|
+
}, 1000);
|
|
32
43
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
44
|
+
!isFirstTime &&
|
|
45
|
+
doAction(
|
|
46
|
+
configuration?.action_color_data,
|
|
47
|
+
JSON.stringify({ value: color })
|
|
48
|
+
);
|
|
49
|
+
},
|
|
50
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
51
|
+
[configuration?.action_color_data, doAction]
|
|
52
|
+
);
|
|
39
53
|
|
|
40
54
|
useEffect(() => {
|
|
41
55
|
const { config } = configuration;
|
|
@@ -50,11 +64,16 @@ const ColorPickerTemplate = memo(({ actionGroup, doAction, sensor }) => {
|
|
|
50
64
|
return () => (isFirstTime = true);
|
|
51
65
|
}, []);
|
|
52
66
|
|
|
67
|
+
const onStartPickColor = useCallback(() => {
|
|
68
|
+
setAction(Action.SET_LOCK_VIEW_PICK_COLOR, true);
|
|
69
|
+
}, [setAction]);
|
|
70
|
+
|
|
53
71
|
return (
|
|
54
72
|
<View style={styles.viewPickColor}>
|
|
55
73
|
<WheelColorPicker
|
|
56
74
|
valueColor={valueColorComplete}
|
|
57
75
|
onChangeColor={onChangeColor}
|
|
76
|
+
onStart={onStartPickColor}
|
|
58
77
|
/>
|
|
59
78
|
</View>
|
|
60
79
|
);
|
|
@@ -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 {
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
94
|
+
accessibilityLabel={AccessibilityLabel.TEXT_DOOR_LOOK_ON_OFF}
|
|
95
95
|
>
|
|
96
96
|
{text_door_lock}{' '}
|
|
97
97
|
</Text>
|
|
@@ -8,18 +8,23 @@ 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,
|
|
12
|
-
|
|
13
|
-
const NumberUpDownActionTemplate = ({
|
|
14
|
-
|
|
11
|
+
import { DEVICE_TYPE, AccessibilityLabel } from '../../configs/Constants';
|
|
12
|
+
|
|
13
|
+
const NumberUpDownActionTemplate = ({
|
|
14
|
+
actionGroup = {},
|
|
15
|
+
doAction,
|
|
16
|
+
sensor = {},
|
|
17
|
+
}) => {
|
|
18
|
+
const { configuration = {}, title } = actionGroup;
|
|
15
19
|
const {
|
|
16
20
|
action_data,
|
|
17
21
|
max_value,
|
|
18
22
|
min_value,
|
|
19
|
-
text_format,
|
|
23
|
+
text_format = '',
|
|
20
24
|
config,
|
|
21
25
|
allow_config_store_value,
|
|
22
26
|
} = configuration;
|
|
27
|
+
const { device_type, is_managed_by_backend } = sensor;
|
|
23
28
|
|
|
24
29
|
// eslint-disable-next-line no-unused-vars
|
|
25
30
|
const [configValues, setConfigValues] = useConfigGlobalState('configValues');
|
|
@@ -41,7 +46,7 @@ const NumberUpDownActionTemplate = ({ actionGroup, doAction, sensor }) => {
|
|
|
41
46
|
const doActionAndWatchConfig = useCallback(
|
|
42
47
|
async (actionData, actionValue) => {
|
|
43
48
|
let data = actionValue;
|
|
44
|
-
if (
|
|
49
|
+
if (device_type !== DEVICE_TYPE.GOOGLE_HOME) {
|
|
45
50
|
data = { temperature: actionValue };
|
|
46
51
|
if (allow_config_store_value && config) {
|
|
47
52
|
data.config_id = config;
|
|
@@ -50,7 +55,7 @@ const NumberUpDownActionTemplate = ({ actionGroup, doAction, sensor }) => {
|
|
|
50
55
|
data = JSON.stringify(data);
|
|
51
56
|
}
|
|
52
57
|
await doAction(actionData, data);
|
|
53
|
-
if (!
|
|
58
|
+
if (!is_managed_by_backend) {
|
|
54
59
|
return;
|
|
55
60
|
}
|
|
56
61
|
if (!config) {
|
|
@@ -58,13 +63,13 @@ const NumberUpDownActionTemplate = ({ actionGroup, doAction, sensor }) => {
|
|
|
58
63
|
}
|
|
59
64
|
|
|
60
65
|
config &&
|
|
61
|
-
|
|
66
|
+
device_type === DEVICE_TYPE.LG_THINQ &&
|
|
62
67
|
watchMultiConfigs([config]);
|
|
63
68
|
},
|
|
64
69
|
[
|
|
65
70
|
doAction,
|
|
66
|
-
|
|
67
|
-
|
|
71
|
+
is_managed_by_backend,
|
|
72
|
+
device_type,
|
|
68
73
|
allow_config_store_value,
|
|
69
74
|
config,
|
|
70
75
|
]
|
|
@@ -109,12 +114,12 @@ const NumberUpDownActionTemplate = ({ actionGroup, doAction, sensor }) => {
|
|
|
109
114
|
<TouchableOpacity
|
|
110
115
|
style={styles.downButton}
|
|
111
116
|
onPress={doActionDown}
|
|
112
|
-
|
|
117
|
+
accessibilityLabel={AccessibilityLabel.NUMBER_ACTION_DOWN}
|
|
113
118
|
>
|
|
114
119
|
<IconOutline name="down" size={32} color={Colors.Primary} />
|
|
115
120
|
</TouchableOpacity>
|
|
116
121
|
|
|
117
|
-
<Text
|
|
122
|
+
<Text accessibilityLabel={'abcd'} type="H2">
|
|
118
123
|
{value !== undefined ? (
|
|
119
124
|
text_format.replace('{number}', value)
|
|
120
125
|
) : (
|
|
@@ -125,7 +130,7 @@ const NumberUpDownActionTemplate = ({ actionGroup, doAction, sensor }) => {
|
|
|
125
130
|
<TouchableOpacity
|
|
126
131
|
style={styles.upButton}
|
|
127
132
|
onPress={doActionUp}
|
|
128
|
-
|
|
133
|
+
accessibilityLabel={AccessibilityLabel.NUMBER_ACTION_UP}
|
|
129
134
|
>
|
|
130
135
|
<IconOutline name="up" size={32} color={Colors.Primary} />
|
|
131
136
|
</TouchableOpacity>
|
|
@@ -14,10 +14,13 @@ const ButtonWrapper = memo(
|
|
|
14
14
|
isButtonReLockTiming,
|
|
15
15
|
toggleSwitch,
|
|
16
16
|
isEnabled,
|
|
17
|
-
|
|
17
|
+
accessibilityLabel,
|
|
18
18
|
}) => {
|
|
19
19
|
return (
|
|
20
|
-
<View
|
|
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 {
|
|
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) =>
|
|
21
|
+
(item) =>
|
|
22
|
+
item.props.accessibilityLabel ===
|
|
23
|
+
AccessibilityLabel.AUTO_LOCK_BUTTON_ENABLE
|
|
22
24
|
);
|
|
23
25
|
const buttonInstant = instance.findAll(
|
|
24
|
-
(item) =>
|
|
26
|
+
(item) =>
|
|
27
|
+
item.props.accessibilityLabel ===
|
|
28
|
+
AccessibilityLabel.AUTO_LOCK_BUTTON_INSTANT
|
|
25
29
|
);
|
|
26
30
|
const buttonRelockTiming = instance.findAll(
|
|
27
|
-
(item) =>
|
|
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 {
|
|
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
|
-
|
|
28
|
+
accessibilityLabel={AccessibilityLabel.AUTO_LOCK_BUTTON_ENABLE}
|
|
29
29
|
/>
|
|
30
30
|
<ButtonWrapper
|
|
31
31
|
isButtonInstant
|
|
32
|
-
|
|
32
|
+
accessibilityLabel={AccessibilityLabel.AUTO_LOCK_BUTTON_INSTANT}
|
|
33
33
|
/>
|
|
34
34
|
<ButtonWrapper
|
|
35
35
|
isButtonReLockTiming
|
|
36
36
|
isEnabled={isEnabled}
|
|
37
|
-
|
|
37
|
+
accessibilityLabel={AccessibilityLabel.AUTO_LOCK_BUTTON_RELOCK_TIMING}
|
|
38
38
|
/>
|
|
39
39
|
<View style={styles.slider}>
|
|
40
40
|
<Slider
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { memo, useCallback, useEffect, useState } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { TouchableOpacity, View } from 'react-native';
|
|
3
3
|
import { useTranslations } from '../../../hooks/Common/useTranslations';
|
|
4
|
-
import { Section } from '../../Section';
|
|
5
4
|
import Text from '../../Text';
|
|
6
5
|
import styles from './OnOffSmartLockStyle';
|
|
7
6
|
import ButtonLock from '../../../../assets/images/Device/button-lock.svg';
|
|
@@ -9,12 +8,14 @@ import ButtonUnLock from '../../../../assets/images/Device/button-unlock.svg';
|
|
|
9
8
|
import { useConfigGlobalState } from '../../../iot/states';
|
|
10
9
|
import { useUnwatchLGDeviceConfigControl } from '../../../hooks/IoT';
|
|
11
10
|
import { watchMultiConfigs } from '../../../iot/Monitor';
|
|
12
|
-
import { DEVICE_TYPE,
|
|
11
|
+
import { DEVICE_TYPE, AccessibilityLabel } from '../../../configs/Constants';
|
|
13
12
|
|
|
14
|
-
const OnOffSmartLock = memo(({ actionGroup, doAction, sensor }) => {
|
|
13
|
+
const OnOffSmartLock = memo(({ actionGroup = {}, doAction, sensor = {} }) => {
|
|
15
14
|
const t = useTranslations();
|
|
16
|
-
const { configuration } = actionGroup;
|
|
17
|
-
const { action_on_data, action_off_data } =
|
|
15
|
+
const { configuration = {} } = actionGroup;
|
|
16
|
+
const { action_on_data, action_off_data, config, is_on_value } =
|
|
17
|
+
configuration;
|
|
18
|
+
const { is_managed_by_backend, device_type } = sensor;
|
|
18
19
|
const [isUnlock, setisUnlock] = useState(true);
|
|
19
20
|
const [configValues] = useConfigGlobalState('configValues');
|
|
20
21
|
|
|
@@ -27,10 +28,10 @@ const OnOffSmartLock = memo(({ actionGroup, doAction, sensor }) => {
|
|
|
27
28
|
const dataUnlock = { door_lock: 1 };
|
|
28
29
|
await doAction(action_off_data, JSON.stringify(dataUnlock));
|
|
29
30
|
}
|
|
30
|
-
if (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
watchMultiConfigs([
|
|
31
|
+
if (is_managed_by_backend) {
|
|
32
|
+
config &&
|
|
33
|
+
device_type === DEVICE_TYPE.LG_THINQ &&
|
|
34
|
+
watchMultiConfigs([config]);
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
}, [
|
|
@@ -38,54 +39,46 @@ const OnOffSmartLock = memo(({ actionGroup, doAction, sensor }) => {
|
|
|
38
39
|
action_on_data,
|
|
39
40
|
doAction,
|
|
40
41
|
isUnlock,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
config,
|
|
43
|
+
is_managed_by_backend,
|
|
44
|
+
device_type,
|
|
44
45
|
]);
|
|
45
46
|
|
|
46
|
-
useUnwatchLGDeviceConfigControl(sensor, [
|
|
47
|
+
useUnwatchLGDeviceConfigControl(sensor, [config]);
|
|
47
48
|
|
|
48
49
|
useEffect(() => {
|
|
49
|
-
const { is_on_value, config } = configuration;
|
|
50
50
|
const configValue = configValues[config];
|
|
51
51
|
if (is_on_value && is_on_value.length) {
|
|
52
52
|
setisUnlock(is_on_value.includes(configValue?.value));
|
|
53
53
|
} else {
|
|
54
54
|
setisUnlock(configValue?.value);
|
|
55
55
|
}
|
|
56
|
-
}, [configValues, configuration]);
|
|
56
|
+
}, [config, configValues, configuration, is_on_value]);
|
|
57
57
|
|
|
58
58
|
return (
|
|
59
|
-
|
|
60
|
-
<View
|
|
61
|
-
<
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
)}
|
|
76
|
-
<Text style={styles.textSmartLock}>
|
|
77
|
-
{t(isUnlock ? 'lock' : 'unlock')}
|
|
78
|
-
</Text>
|
|
79
|
-
</TouchableOpacity>
|
|
80
|
-
</View>
|
|
81
|
-
<View style={styles.wrapStatus}>
|
|
82
|
-
<Text style={styles.textStatus}>
|
|
83
|
-
{t(isUnlock ? 'door_is_open' : 'door_is_close')}
|
|
84
|
-
</Text>
|
|
85
|
-
</View>
|
|
86
|
-
</Section>
|
|
59
|
+
<>
|
|
60
|
+
<View>
|
|
61
|
+
<TouchableOpacity
|
|
62
|
+
onPress={handleActionSmartLock}
|
|
63
|
+
accessibilityLabel={AccessibilityLabel.BUTTON_ON_OFF}
|
|
64
|
+
style={styles.wrapButtonSmartLock}
|
|
65
|
+
>
|
|
66
|
+
{isUnlock ? (
|
|
67
|
+
<ButtonLock style={styles.buttonSmartLock} />
|
|
68
|
+
) : (
|
|
69
|
+
<ButtonUnLock style={styles.buttonSmartLock} />
|
|
70
|
+
)}
|
|
71
|
+
<Text style={styles.textSmartLock}>
|
|
72
|
+
{t(isUnlock ? 'lock' : 'unlock')}
|
|
73
|
+
</Text>
|
|
74
|
+
</TouchableOpacity>
|
|
87
75
|
</View>
|
|
88
|
-
|
|
76
|
+
<View style={styles.wrapStatus}>
|
|
77
|
+
<Text style={styles.textStatus}>
|
|
78
|
+
{t(isUnlock ? 'door_is_open' : 'door_is_close')}
|
|
79
|
+
</Text>
|
|
80
|
+
</View>
|
|
81
|
+
</>
|
|
89
82
|
);
|
|
90
83
|
});
|
|
91
84
|
|
|
@@ -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 {
|
|
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.
|
|
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 {
|
|
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
|
-
|
|
54
|
+
accessibilityLabel={AccessibilityLabel.PASSCODE_LIST}
|
|
55
55
|
>
|
|
56
56
|
<View>
|
|
57
57
|
<Text style={styles.textCode}>{item.code}</Text>
|