@eohjsc/react-native-smart-city 0.3.18 → 0.3.21
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 +1 -1
- package/src/commons/ActionGroup/OnOffTemplate/index.js +9 -4
- package/src/screens/AddCommon/SelectSubUnit.js +1 -1
- package/src/screens/AddNewDevice/hooks/ConnectDevices.js +1 -1
- package/src/screens/AddNewDevice/index.js +1 -1
- package/src/screens/AddNewGateway/hooks/index.js +1 -1
- package/src/screens/SubUnit/hooks/useManageSubUnit.js +1 -1
- package/src/screens/SyncLGDevice/AddLGDevice.js +1 -1
- package/src/screens/UnitSummary/index.js +1 -1
package/package.json
CHANGED
|
@@ -55,7 +55,6 @@ const OnOffTemplate = memo(({ actionGroup, doAction, sensor }) => {
|
|
|
55
55
|
);
|
|
56
56
|
|
|
57
57
|
const triggerAction = useCallback(async () => {
|
|
58
|
-
setTempIsOn((prev) => !prev);
|
|
59
58
|
switch (sensor?.device_type) {
|
|
60
59
|
case DEVICE_TYPE.ZIGBEE:
|
|
61
60
|
if (action_on_data && action_off_data) {
|
|
@@ -75,11 +74,10 @@ const OnOffTemplate = memo(({ actionGroup, doAction, sensor }) => {
|
|
|
75
74
|
}
|
|
76
75
|
break;
|
|
77
76
|
case DEVICE_TYPE.LG_THINQ:
|
|
77
|
+
setTempIsOn((prev) => !prev);
|
|
78
78
|
if (action_data) {
|
|
79
79
|
await doAction(action_data, JSON.stringify({ value: !isOn }));
|
|
80
80
|
}
|
|
81
|
-
|
|
82
|
-
updateStatusFromPusher();
|
|
83
81
|
break;
|
|
84
82
|
default:
|
|
85
83
|
if (action_data) {
|
|
@@ -98,6 +96,7 @@ const OnOffTemplate = memo(({ actionGroup, doAction, sensor }) => {
|
|
|
98
96
|
}
|
|
99
97
|
break;
|
|
100
98
|
}
|
|
99
|
+
updateStatusFromPusher();
|
|
101
100
|
if (sensor?.is_managed_by_backend) {
|
|
102
101
|
configuration?.config &&
|
|
103
102
|
sensor?.device_type !== 'GOOGLE_HOME' &&
|
|
@@ -130,7 +129,13 @@ const OnOffTemplate = memo(({ actionGroup, doAction, sensor }) => {
|
|
|
130
129
|
if (sensor?.is_managed_by_backend && sensor.device_type !== 'GOOGLE_HOME') {
|
|
131
130
|
watchMultiConfigs([configuration.config]);
|
|
132
131
|
}
|
|
133
|
-
}, [sensor, configuration.config]);
|
|
132
|
+
}, [sensor, configuration.config, getIsOnValue]);
|
|
133
|
+
|
|
134
|
+
useEffect(() => {
|
|
135
|
+
if (sensor?.device_type !== DEVICE_TYPE.LG_THINQ) {
|
|
136
|
+
setTempIsOn(getIsOnValue());
|
|
137
|
+
}
|
|
138
|
+
}, [getIsOnValue, sensor?.device_type]);
|
|
134
139
|
|
|
135
140
|
const Component = useMemo(() => {
|
|
136
141
|
return getComponent(actionGroup.template);
|
|
@@ -64,7 +64,7 @@ const AddCommonSelectSubUnit = ({ route }) => {
|
|
|
64
64
|
const fetchDetails = useCallback(async () => {
|
|
65
65
|
const { success, data } = await axiosGet(
|
|
66
66
|
API.UNIT.UNIT_DETAIL(unit_id),
|
|
67
|
-
{
|
|
67
|
+
{},
|
|
68
68
|
true
|
|
69
69
|
);
|
|
70
70
|
if (success) {
|
|
@@ -13,7 +13,7 @@ const useConnectDevices = (new_sensor, station_id, unit_id) => {
|
|
|
13
13
|
const fetchDetails = useCallback(async () => {
|
|
14
14
|
const { success: fetchSuccess, data: unit } = await axiosGet(
|
|
15
15
|
API.UNIT.UNIT_DETAIL(unit_id),
|
|
16
|
-
{
|
|
16
|
+
{},
|
|
17
17
|
true
|
|
18
18
|
);
|
|
19
19
|
const station = unit.stations.find((item) => item.id === station_id);
|
|
@@ -9,7 +9,7 @@ const useConnectGateway = (unit_id) => {
|
|
|
9
9
|
const fetchDetails = useCallback(async () => {
|
|
10
10
|
const { success: fetchSuccess, data: unit } = await axiosGet(
|
|
11
11
|
API.UNIT.UNIT_DETAIL(unit_id),
|
|
12
|
-
{
|
|
12
|
+
{},
|
|
13
13
|
true
|
|
14
14
|
);
|
|
15
15
|
return { fetchSuccess, unit };
|
|
@@ -93,7 +93,7 @@ const UnitSummary = memo(({ route }) => {
|
|
|
93
93
|
const fetchUnitDetail = useCallback(async () => {
|
|
94
94
|
const { success, data } = await axiosGet(
|
|
95
95
|
API.UNIT.UNIT_DETAIL(unit?.id),
|
|
96
|
-
{
|
|
96
|
+
{},
|
|
97
97
|
true
|
|
98
98
|
);
|
|
99
99
|
if (success) {
|