@eohjsc/react-native-smart-city 0.4.26 → 0.4.27
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 +2 -1
- package/src/commons/Processing/index.js +8 -8
- package/src/commons/UnitSummary/ConfigHistoryChart/index.js +25 -26
- package/src/iot/Monitor.js +2 -2
- package/src/screens/AddNewGateway/ConnectingModbusDevice.js +4 -4
- package/src/screens/HanetCamera/utils/Monitor.js +4 -4
- package/src/utils/Monitor.js +2 -2
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.4.
|
|
4
|
+
"version": "0.4.27",
|
|
5
5
|
"description": "TODO",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"files": [
|
|
@@ -128,6 +128,7 @@
|
|
|
128
128
|
"apisauce": "^2.1.5",
|
|
129
129
|
"axios": "^0.19.2",
|
|
130
130
|
"base-64": "^1.0.0",
|
|
131
|
+
"buffer": "^6.0.3",
|
|
131
132
|
"deprecated-react-native-prop-types": "^2.3.0",
|
|
132
133
|
"dotenv": "^8.2.0",
|
|
133
134
|
"google-libphonenumber": "^3.2.10",
|
|
@@ -4,7 +4,7 @@ import * as Progress from 'react-native-progress';
|
|
|
4
4
|
|
|
5
5
|
import Text from '../Text';
|
|
6
6
|
import { HeaderCustom } from '../Header';
|
|
7
|
-
import { getPusher } from '../../utils/Pusher';
|
|
7
|
+
// import { getPusher } from '../../utils/Pusher';
|
|
8
8
|
import { ModalCustom } from '../Modal';
|
|
9
9
|
import { Colors, Constants } from '../../configs';
|
|
10
10
|
import styles from './styles';
|
|
@@ -74,13 +74,13 @@ const Processing = ({
|
|
|
74
74
|
}, [setHidePopupTurnOnGuide, setIsRecallChipScan]);
|
|
75
75
|
|
|
76
76
|
useEffect(() => {
|
|
77
|
-
const channel = getPusher().subscribe(channelName);
|
|
78
|
-
channel.bind('progress', (message) => {
|
|
79
|
-
|
|
80
|
-
});
|
|
81
|
-
return () => {
|
|
82
|
-
|
|
83
|
-
};
|
|
77
|
+
// const channel = getPusher().subscribe(channelName);
|
|
78
|
+
// channel.bind('progress', (message) => {
|
|
79
|
+
// processMessage(channel, message);
|
|
80
|
+
// });
|
|
81
|
+
// return () => {
|
|
82
|
+
// getPusher().unsubscribe(channelName);
|
|
83
|
+
// };
|
|
84
84
|
}, [channelName, complete, fail, processMessage]);
|
|
85
85
|
|
|
86
86
|
useEffect(() => {
|
|
@@ -4,7 +4,7 @@ import moment from 'moment';
|
|
|
4
4
|
import { API } from '../../../configs';
|
|
5
5
|
import HistoryChart from '../../../commons/Device/HistoryChart';
|
|
6
6
|
import { axiosGet } from '../../../utils/Apis/axios';
|
|
7
|
-
import { getPusher } from '../../../utils/Pusher';
|
|
7
|
+
// import { getPusher } from '../../../utils/Pusher';
|
|
8
8
|
|
|
9
9
|
const fetchDataS3 = async (url) => {
|
|
10
10
|
const { data } = await axiosGet(url, {
|
|
@@ -87,31 +87,30 @@ export const updateConfigChart = async (
|
|
|
87
87
|
);
|
|
88
88
|
|
|
89
89
|
data.configs.map((config) => {
|
|
90
|
-
if (config.middle.not_ready.length > 0) {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
90
|
+
// if (config.middle.not_ready.length > 0) {
|
|
91
|
+
// const channel = getPusher().subscribe(config.middle.channel);
|
|
92
|
+
// channel.bind('caching-value-log-process', async () => {
|
|
93
|
+
// await Promise.all(
|
|
94
|
+
// config.middle.not_ready.map((item) =>
|
|
95
|
+
// (async () => {
|
|
96
|
+
// item.data = await fetchDataS3(item.url);
|
|
97
|
+
// })()
|
|
98
|
+
// )
|
|
99
|
+
// );
|
|
100
|
+
// const middleDataByDay = [
|
|
101
|
+
// ...config.middle.not_ready,
|
|
102
|
+
// ...config.middle.ready,
|
|
103
|
+
// ];
|
|
104
|
+
// middleDataByDay.sort((a, b) => (a.date > b.date ? 1 : -1)); // small to large
|
|
105
|
+
// const middleData = middleDataByDay.map((x) => x.data).flat();
|
|
106
|
+
// data_by_id[config.id] = [...config.head, ...middleData, ...config.tail];
|
|
107
|
+
// setChartData((chartData) => {
|
|
108
|
+
// const index = chartData.map((c) => c.id).indexOf(config.id);
|
|
109
|
+
// chartData[index].data = data_by_id[config.id];
|
|
110
|
+
// return [...chartData];
|
|
111
|
+
// });
|
|
112
|
+
// });
|
|
113
|
+
// }
|
|
115
114
|
});
|
|
116
115
|
};
|
|
117
116
|
|
package/src/iot/Monitor.js
CHANGED
|
@@ -48,8 +48,8 @@ const watchConfig = (configId) => {
|
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
50
50
|
watchingConfigs[configId] = 1;
|
|
51
|
-
const channel = getPusher().subscribe(`private-config_v2-${configId}`);
|
|
52
|
-
channel.bind('new-value', updateGlobalValue.bind(channel, configId));
|
|
51
|
+
// const channel = getPusher().subscribe(`private-config_v2-${configId}`);
|
|
52
|
+
// channel.bind('new-value', updateGlobalValue.bind(channel, configId));
|
|
53
53
|
};
|
|
54
54
|
|
|
55
55
|
const unwatchConfig = (configId) => {
|
|
@@ -54,10 +54,10 @@ const ConnectingModbusDevice = ({ route }) => {
|
|
|
54
54
|
|
|
55
55
|
useEffect(() => {
|
|
56
56
|
if (channelNameTemp) {
|
|
57
|
-
const channel = getPusher().subscribe(channelNameTemp);
|
|
58
|
-
channel.bind('change_modbus_address_completed', (messageRes) => {
|
|
59
|
-
|
|
60
|
-
});
|
|
57
|
+
// const channel = getPusher().subscribe(channelNameTemp);
|
|
58
|
+
// channel.bind('change_modbus_address_completed', (messageRes) => {
|
|
59
|
+
// setIsChangeAddressSuccess(messageRes.success);
|
|
60
|
+
// });
|
|
61
61
|
}
|
|
62
62
|
}, [channelNameTemp, setIsChangeAddressSuccess]);
|
|
63
63
|
|
|
@@ -40,10 +40,10 @@ const destroyPusher = () => {
|
|
|
40
40
|
|
|
41
41
|
// eslint-disable-next-line promise/prefer-await-to-callbacks
|
|
42
42
|
export const watchHanetCheckinData = (hanetCamera, callback) => {
|
|
43
|
-
const channel = getPusher().subscribe(
|
|
44
|
-
|
|
45
|
-
);
|
|
46
|
-
channel.bind('new-checkin-data', callback);
|
|
43
|
+
// const channel = getPusher().subscribe(
|
|
44
|
+
// `private-hanet-camera-${hanetCamera.device_id}`
|
|
45
|
+
// );
|
|
46
|
+
// channel.bind('new-checkin-data', callback);
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
export const unwatchHanetCheckinData = (hanetCamera) => {
|
package/src/utils/Monitor.js
CHANGED
|
@@ -2,8 +2,8 @@ import { getPusher, destroyPusher } from './Pusher';
|
|
|
2
2
|
|
|
3
3
|
// eslint-disable-next-line promise/prefer-await-to-callbacks
|
|
4
4
|
export const watchNotificationData = (user, callback) => {
|
|
5
|
-
const channel = getPusher().subscribe(`private-user-${user.id}`);
|
|
6
|
-
channel.bind('new-notification', callback);
|
|
5
|
+
// const channel = getPusher().subscribe(`private-user-${user.id}`);
|
|
6
|
+
// channel.bind('new-notification', callback);
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
export const unwatchNotificationData = (user) => {
|