@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
|
@@ -8,7 +8,7 @@ import styles from './SetupGeneratePasscodeStyles';
|
|
|
8
8
|
|
|
9
9
|
const ButtonWrapper = memo(
|
|
10
10
|
({
|
|
11
|
-
|
|
11
|
+
accessibilityLabel,
|
|
12
12
|
textHeadline,
|
|
13
13
|
textMinutes,
|
|
14
14
|
value,
|
|
@@ -27,7 +27,7 @@ const ButtonWrapper = memo(
|
|
|
27
27
|
const boxNotSelect = { ...styles.boxSetTime, ...styles.boxSetTimeDuration };
|
|
28
28
|
return (
|
|
29
29
|
<View
|
|
30
|
-
|
|
30
|
+
accessibilityLabel={accessibilityLabel}
|
|
31
31
|
style={
|
|
32
32
|
!isButtonDuration
|
|
33
33
|
? styles.buttonWrapper
|
|
@@ -3,7 +3,7 @@ import { act, create } from 'react-test-renderer';
|
|
|
3
3
|
|
|
4
4
|
import SetupGeneratePasscode from '../index';
|
|
5
5
|
import { mockSCStore } from '../../../../../context/mockStore';
|
|
6
|
-
import {
|
|
6
|
+
import { AccessibilityLabel } from '../../../../../configs/Constants';
|
|
7
7
|
import { SCProvider } from '../../../../../context';
|
|
8
8
|
|
|
9
9
|
const mockNavigate = jest.fn();
|
|
@@ -32,13 +32,19 @@ describe('Test SetupGeneratePasscode', () => {
|
|
|
32
32
|
|
|
33
33
|
const getElement = (instance) => {
|
|
34
34
|
const changeName = instance.findAll(
|
|
35
|
-
(item) =>
|
|
35
|
+
(item) =>
|
|
36
|
+
item.props.accessibilityLabel ===
|
|
37
|
+
AccessibilityLabel.GENERATE_PASSCODE_CHOOSE_USER
|
|
36
38
|
);
|
|
37
39
|
const changeTime = instance.findAll(
|
|
38
|
-
(item) =>
|
|
40
|
+
(item) =>
|
|
41
|
+
item.props.accessibilityLabel ===
|
|
42
|
+
AccessibilityLabel.GENERATE_PASSCODE_SET_TIME
|
|
39
43
|
);
|
|
40
44
|
const changeDuration = instance.findAll(
|
|
41
|
-
(item) =>
|
|
45
|
+
(item) =>
|
|
46
|
+
item.props.accessibilityLabel ===
|
|
47
|
+
AccessibilityLabel.GENERATE_PASSCODE_SET_DURATION
|
|
42
48
|
);
|
|
43
49
|
|
|
44
50
|
return {
|
|
@@ -66,8 +72,8 @@ describe('Test SetupGeneratePasscode', () => {
|
|
|
66
72
|
|
|
67
73
|
const wheelDateTimePicker = instance.findAll(
|
|
68
74
|
(item) =>
|
|
69
|
-
item.props.
|
|
70
|
-
`${
|
|
75
|
+
item.props.accessibilityLabel ===
|
|
76
|
+
`${AccessibilityLabel.WHEEL_DATE_TIME_PICKER_BUTTON}${AccessibilityLabel.VIEW_BUTTON_BOTTOM_RIGHT_BUTTON}`
|
|
71
77
|
);
|
|
72
78
|
await wheelDateTimePicker[5].props.onClick();
|
|
73
79
|
await wheelDateTimePicker[11].props.onClick();
|
|
@@ -11,7 +11,7 @@ import TemporaryDetail from '../../../../screens/GuestInfo/components/TemporaryD
|
|
|
11
11
|
import AccessScheduleItem from '../../../../screens/GuestInfo/components/AccessScheduleItem';
|
|
12
12
|
import BottomButtonView from '../../../BottomButtonView';
|
|
13
13
|
import { ACCESS_SCHEDULE } from '../../../../screens/GuestInfo/constant';
|
|
14
|
-
import {
|
|
14
|
+
import { AccessibilityLabel } from '../../../../configs/Constants';
|
|
15
15
|
import ButtonWrapper from './ButtonWrapper';
|
|
16
16
|
import moment from 'moment';
|
|
17
17
|
import styles from './SetupGeneratePasscodeStyles';
|
|
@@ -187,14 +187,16 @@ const SetupGeneratePasscode = memo(() => {
|
|
|
187
187
|
textHeadline={t('choose_user')}
|
|
188
188
|
value={'Name'}
|
|
189
189
|
isButtonChooseUser
|
|
190
|
-
|
|
190
|
+
accessibilityLabel={
|
|
191
|
+
AccessibilityLabel.GENERATE_PASSCODE_CHOOSE_USER
|
|
192
|
+
}
|
|
191
193
|
/>
|
|
192
194
|
<ButtonWrapper
|
|
193
195
|
textHeadline={t('set_time')}
|
|
194
196
|
valueTime={time.format('HH:mm')}
|
|
195
197
|
onPressSetTime={handleSetTime}
|
|
196
198
|
isButtonSetTime
|
|
197
|
-
|
|
199
|
+
accessibilityLabel={AccessibilityLabel.GENERATE_PASSCODE_SET_TIME}
|
|
198
200
|
/>
|
|
199
201
|
<ButtonWrapper
|
|
200
202
|
textHeadline={t('duration')}
|
|
@@ -204,7 +206,9 @@ const SetupGeneratePasscode = memo(() => {
|
|
|
204
206
|
onPressSelectCircle={handleSelectCircle}
|
|
205
207
|
isButtonDuration
|
|
206
208
|
isSelectCircle={isSelectCircle}
|
|
207
|
-
|
|
209
|
+
accessibilityLabel={
|
|
210
|
+
AccessibilityLabel.GENERATE_PASSCODE_SET_DURATION
|
|
211
|
+
}
|
|
208
212
|
/>
|
|
209
213
|
<View>
|
|
210
214
|
<Text style={styles.textHeadLine}>{t('access_schedule')}</Text>
|
|
@@ -5,11 +5,12 @@ import React, { memo } from 'react';
|
|
|
5
5
|
import { TouchableOpacity, View } from 'react-native';
|
|
6
6
|
import { Colors } from '../../../configs';
|
|
7
7
|
import styles from './OnOffButtonTemplateStyle';
|
|
8
|
-
import {
|
|
8
|
+
import { AccessibilityLabel } from '../../../configs/Constants';
|
|
9
9
|
|
|
10
10
|
const OnOffButtonTemplate = memo(
|
|
11
|
-
({ isOn, triggerAction, actionGroup, isLight = false }) => {
|
|
12
|
-
const { configuration, id } = actionGroup;
|
|
11
|
+
({ isOn, triggerAction, actionGroup = {}, isLight = false }) => {
|
|
12
|
+
const { configuration = {}, id } = actionGroup;
|
|
13
|
+
const { icon_on, icon_off, text_on, text_off } = configuration;
|
|
13
14
|
|
|
14
15
|
return (
|
|
15
16
|
<>
|
|
@@ -17,12 +18,11 @@ const OnOffButtonTemplate = memo(
|
|
|
17
18
|
<TouchableOpacity
|
|
18
19
|
style={styles.bigCircle}
|
|
19
20
|
onPress={triggerAction}
|
|
20
|
-
|
|
21
|
-
accessibilityLabel={`${TESTID.ON_OFF_BUTTON}-${id}`}
|
|
21
|
+
accessibilityLabel={`${AccessibilityLabel.ON_OFF_BUTTON}-${id}`}
|
|
22
22
|
>
|
|
23
23
|
<View style={styles.smallCircle}>
|
|
24
24
|
<Icon
|
|
25
|
-
name={isOn ?
|
|
25
|
+
name={isOn ? icon_on : icon_off}
|
|
26
26
|
size={44}
|
|
27
27
|
color={isOn ? Colors.Green7 : Colors.Gray6}
|
|
28
28
|
/>
|
|
@@ -31,16 +31,15 @@ const OnOffButtonTemplate = memo(
|
|
|
31
31
|
styles.textBig,
|
|
32
32
|
{ color: isOn ? Colors.Gray8 : Colors.Gray6 },
|
|
33
33
|
]}
|
|
34
|
-
|
|
35
|
-
accessibilityLabel={`${TESTID.SENSOR_STATUS}-${id}`}
|
|
34
|
+
accessibilityLabel={`${AccessibilityLabel.SENSOR_STATUS}-${id}`}
|
|
36
35
|
>
|
|
37
|
-
{isOn ?
|
|
36
|
+
{isOn ? text_on : text_off}
|
|
38
37
|
</Text>
|
|
39
38
|
</View>
|
|
40
39
|
</TouchableOpacity>
|
|
41
40
|
</View>
|
|
42
41
|
{!!actionGroup.title && !isLight && (
|
|
43
|
-
<Text
|
|
42
|
+
<Text type="H3" semibold center>
|
|
44
43
|
{actionGroup.title}
|
|
45
44
|
</Text>
|
|
46
45
|
)}
|
|
@@ -20,8 +20,8 @@ const getComponent = (template) => {
|
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
-
const OnOffTemplate = memo(({ actionGroup, doAction, sensor }) => {
|
|
24
|
-
const { configuration } = actionGroup;
|
|
23
|
+
const OnOffTemplate = memo(({ actionGroup = {}, doAction, sensor }) => {
|
|
24
|
+
const { configuration = {} } = actionGroup;
|
|
25
25
|
const { action_data, action_on_data, action_off_data } = configuration;
|
|
26
26
|
|
|
27
27
|
// eslint-disable-next-line no-unused-vars
|
|
@@ -6,9 +6,9 @@ import Text from '../Text';
|
|
|
6
6
|
import { Colors } from '../../configs';
|
|
7
7
|
import styles from './OneBigButtonTemplateStyle';
|
|
8
8
|
|
|
9
|
-
const OneBigButtonTemplate = memo(({ actionGroup, doAction, sensor }) => {
|
|
10
|
-
const { configuration } = actionGroup;
|
|
11
|
-
const { text, action_data } = configuration
|
|
9
|
+
const OneBigButtonTemplate = memo(({ actionGroup = {}, doAction, sensor }) => {
|
|
10
|
+
const { configuration = {} } = actionGroup;
|
|
11
|
+
const { text, action_data, icon } = configuration;
|
|
12
12
|
|
|
13
13
|
const onPressDoAction = useCallback(() => {
|
|
14
14
|
doAction(action_data, null);
|
|
@@ -19,13 +19,13 @@ const OneBigButtonTemplate = memo(({ actionGroup, doAction, sensor }) => {
|
|
|
19
19
|
<View style={styles.barrierControlContainer}>
|
|
20
20
|
<TouchableOpacity style={styles.bigCircle} onPress={onPressDoAction}>
|
|
21
21
|
<View style={styles.smallCircle}>
|
|
22
|
-
<Icon name={
|
|
22
|
+
<Icon name={icon} size={44} color={Colors.Green7} />
|
|
23
23
|
<Text style={styles.textBig}>{text}</Text>
|
|
24
24
|
</View>
|
|
25
25
|
</TouchableOpacity>
|
|
26
26
|
</View>
|
|
27
27
|
{!!actionGroup.title && (
|
|
28
|
-
<Text
|
|
28
|
+
<Text type="H3" semibold center>
|
|
29
29
|
{actionGroup.title}
|
|
30
30
|
</Text>
|
|
31
31
|
)}
|
|
@@ -10,7 +10,7 @@ import { useConfigGlobalState } from '../../iot/states';
|
|
|
10
10
|
import { useUnwatchLGDeviceConfigControl } from '../../hooks/IoT';
|
|
11
11
|
import styles from './OptionsDropdownActionTemplateStyle';
|
|
12
12
|
import { watchMultiConfigs } from '../../iot/Monitor';
|
|
13
|
-
import { DEVICE_TYPE,
|
|
13
|
+
import { DEVICE_TYPE, AccessibilityLabel } from '../../configs/Constants';
|
|
14
14
|
import IconComponent from '../../commons/IconComponent';
|
|
15
15
|
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
16
16
|
import SvgDoorState from '../../../assets/images/Device/door-state.svg';
|
|
@@ -24,38 +24,48 @@ function getOptionValue(option) {
|
|
|
24
24
|
return option.value_int;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
const OptionsDropdownActionTemplate = ({
|
|
27
|
+
const OptionsDropdownActionTemplate = ({
|
|
28
|
+
actionGroup = {},
|
|
29
|
+
doAction,
|
|
30
|
+
sensor = {},
|
|
31
|
+
}) => {
|
|
28
32
|
const t = useTranslations();
|
|
29
|
-
const { configuration, title } = actionGroup;
|
|
30
|
-
const {
|
|
31
|
-
|
|
33
|
+
const { configuration = {}, title } = actionGroup;
|
|
34
|
+
const {
|
|
35
|
+
action_data,
|
|
36
|
+
options = [],
|
|
37
|
+
icon_kit_data,
|
|
38
|
+
icon,
|
|
39
|
+
icon_outlined,
|
|
40
|
+
config,
|
|
41
|
+
} = configuration;
|
|
32
42
|
// eslint-disable-next-line no-unused-vars
|
|
33
43
|
const [configValues, setConfigValues] = useConfigGlobalState('configValues');
|
|
34
44
|
const checkIcon = /\d/.test(icon); // to do check icon svg and icon antDesign
|
|
35
45
|
const selectedOption = useMemo(() => {
|
|
36
|
-
const currentValue = configValues[
|
|
46
|
+
const currentValue = configValues[config]?.value;
|
|
37
47
|
if (currentValue === null || currentValue === undefined) {
|
|
38
|
-
return
|
|
48
|
+
return options[0];
|
|
39
49
|
}
|
|
40
50
|
|
|
41
|
-
for (let i = 0; i <
|
|
42
|
-
const option =
|
|
51
|
+
for (let i = 0; i < options.length; i++) {
|
|
52
|
+
const option = options[i];
|
|
43
53
|
const value = getOptionValue(option);
|
|
44
54
|
if (value === currentValue) {
|
|
45
55
|
return option;
|
|
46
56
|
}
|
|
47
57
|
}
|
|
48
|
-
return
|
|
49
|
-
}, [configValues,
|
|
58
|
+
return options[0];
|
|
59
|
+
}, [configValues, config, options]);
|
|
50
60
|
|
|
51
61
|
const { stateAlert, hideAlertAction, onShowAlert } = useDropdownAction();
|
|
52
62
|
const [selectedIndex, setSelectedIndex] = useState(
|
|
53
|
-
|
|
63
|
+
options.indexOf(selectedOption)
|
|
54
64
|
);
|
|
55
65
|
|
|
56
66
|
useEffect(() => {
|
|
57
|
-
setSelectedIndex(
|
|
58
|
-
}, [
|
|
67
|
+
setSelectedIndex(options.indexOf(selectedOption));
|
|
68
|
+
}, [options, selectedOption]);
|
|
59
69
|
|
|
60
70
|
const onDone = useCallback(() => {
|
|
61
71
|
const newOption = options[selectedIndex];
|
|
@@ -68,14 +78,14 @@ const OptionsDropdownActionTemplate = ({ actionGroup, doAction, sensor }) => {
|
|
|
68
78
|
|
|
69
79
|
doAction(action_data, data);
|
|
70
80
|
if (sensor?.is_managed_by_backend) {
|
|
71
|
-
|
|
81
|
+
config &&
|
|
72
82
|
sensor.device_type === DEVICE_TYPE.LG_THINQ &&
|
|
73
|
-
watchMultiConfigs([
|
|
83
|
+
watchMultiConfigs([config]);
|
|
74
84
|
}
|
|
75
85
|
hideAlertAction();
|
|
76
86
|
}, [
|
|
77
87
|
action_data,
|
|
78
|
-
|
|
88
|
+
config,
|
|
79
89
|
doAction,
|
|
80
90
|
hideAlertAction,
|
|
81
91
|
options,
|
|
@@ -89,11 +99,11 @@ const OptionsDropdownActionTemplate = ({ actionGroup, doAction, sensor }) => {
|
|
|
89
99
|
const iconKit = !!icon_kit_data && icon_kit_data.icon;
|
|
90
100
|
|
|
91
101
|
const displaySelected = useMemo(() => {
|
|
92
|
-
if (!
|
|
102
|
+
if (!config) {
|
|
93
103
|
return t('not_available');
|
|
94
104
|
}
|
|
95
105
|
return selectedOption.text;
|
|
96
|
-
}, [
|
|
106
|
+
}, [config, selectedOption?.text, t]);
|
|
97
107
|
|
|
98
108
|
const iconSvg = useMemo(() => {
|
|
99
109
|
switch (icon) {
|
|
@@ -128,7 +138,9 @@ const OptionsDropdownActionTemplate = ({ actionGroup, doAction, sensor }) => {
|
|
|
128
138
|
</View>
|
|
129
139
|
<TouchableOpacity style={styles.iconAndTextOption} onPress={onShowAlert}>
|
|
130
140
|
<Text
|
|
131
|
-
|
|
141
|
+
accessibilityLabel={
|
|
142
|
+
AccessibilityLabel.OPTIONS_DROPDOWN_ACTION_DISPLAY_SELECTED
|
|
143
|
+
}
|
|
132
144
|
color={
|
|
133
145
|
displaySelected === t('not_available') ? Colors.Gray6 : Colors.Gray8
|
|
134
146
|
}
|
|
@@ -157,7 +169,9 @@ const OptionsDropdownActionTemplate = ({ actionGroup, doAction, sensor }) => {
|
|
|
157
169
|
<Text
|
|
158
170
|
color={Colors.Gray6}
|
|
159
171
|
style={styles.writeNotAvailable}
|
|
160
|
-
|
|
172
|
+
accessibilityLabel={
|
|
173
|
+
AccessibilityLabel.OPTIONS_DROPDOWN_ACTION_WRITE_NOT_AVAILABLE
|
|
174
|
+
}
|
|
161
175
|
>
|
|
162
176
|
{t('write_not_available')}
|
|
163
177
|
</Text>
|
|
@@ -166,7 +180,9 @@ const OptionsDropdownActionTemplate = ({ actionGroup, doAction, sensor }) => {
|
|
|
166
180
|
<View key={index} style={styles.rowContainer}>
|
|
167
181
|
<RadioCircle active={selectedIndex === index} />
|
|
168
182
|
<TouchableOpacity
|
|
169
|
-
|
|
183
|
+
accessibilityLabel={
|
|
184
|
+
AccessibilityLabel.OPTIONS_DROPDOWN_ACTION_CHOOSING_ITEM
|
|
185
|
+
}
|
|
170
186
|
style={styles.row}
|
|
171
187
|
onPress={() => {
|
|
172
188
|
setSelectedIndex(index);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { memo, useCallback, useState,
|
|
1
|
+
import React, { memo, useCallback, useState, useEffect } from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import { useTranslations } from '../../hooks/Common/useTranslations';
|
|
4
4
|
import styles from './SliderRangeTemplateStyles';
|
|
@@ -8,35 +8,43 @@ import SvgBrightness from '../../../assets/images/brightness.svg';
|
|
|
8
8
|
import SliderRange from 'react-native-slider';
|
|
9
9
|
import { useConfigGlobalState } from '../../iot/states';
|
|
10
10
|
|
|
11
|
-
const SliderRangeTemplate = memo(({ actionGroup, doAction
|
|
11
|
+
const SliderRangeTemplate = memo(({ actionGroup = {}, doAction }) => {
|
|
12
12
|
const t = useTranslations();
|
|
13
|
-
const { configuration } = actionGroup;
|
|
13
|
+
const { configuration = {} } = actionGroup;
|
|
14
14
|
const [valueBrightness, setValueBrightness] = useState(0);
|
|
15
15
|
const [valueBrightnessTemp, setValueBrightnessTemp] = useState(0);
|
|
16
|
+
const [isFirstTime, setIsFirstTime] = useState(true);
|
|
17
|
+
|
|
16
18
|
const [configValues] = useConfigGlobalState('configValues');
|
|
17
19
|
|
|
18
20
|
const onChangeBrightness = useCallback(
|
|
19
|
-
(value) => {
|
|
20
|
-
doAction(
|
|
21
|
+
async (value) => {
|
|
22
|
+
await doAction(
|
|
21
23
|
configuration?.action_brightness_data,
|
|
22
24
|
JSON.stringify({ value_brness: value })
|
|
23
25
|
);
|
|
26
|
+
await setValueBrightness(value);
|
|
27
|
+
await setValueBrightnessTemp(value);
|
|
24
28
|
},
|
|
25
29
|
[configuration?.action_brightness_data, doAction]
|
|
26
30
|
);
|
|
27
31
|
|
|
28
|
-
const percentBrightness = useMemo(() => {
|
|
29
|
-
return valueBrightnessTemp || valueBrightness || 0;
|
|
30
|
-
}, [valueBrightness, valueBrightnessTemp]);
|
|
31
|
-
|
|
32
32
|
useEffect(() => {
|
|
33
33
|
const { config } = configuration;
|
|
34
34
|
const configValue = configValues[config];
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
if (configValue?.value >= 0 && isFirstTime) {
|
|
36
|
+
setValueBrightness(configValue?.value);
|
|
37
|
+
setIsFirstTime(false);
|
|
38
|
+
} else if (configValue?.value === valueBrightnessTemp) {
|
|
39
|
+
setValueBrightness(valueBrightnessTemp);
|
|
38
40
|
}
|
|
39
|
-
}, [
|
|
41
|
+
}, [
|
|
42
|
+
configuration.config,
|
|
43
|
+
configValues,
|
|
44
|
+
configuration,
|
|
45
|
+
isFirstTime,
|
|
46
|
+
valueBrightnessTemp,
|
|
47
|
+
]);
|
|
40
48
|
|
|
41
49
|
return (
|
|
42
50
|
<View style={styles.viewBrightness}>
|
|
@@ -49,9 +57,9 @@ const SliderRangeTemplate = memo(({ actionGroup, doAction, sensor }) => {
|
|
|
49
57
|
<View style={styles.RightBrightness}>
|
|
50
58
|
<View style={styles.slider}>
|
|
51
59
|
<SliderRange
|
|
52
|
-
value={
|
|
60
|
+
value={valueBrightness}
|
|
53
61
|
onSlidingComplete={onChangeBrightness}
|
|
54
|
-
onValueChange={
|
|
62
|
+
onValueChange={setValueBrightness}
|
|
55
63
|
step={1}
|
|
56
64
|
minimumValue={0}
|
|
57
65
|
maximumValue={100}
|
|
@@ -64,7 +72,7 @@ const SliderRangeTemplate = memo(({ actionGroup, doAction, sensor }) => {
|
|
|
64
72
|
</View>
|
|
65
73
|
<View style={styles.valuePercent}>
|
|
66
74
|
<Text type="Label" style={styles.textValuePercent}>
|
|
67
|
-
{`${
|
|
75
|
+
{`${valueBrightness}%`}
|
|
68
76
|
</Text>
|
|
69
77
|
</View>
|
|
70
78
|
</View>
|
|
@@ -9,7 +9,7 @@ import { IconOutline } from '@ant-design/icons-react-native';
|
|
|
9
9
|
import CircleButton from './component/CircleButton';
|
|
10
10
|
import RectangleButton from './component/RectangleButton';
|
|
11
11
|
import ControlPlay from './component/ControlPlay';
|
|
12
|
-
import {
|
|
12
|
+
import { AccessibilityLabel } from '../../../configs/Constants';
|
|
13
13
|
import { useTranslations } from '../../../hooks/Common/useTranslations';
|
|
14
14
|
|
|
15
15
|
import {
|
|
@@ -109,13 +109,17 @@ const SmartTiviActionTemplate = memo(
|
|
|
109
109
|
/>
|
|
110
110
|
}
|
|
111
111
|
onPress={onPressButton(SMART_TIVI_BUTTON.ONOFF_BUTTON)}
|
|
112
|
-
|
|
112
|
+
accessibilityLabel={
|
|
113
|
+
AccessibilityLabel.SMART_TIVI_TEMPLATE.ONOFF_BUTTON
|
|
114
|
+
}
|
|
113
115
|
/>
|
|
114
116
|
<CircleButton
|
|
115
117
|
type="small"
|
|
116
118
|
icon={<SvgInput size={20} style={styles.iconButtonExit} />}
|
|
117
119
|
onPress={onPressButton(SMART_TIVI_BUTTON.EXIT_BUTTON)}
|
|
118
|
-
|
|
120
|
+
accessibilityLabel={
|
|
121
|
+
AccessibilityLabel.SMART_TIVI_TEMPLATE.EXIT_BUTTON
|
|
122
|
+
}
|
|
119
123
|
/>
|
|
120
124
|
</View>
|
|
121
125
|
<View style={styles.controlDevice}>
|
|
@@ -126,7 +130,9 @@ const SmartTiviActionTemplate = memo(
|
|
|
126
130
|
onPressDown={onPressButton(
|
|
127
131
|
SMART_TIVI_BUTTON.VOLUME_DOWN_BUTTON
|
|
128
132
|
)}
|
|
129
|
-
|
|
133
|
+
accessibilityLabel={
|
|
134
|
+
AccessibilityLabel.SMART_TIVI_TEMPLATE.VOLUME_BUTTON
|
|
135
|
+
}
|
|
130
136
|
/>
|
|
131
137
|
<CircleButton
|
|
132
138
|
type="big"
|
|
@@ -136,7 +142,9 @@ const SmartTiviActionTemplate = memo(
|
|
|
136
142
|
onPressLeft={onPressButton(SMART_TIVI_BUTTON.LEFT_BUTTON)}
|
|
137
143
|
onPressRight={onPressButton(SMART_TIVI_BUTTON.RIGHT_BUTTON)}
|
|
138
144
|
onPressOk={onPressButton(SMART_TIVI_BUTTON.OK_BUTTON)}
|
|
139
|
-
|
|
145
|
+
accessibilityLabel={
|
|
146
|
+
AccessibilityLabel.SMART_TIVI_TEMPLATE.BIG_BUTTON
|
|
147
|
+
}
|
|
140
148
|
/>
|
|
141
149
|
<RectangleButton
|
|
142
150
|
type="column"
|
|
@@ -147,7 +155,9 @@ const SmartTiviActionTemplate = memo(
|
|
|
147
155
|
}
|
|
148
156
|
onPressUp={onPressButton(SMART_TIVI_BUTTON.CH_UP)}
|
|
149
157
|
onPressDown={onPressButton(SMART_TIVI_BUTTON.CH_DOWN)}
|
|
150
|
-
|
|
158
|
+
accessibilityLabel={
|
|
159
|
+
AccessibilityLabel.SMART_TIVI_TEMPLATE.CH_BUTTON
|
|
160
|
+
}
|
|
151
161
|
/>
|
|
152
162
|
</View>
|
|
153
163
|
<View style={styles.controlPlay}>
|
|
@@ -155,7 +165,9 @@ const SmartTiviActionTemplate = memo(
|
|
|
155
165
|
onPressPrev={onPressButton(SMART_TIVI_BUTTON.PREV_BUTTON)}
|
|
156
166
|
onPressStop={onPressButton(SMART_TIVI_BUTTON.STOP_BUTTON)}
|
|
157
167
|
onPressNext={onPressButton(SMART_TIVI_BUTTON.NEXT_BUTTON)}
|
|
158
|
-
|
|
168
|
+
accessibilityLabel={
|
|
169
|
+
AccessibilityLabel.SMART_TIVI_TEMPLATE.CONTROL_BUTTON
|
|
170
|
+
}
|
|
159
171
|
/>
|
|
160
172
|
</View>
|
|
161
173
|
<View style={styles.controlHome}>
|
|
@@ -163,13 +175,17 @@ const SmartTiviActionTemplate = memo(
|
|
|
163
175
|
type="row"
|
|
164
176
|
onPress={onPressButton(SMART_TIVI_BUTTON.HOME_BUTTON)}
|
|
165
177
|
icon={<Home />}
|
|
166
|
-
|
|
178
|
+
accessibilityLabel={
|
|
179
|
+
AccessibilityLabel.SMART_TIVI_TEMPLATE.HOME_BUTTON
|
|
180
|
+
}
|
|
167
181
|
/>
|
|
168
182
|
<RectangleButton
|
|
169
183
|
type="row"
|
|
170
184
|
onPress={onPressButton(SMART_TIVI_BUTTON.BACK_BUTTON)}
|
|
171
185
|
icon={<KeyboardReturn />}
|
|
172
|
-
|
|
186
|
+
accessibilityLabel={
|
|
187
|
+
AccessibilityLabel.SMART_TIVI_TEMPLATE.BACK_BUTTON
|
|
188
|
+
}
|
|
173
189
|
/>
|
|
174
190
|
</View>
|
|
175
191
|
<View style={styles.channelTV}>
|
|
@@ -4,7 +4,7 @@ import ControlPlay from '../component/ControlPlay';
|
|
|
4
4
|
import { SCProvider } from '../../../../context';
|
|
5
5
|
import { mockSCStore } from '../../../../context/mockStore';
|
|
6
6
|
import { TouchableOpacity } from 'react-native';
|
|
7
|
-
import {
|
|
7
|
+
import { AccessibilityLabel } from '../../../../configs/Constants';
|
|
8
8
|
|
|
9
9
|
const wrapComponent = (onPressPrev, onPressStop, onPressNext) => (
|
|
10
10
|
<SCProvider initState={mockSCStore({})}>
|
|
@@ -41,7 +41,8 @@ describe('Test ControlPlay', () => {
|
|
|
41
41
|
|
|
42
42
|
const PrevButton = instance.find(
|
|
43
43
|
(el) =>
|
|
44
|
-
el.props.
|
|
44
|
+
el.props.accessibilityLabel ===
|
|
45
|
+
AccessibilityLabel.SMART_TIVI_TEMPLATE.PREV_BUTTON &&
|
|
45
46
|
el.type === TouchableOpacity
|
|
46
47
|
);
|
|
47
48
|
expect(PrevButton).toBeDefined();
|
|
@@ -57,7 +58,8 @@ describe('Test ControlPlay', () => {
|
|
|
57
58
|
|
|
58
59
|
const PrevButton = instance.find(
|
|
59
60
|
(el) =>
|
|
60
|
-
el.props.
|
|
61
|
+
el.props.accessibilityLabel ===
|
|
62
|
+
AccessibilityLabel.SMART_TIVI_TEMPLATE.PREV_BUTTON &&
|
|
61
63
|
el.type === TouchableOpacity
|
|
62
64
|
);
|
|
63
65
|
expect(PrevButton).toBeDefined();
|
|
@@ -76,7 +78,8 @@ describe('Test ControlPlay', () => {
|
|
|
76
78
|
|
|
77
79
|
const StopButton = instance.find(
|
|
78
80
|
(el) =>
|
|
79
|
-
el.props.
|
|
81
|
+
el.props.accessibilityLabel ===
|
|
82
|
+
AccessibilityLabel.SMART_TIVI_TEMPLATE.STOP_BUTTON &&
|
|
80
83
|
el.type === TouchableOpacity
|
|
81
84
|
);
|
|
82
85
|
expect(StopButton).toBeDefined();
|
|
@@ -92,7 +95,8 @@ describe('Test ControlPlay', () => {
|
|
|
92
95
|
|
|
93
96
|
const StopButton = instance.find(
|
|
94
97
|
(el) =>
|
|
95
|
-
el.props.
|
|
98
|
+
el.props.accessibilityLabel ===
|
|
99
|
+
AccessibilityLabel.SMART_TIVI_TEMPLATE.STOP_BUTTON &&
|
|
96
100
|
el.type === TouchableOpacity
|
|
97
101
|
);
|
|
98
102
|
expect(StopButton).toBeDefined();
|
|
@@ -111,7 +115,8 @@ describe('Test ControlPlay', () => {
|
|
|
111
115
|
|
|
112
116
|
const NextButton = instance.find(
|
|
113
117
|
(el) =>
|
|
114
|
-
el.props.
|
|
118
|
+
el.props.accessibilityLabel ===
|
|
119
|
+
AccessibilityLabel.SMART_TIVI_TEMPLATE.NEXT_BUTTON &&
|
|
115
120
|
el.type === TouchableOpacity
|
|
116
121
|
);
|
|
117
122
|
expect(NextButton).toBeDefined();
|
|
@@ -127,7 +132,8 @@ describe('Test ControlPlay', () => {
|
|
|
127
132
|
|
|
128
133
|
const NextButton = instance.find(
|
|
129
134
|
(el) =>
|
|
130
|
-
el.props.
|
|
135
|
+
el.props.accessibilityLabel ===
|
|
136
|
+
AccessibilityLabel.SMART_TIVI_TEMPLATE.NEXT_BUTTON &&
|
|
131
137
|
el.type === TouchableOpacity
|
|
132
138
|
);
|
|
133
139
|
expect(NextButton).toBeDefined();
|
|
@@ -4,7 +4,7 @@ import RectangleButton from '../component/RectangleButton';
|
|
|
4
4
|
import { SCProvider } from '../../../../context';
|
|
5
5
|
import { mockSCStore } from '../../../../context/mockStore';
|
|
6
6
|
import { TouchableOpacity } from 'react-native';
|
|
7
|
-
import {
|
|
7
|
+
import { AccessibilityLabel } from '../../../../configs/Constants';
|
|
8
8
|
|
|
9
9
|
const wrapComponent = (type, onPress, onPressUp, onPressDown, icon) => (
|
|
10
10
|
<SCProvider initState={mockSCStore({})}>
|
|
@@ -45,7 +45,8 @@ describe('Test RectangleButton', () => {
|
|
|
45
45
|
|
|
46
46
|
const RectangleButtonUp = instance.find(
|
|
47
47
|
(el) =>
|
|
48
|
-
el.props.
|
|
48
|
+
el.props.accessibilityLabel ===
|
|
49
|
+
AccessibilityLabel.SMART_TIVI_TEMPLATE.CH_VOLUME_UP_BUTTON &&
|
|
49
50
|
el.type === TouchableOpacity
|
|
50
51
|
);
|
|
51
52
|
expect(RectangleButtonUp).toBeDefined();
|
|
@@ -62,7 +63,8 @@ describe('Test RectangleButton', () => {
|
|
|
62
63
|
|
|
63
64
|
const RectangleButtonUp = instance.find(
|
|
64
65
|
(el) =>
|
|
65
|
-
el.props.
|
|
66
|
+
el.props.accessibilityLabel ===
|
|
67
|
+
AccessibilityLabel.SMART_TIVI_TEMPLATE.CH_VOLUME_UP_BUTTON &&
|
|
66
68
|
el.type === TouchableOpacity
|
|
67
69
|
);
|
|
68
70
|
expect(RectangleButtonUp).toBeDefined();
|
|
@@ -82,7 +84,8 @@ describe('Test RectangleButton', () => {
|
|
|
82
84
|
|
|
83
85
|
const RectangleButtonDown = instance.find(
|
|
84
86
|
(el) =>
|
|
85
|
-
el.props.
|
|
87
|
+
el.props.accessibilityLabel ===
|
|
88
|
+
AccessibilityLabel.SMART_TIVI_TEMPLATE.CH_VOLUME_DOWN_BUTTON &&
|
|
86
89
|
el.type === TouchableOpacity
|
|
87
90
|
);
|
|
88
91
|
expect(RectangleButtonDown).toBeDefined();
|
|
@@ -99,7 +102,8 @@ describe('Test RectangleButton', () => {
|
|
|
99
102
|
|
|
100
103
|
const RectangleButtonDown = instance.find(
|
|
101
104
|
(el) =>
|
|
102
|
-
el.props.
|
|
105
|
+
el.props.accessibilityLabel ===
|
|
106
|
+
AccessibilityLabel.SMART_TIVI_TEMPLATE.CH_VOLUME_DOWN_BUTTON &&
|
|
103
107
|
el.type === TouchableOpacity
|
|
104
108
|
);
|
|
105
109
|
expect(RectangleButtonDown).toBeDefined();
|