@eohjsc/react-native-smart-city 0.3.30 → 0.3.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +20 -4
- package/src/commons/Action/__test__/ItemQuickAction.test.js +35 -11
- package/src/commons/ActionGroup/ColorPickerTemplate.js +36 -17
- package/src/commons/ActionGroup/CurtainButtonTemplate.js +6 -6
- package/src/commons/ActionGroup/NumberUpDownActionTemplate.js +23 -15
- 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 +30 -12
- package/src/commons/ActionGroup/OneBigButtonTemplate.js +5 -5
- package/src/commons/ActionGroup/OptionsDropdownActionTemplate.js +51 -28
- package/src/commons/ActionGroup/SliderRangeTemplate.js +2 -2
- 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 +21 -7
- 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/ActionTemplate/OnOffButtonAction.js +14 -5
- package/src/commons/ActionTemplate/__test__/OnOffButtonAction.test.js +23 -2
- package/src/commons/ActionTemplate/__test__/index.test.js +2 -0
- package/src/commons/ActionTemplate/index.js +1 -0
- 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 +22 -3
- package/src/commons/BackDefault/index.js +2 -2
- package/src/commons/BottomButtonView/index.js +4 -5
- package/src/commons/Button/index.js +0 -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 +7 -12
- package/src/commons/Device/ItemDevice.js +16 -11
- 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 +5 -4
- package/src/commons/NavBar/index.js +2 -3
- package/src/commons/OneTapTemplate/NumberUpDownActionTemplate.js +12 -6
- 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 -13
- 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 +4 -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/Tabbar/__test__/index.test.js +97 -0
- 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 +611 -0
- package/src/configs/Colors.js +4 -0
- package/src/configs/Constants.js +1 -604
- 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/__test__/withRemoteControl.test.js +24 -0
- package/src/hoc/withRemoteControl.js +1 -0
- package/src/hooks/Common/__test__/useAndroidTranslucentStatusBar.test.js +55 -0
- package/src/hooks/Common/index.js +2 -2
- package/src/hooks/Common/useDevicesStatus.js +19 -15
- 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/__test__/useInitDeepLink.test.js +28 -0
- package/src/hooks/useReceiveNotifications.js +2 -4
- package/src/iot/RemoteControl/{GoogleHome.js → HomeAssistant.js} +21 -17
- 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 +1 -1
- 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 +2 -2
- package/src/screens/AddNewAction/SelectAction.js +16 -7
- package/src/screens/AddNewAction/SelectSensorDevices.js +3 -3
- package/src/screens/AddNewAction/__test__/SelectAction.test.js +2 -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 +9 -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 +6 -6
- package/src/screens/Device/components/SensorDisplayItem.js +51 -26
- package/src/screens/Device/detail.js +31 -23
- package/src/screens/Device/hooks/useEvaluateValue.js +0 -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 +8 -4
- package/src/screens/EmergencyContacts/EmergencyContactsList.js +1 -1
- package/src/screens/EmergencyContacts/EmergencyContactsSelectContacts.js +5 -3
- 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/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 +43 -38
- package/src/screens/ScriptDetail/index.js +26 -16
- 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 → DeviceItem.js} +16 -22
- package/src/screens/Sharing/Components/Styles/{SensorItemStyles.js → DeviceItemStyles.js} +0 -0
- package/src/screens/Sharing/Components/__test__/{SensorItem.test.js → DeviceItem.test.js} +10 -8
- package/src/screens/Sharing/Components/index.js +2 -2
- package/src/screens/Sharing/InfoMemberUnit.js +7 -6
- package/src/screens/Sharing/MemberList.js +4 -4
- package/src/screens/Sharing/SelectPermission.js +72 -72
- package/src/screens/Sharing/SelectUser.js +9 -5
- package/src/screens/Sharing/Styles/SelectPermissionStyles.js +2 -2
- package/src/screens/Sharing/__test__/InfoMemberUnit.test.js +3 -2
- package/src/screens/Sharing/__test__/SelectPermission.test.js +12 -12
- 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 +10 -10
- package/src/screens/Unit/ManageUnit.js +21 -15
- package/src/screens/Unit/MyAllUnit/index.js +1 -1
- package/src/screens/Unit/SelectAddToFavorites.js +7 -8
- 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 +5 -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 +20 -10
- package/src/utils/I18n/translations/vi.json +17 -9
- package/src/utils/Route/index.js +22 -10
- package/src/utils/Utils.js +6 -7
- 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 -319
- 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.33",
|
|
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';
|
|
@@ -53,7 +53,24 @@ const ItemQuickAction = memo(({ sensor, wrapperStyle, setStatus }) => {
|
|
|
53
53
|
}, [sensor, configValues, statusCallback]);
|
|
54
54
|
const userId = useSCContextSelector((state) => state?.auth.account.user.id);
|
|
55
55
|
const onActionPress = useCallback(() => {
|
|
56
|
-
|
|
56
|
+
let data = null;
|
|
57
|
+
if (
|
|
58
|
+
action?.allow_config_store_value_id === sensor?.quick_action?.config_id
|
|
59
|
+
) {
|
|
60
|
+
if (action?.name?.toLowerCase().includes('off')) {
|
|
61
|
+
data = {
|
|
62
|
+
config_id: action?.allow_config_store_value_id,
|
|
63
|
+
config_value: 0,
|
|
64
|
+
};
|
|
65
|
+
} else {
|
|
66
|
+
data = {
|
|
67
|
+
config_id: action?.allow_config_store_value_id,
|
|
68
|
+
config_value: 1,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
data = JSON.stringify(data);
|
|
72
|
+
}
|
|
73
|
+
sendRemoteCommand(sensor, action, data, userId);
|
|
57
74
|
setIsSendingCommand(true);
|
|
58
75
|
|
|
59
76
|
if (!sensor.quick_action) {
|
|
@@ -87,8 +104,7 @@ const ItemQuickAction = memo(({ sensor, wrapperStyle, setStatus }) => {
|
|
|
87
104
|
|
|
88
105
|
return (
|
|
89
106
|
<TouchableOpacity
|
|
90
|
-
|
|
91
|
-
accessibilityLabel={`${TESTID.ITEM_QUICK_ACTION_PRESS}-${sensor?.id}`}
|
|
107
|
+
accessibilityLabel={`${AccessibilityLabel.ITEM_QUICK_ACTION_PRESS}-${sensor?.id}`}
|
|
92
108
|
onPress={onActionPress}
|
|
93
109
|
>
|
|
94
110
|
<View style={wrapperStyle}>
|
|
@@ -3,7 +3,7 @@ import { TouchableOpacity } from 'react-native';
|
|
|
3
3
|
import { act, create } from 'react-test-renderer';
|
|
4
4
|
import ItemQuickAction from '../ItemQuickAction';
|
|
5
5
|
import { Colors } from '../../../configs';
|
|
6
|
-
import {
|
|
6
|
+
import { AccessibilityLabel } from '../../../configs/Constants';
|
|
7
7
|
import { factory } from 'factory-girl';
|
|
8
8
|
|
|
9
9
|
class Sensor {}
|
|
@@ -41,10 +41,12 @@ describe('Test ItemQuickAction', () => {
|
|
|
41
41
|
|
|
42
42
|
const sensor = {
|
|
43
43
|
action: {
|
|
44
|
+
name: 'off',
|
|
44
45
|
color: '#00979D',
|
|
45
46
|
command_prefer_over_bluetooth: true,
|
|
46
47
|
command_prefer_over_googlehome: false,
|
|
47
48
|
command_prefer_over_internet: false,
|
|
49
|
+
allow_config_store_value_id: 51,
|
|
48
50
|
id: 9,
|
|
49
51
|
},
|
|
50
52
|
quick_action: {
|
|
@@ -73,6 +75,7 @@ describe('Test ItemQuickAction', () => {
|
|
|
73
75
|
command_prefer_over_bluetooth: true,
|
|
74
76
|
command_prefer_over_googlehome: false,
|
|
75
77
|
command_prefer_over_internet: false,
|
|
78
|
+
allow_config_store_value_id: 51,
|
|
76
79
|
id: 10,
|
|
77
80
|
},
|
|
78
81
|
status: 'OFF',
|
|
@@ -95,7 +98,8 @@ describe('Test ItemQuickAction', () => {
|
|
|
95
98
|
const instance = tree.root;
|
|
96
99
|
const buttonOnActionPress = instance.findAll(
|
|
97
100
|
(el) =>
|
|
98
|
-
el.props.
|
|
101
|
+
el.props.accessibilityLabel ===
|
|
102
|
+
`${AccessibilityLabel.ITEM_QUICK_ACTION_PRESS}-${sensor?.id}` &&
|
|
99
103
|
el.type === TouchableOpacity
|
|
100
104
|
);
|
|
101
105
|
expect(buttonOnActionPress).toHaveLength(0);
|
|
@@ -117,7 +121,8 @@ describe('Test ItemQuickAction', () => {
|
|
|
117
121
|
const instance = tree.root;
|
|
118
122
|
const buttonOnActionPress = instance.find(
|
|
119
123
|
(el) =>
|
|
120
|
-
el.props.
|
|
124
|
+
el.props.accessibilityLabel ===
|
|
125
|
+
`${AccessibilityLabel.ITEM_QUICK_ACTION_PRESS}-${sensor?.id}` &&
|
|
121
126
|
el.type === TouchableOpacity
|
|
122
127
|
);
|
|
123
128
|
expect(buttonOnActionPress).toBeDefined();
|
|
@@ -134,7 +139,7 @@ describe('Test ItemQuickAction', () => {
|
|
|
134
139
|
expect(mockSetState).toBeCalledWith(sensor.quick_action.off_action);
|
|
135
140
|
});
|
|
136
141
|
|
|
137
|
-
test('render with icon_outlined poweroff', () => {
|
|
142
|
+
test('render with icon_outlined poweroff and action have allow_config_store_value_id', () => {
|
|
138
143
|
const mockSetStatus = jest.fn();
|
|
139
144
|
sensor.action.icon = null;
|
|
140
145
|
act(() => {
|
|
@@ -150,7 +155,8 @@ describe('Test ItemQuickAction', () => {
|
|
|
150
155
|
const instance = tree.root;
|
|
151
156
|
const buttonOnActionPress = instance.find(
|
|
152
157
|
(el) =>
|
|
153
|
-
el.props.
|
|
158
|
+
el.props.accessibilityLabel ===
|
|
159
|
+
`${AccessibilityLabel.ITEM_QUICK_ACTION_PRESS}-${sensor?.id}` &&
|
|
154
160
|
el.type === TouchableOpacity
|
|
155
161
|
);
|
|
156
162
|
expect(buttonOnActionPress).toBeDefined();
|
|
@@ -159,7 +165,12 @@ describe('Test ItemQuickAction', () => {
|
|
|
159
165
|
act(() => {
|
|
160
166
|
buttonOnActionPress.props.onPress();
|
|
161
167
|
});
|
|
162
|
-
expect(mockSendRemoteControl).
|
|
168
|
+
expect(mockSendRemoteControl).toBeCalledWith(
|
|
169
|
+
sensor,
|
|
170
|
+
sensor.action,
|
|
171
|
+
JSON.stringify({ config_id: 51, config_value: 0 }),
|
|
172
|
+
undefined
|
|
173
|
+
);
|
|
163
174
|
expect(mockSetState).toBeCalledTimes(1);
|
|
164
175
|
|
|
165
176
|
jest.runAllTimers();
|
|
@@ -196,7 +207,8 @@ describe('Test ItemQuickAction', () => {
|
|
|
196
207
|
const instance = tree.root;
|
|
197
208
|
const buttonOnActionPress = instance.find(
|
|
198
209
|
(el) =>
|
|
199
|
-
el.props.
|
|
210
|
+
el.props.accessibilityLabel ===
|
|
211
|
+
`${AccessibilityLabel.ITEM_QUICK_ACTION_PRESS}-${sensor?.id}` &&
|
|
200
212
|
el.type === TouchableOpacity
|
|
201
213
|
);
|
|
202
214
|
|
|
@@ -219,7 +231,8 @@ describe('Test ItemQuickAction', () => {
|
|
|
219
231
|
const instance = tree.root;
|
|
220
232
|
const buttonOnActionPress = instance.find(
|
|
221
233
|
(el) =>
|
|
222
|
-
el.props.
|
|
234
|
+
el.props.accessibilityLabel ===
|
|
235
|
+
`${AccessibilityLabel.ITEM_QUICK_ACTION_PRESS}-${sensor?.id}` &&
|
|
223
236
|
el.type === TouchableOpacity
|
|
224
237
|
);
|
|
225
238
|
expect(buttonOnActionPress).toBeDefined();
|
|
@@ -235,7 +248,8 @@ describe('Test ItemQuickAction', () => {
|
|
|
235
248
|
const instance = tree.root;
|
|
236
249
|
const buttonOnActionPress = instance.find(
|
|
237
250
|
(el) =>
|
|
238
|
-
el.props.
|
|
251
|
+
el.props.accessibilityLabel ===
|
|
252
|
+
`${AccessibilityLabel.ITEM_QUICK_ACTION_PRESS}-${sensor?.id}` &&
|
|
239
253
|
el.type === TouchableOpacity
|
|
240
254
|
);
|
|
241
255
|
expect(buttonOnActionPress).toBeDefined();
|
|
@@ -243,10 +257,12 @@ describe('Test ItemQuickAction', () => {
|
|
|
243
257
|
test('trigger action with quick action no auto update', () => {
|
|
244
258
|
const noAutoUpdateSensor = {
|
|
245
259
|
action: {
|
|
260
|
+
name: 'on',
|
|
246
261
|
color: '#00979D',
|
|
247
262
|
command_prefer_over_bluetooth: true,
|
|
248
263
|
command_prefer_over_googlehome: false,
|
|
249
264
|
command_prefer_over_internet: false,
|
|
265
|
+
allow_config_store_value_id: 51,
|
|
250
266
|
id: 9,
|
|
251
267
|
icon: 'caret-up',
|
|
252
268
|
},
|
|
@@ -282,7 +298,8 @@ describe('Test ItemQuickAction', () => {
|
|
|
282
298
|
const instance = tree.root;
|
|
283
299
|
const buttonOnActionPress = instance.find(
|
|
284
300
|
(el) =>
|
|
285
|
-
el.props.
|
|
301
|
+
el.props.accessibilityLabel ===
|
|
302
|
+
`${AccessibilityLabel.ITEM_QUICK_ACTION_PRESS}-${sensor?.id}` &&
|
|
286
303
|
el.type === TouchableOpacity
|
|
287
304
|
);
|
|
288
305
|
|
|
@@ -290,6 +307,12 @@ describe('Test ItemQuickAction', () => {
|
|
|
290
307
|
act(() => {
|
|
291
308
|
buttonOnActionPress.props.onPress();
|
|
292
309
|
});
|
|
310
|
+
expect(mockSendRemoteControl).toBeCalledWith(
|
|
311
|
+
noAutoUpdateSensor,
|
|
312
|
+
noAutoUpdateSensor.action,
|
|
313
|
+
JSON.stringify({ config_id: 51, config_value: 1 }),
|
|
314
|
+
undefined
|
|
315
|
+
);
|
|
293
316
|
expect(mockSetState).toBeCalledTimes(1);
|
|
294
317
|
|
|
295
318
|
jest.runAllTimers();
|
|
@@ -313,7 +336,8 @@ describe('Test ItemQuickAction', () => {
|
|
|
313
336
|
const instance = tree.root;
|
|
314
337
|
const buttonOnActionPress = instance.find(
|
|
315
338
|
(el) =>
|
|
316
|
-
el.props.
|
|
339
|
+
el.props.accessibilityLabel ===
|
|
340
|
+
`${AccessibilityLabel.ITEM_QUICK_ACTION_PRESS}-${sensor?.id}` &&
|
|
317
341
|
el.type === TouchableOpacity
|
|
318
342
|
);
|
|
319
343
|
|
|
@@ -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,32 +8,40 @@ 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');
|
|
26
31
|
const valueDefault = 28;
|
|
27
|
-
const [value, setValue] = useState(
|
|
32
|
+
const [value, setValue] = useState();
|
|
28
33
|
|
|
29
34
|
useEffect(() => {
|
|
30
35
|
if (!config) {
|
|
36
|
+
setValue(valueDefault);
|
|
31
37
|
return;
|
|
32
38
|
}
|
|
33
39
|
|
|
34
40
|
const configValue = configValues[config];
|
|
35
41
|
if (configValue?.value !== null && configValue?.value !== undefined) {
|
|
36
42
|
setValue(configValue.value);
|
|
43
|
+
} else {
|
|
44
|
+
setValue(valueDefault);
|
|
37
45
|
}
|
|
38
46
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
39
47
|
}, [JSON.stringify(configValues)]);
|
|
@@ -41,16 +49,16 @@ const NumberUpDownActionTemplate = ({ actionGroup, doAction, sensor }) => {
|
|
|
41
49
|
const doActionAndWatchConfig = useCallback(
|
|
42
50
|
async (actionData, actionValue) => {
|
|
43
51
|
let data = actionValue;
|
|
44
|
-
if (
|
|
52
|
+
if (device_type !== DEVICE_TYPE.GOOGLE_HOME) {
|
|
45
53
|
data = { temperature: actionValue };
|
|
46
54
|
if (allow_config_store_value && config) {
|
|
47
55
|
data.config_id = config;
|
|
48
|
-
data.
|
|
56
|
+
data.config_value = actionValue;
|
|
49
57
|
}
|
|
50
58
|
data = JSON.stringify(data);
|
|
51
59
|
}
|
|
52
60
|
await doAction(actionData, data);
|
|
53
|
-
if (!
|
|
61
|
+
if (!is_managed_by_backend) {
|
|
54
62
|
return;
|
|
55
63
|
}
|
|
56
64
|
if (!config) {
|
|
@@ -58,13 +66,13 @@ const NumberUpDownActionTemplate = ({ actionGroup, doAction, sensor }) => {
|
|
|
58
66
|
}
|
|
59
67
|
|
|
60
68
|
config &&
|
|
61
|
-
|
|
69
|
+
device_type === DEVICE_TYPE.LG_THINQ &&
|
|
62
70
|
watchMultiConfigs([config]);
|
|
63
71
|
},
|
|
64
72
|
[
|
|
65
73
|
doAction,
|
|
66
|
-
|
|
67
|
-
|
|
74
|
+
is_managed_by_backend,
|
|
75
|
+
device_type,
|
|
68
76
|
allow_config_store_value,
|
|
69
77
|
config,
|
|
70
78
|
]
|
|
@@ -109,12 +117,12 @@ const NumberUpDownActionTemplate = ({ actionGroup, doAction, sensor }) => {
|
|
|
109
117
|
<TouchableOpacity
|
|
110
118
|
style={styles.downButton}
|
|
111
119
|
onPress={doActionDown}
|
|
112
|
-
|
|
120
|
+
accessibilityLabel={AccessibilityLabel.NUMBER_ACTION_DOWN}
|
|
113
121
|
>
|
|
114
122
|
<IconOutline name="down" size={32} color={Colors.Primary} />
|
|
115
123
|
</TouchableOpacity>
|
|
116
124
|
|
|
117
|
-
<Text
|
|
125
|
+
<Text accessibilityLabel={'abcd'} type="H2">
|
|
118
126
|
{value !== undefined ? (
|
|
119
127
|
text_format.replace('{number}', value)
|
|
120
128
|
) : (
|
|
@@ -125,7 +133,7 @@ const NumberUpDownActionTemplate = ({ actionGroup, doAction, sensor }) => {
|
|
|
125
133
|
<TouchableOpacity
|
|
126
134
|
style={styles.upButton}
|
|
127
135
|
onPress={doActionUp}
|
|
128
|
-
|
|
136
|
+
accessibilityLabel={AccessibilityLabel.NUMBER_ACTION_UP}
|
|
129
137
|
>
|
|
130
138
|
<IconOutline name="up" size={32} color={Colors.Primary} />
|
|
131
139
|
</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
|