Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop hw #766

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion app/modules/choco.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,11 +307,20 @@ class Choco extends BaseModule {
* @param {*} handler
*/
requestRemoteData(handler) {
//sensor데이터는 상태가 바뀔때 전송한다.
if (
_.isEmpty(this.previousSensorData) ||
!_.isEqual(this.previousSensorData, this.sensorData)
) {
handler.write('sensorData', this.sensorData);
this.previousSensorData = _.cloneDeep(this.sensorData);
}

if (this.executeCmd.processing === 'done') {
this.log('requestRemoteData done', this.executeCmd.id);

handler.write('msg_id', this.executeCmd.id);
handler.write('sensorData', this.sensorData);
//handler.write('sensorData', this.sensorData);

this.executeCmd.id = '';
this.executeCmd.processing = 'none';
Expand Down
13 changes: 11 additions & 2 deletions app/modules/choco2.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,17 +307,26 @@ class Choco extends BaseModule {
* @param {*} handler
*/
requestRemoteData(handler) {
//sensor데이터는 상태가 바뀔때 전송한다.
if (
_.isEmpty(this.previousSensorData) ||
!_.isEqual(this.previousSensorData, this.sensorData)
) {
handler.write('sensorData', this.sensorData);
this.previousSensorData = _.cloneDeep(this.sensorData);
}

if (this.executeCmd.processing === 'done') {
this.log('requestRemoteData done', this.executeCmd.id);

handler.write('msg_id', this.executeCmd.id);
handler.write('sensorData', this.sensorData);
//handler.write('sensorData', this.sensorData);

this.executeCmd.id = '';
this.executeCmd.processing = 'none';
}
};

/**
* 엔트리에서 받은 데이터에 대한 처리
* @param {*} handler
Expand Down
Loading