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

[AsomeKit] 데이터 처리 로직 수정 #672

Merged
merged 1 commit into from
Oct 16, 2023
Merged
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
40 changes: 37 additions & 3 deletions app/modules/asomekit.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@
this.msg_id = '';
this.sendToEntry = {
msg_id: "",
distance: 0,
bt_value: 0,
cm: 0,
humidity: 0,
temperature: 0,
light: 0,
vibration: 0,
sound: 0,
udp_msg: "",
};
}
Expand Down Expand Up @@ -110,9 +116,37 @@

console.log("from AsomeBot: ", line);

if (line.indexOf('#DT') >= 0) {
if (line.indexOf('#BT') >= 0) {
var values = line.split(" ");
if (values.length > 1) this.sendToEntry.distance = values[1];
if (values.length > 1) this.sendToEntry.bt_value = values[1];

Check warning on line 121 in app/modules/asomekit.js

View workflow job for this annotation

GitHub Actions / runner / eslint

[eslint] reported by reviewdog 🐶 Expected { after 'if' condition. Raw Output: {"ruleId":"curly","severity":1,"message":"Expected { after 'if' condition.","line":121,"column":17,"nodeType":"IfStatement","messageId":"missingCurlyAfterCondition","fix":{"range":[3369,3407],"text":"{this.sendToEntry.bt_value = values[1];}"}}
}
if (line.indexOf('#CM') >= 0) {
var values = line.split(" ");

Check warning on line 124 in app/modules/asomekit.js

View workflow job for this annotation

GitHub Actions / runner / eslint

[eslint] reported by reviewdog 🐶 Unexpected var, use let or const instead. Raw Output: {"ruleId":"no-var","severity":1,"message":"Unexpected var, use let or const instead.","line":124,"column":17,"nodeType":"VariableDeclaration","endLine":124,"endColumn":46}

Check warning on line 124 in app/modules/asomekit.js

View workflow job for this annotation

GitHub Actions / runner / eslint

[eslint] reported by reviewdog 🐶 Strings must use singlequote. Raw Output: {"ruleId":"quotes","severity":1,"message":"Strings must use singlequote.","line":124,"column":41,"nodeType":"Literal","endLine":124,"endColumn":44,"fix":{"range":[3506,3509],"text":"' '"}}
if (values.length > 1) this.sendToEntry.cm = values[1];

Check warning on line 125 in app/modules/asomekit.js

View workflow job for this annotation

GitHub Actions / runner / eslint

[eslint] reported by reviewdog 🐶 Expected { after 'if' condition. Raw Output: {"ruleId":"curly","severity":1,"message":"Expected { after 'if' condition.","line":125,"column":17,"nodeType":"IfStatement","messageId":"missingCurlyAfterCondition","fix":{"range":[3551,3583],"text":"{this.sendToEntry.cm = values[1];}"}}
}
if (line.indexOf('#HD') >= 0) {
var values = line.split(" ");

Check warning on line 128 in app/modules/asomekit.js

View workflow job for this annotation

GitHub Actions / runner / eslint

[eslint] reported by reviewdog 🐶 Unexpected var, use let or const instead. Raw Output: {"ruleId":"no-var","severity":1,"message":"Unexpected var, use let or const instead.","line":128,"column":17,"nodeType":"VariableDeclaration","endLine":128,"endColumn":46}

Check warning on line 128 in app/modules/asomekit.js

View workflow job for this annotation

GitHub Actions / runner / eslint

[eslint] reported by reviewdog 🐶 Strings must use singlequote. Raw Output: {"ruleId":"quotes","severity":1,"message":"Strings must use singlequote.","line":128,"column":41,"nodeType":"Literal","endLine":128,"endColumn":44,"fix":{"range":[3682,3685],"text":"' '"}}
if (values.length > 1) this.sendToEntry.humidity = values[1];

Check warning on line 129 in app/modules/asomekit.js

View workflow job for this annotation

GitHub Actions / runner / eslint

[eslint] reported by reviewdog 🐶 Expected { after 'if' condition. Raw Output: {"ruleId":"curly","severity":1,"message":"Expected { after 'if' condition.","line":129,"column":17,"nodeType":"IfStatement","messageId":"missingCurlyAfterCondition","fix":{"range":[3727,3765],"text":"{this.sendToEntry.humidity = values[1];}"}}
}
if (line.indexOf('#TP') >= 0) {
var values = line.split(" ");

Check warning on line 132 in app/modules/asomekit.js

View workflow job for this annotation

GitHub Actions / runner / eslint

[eslint] reported by reviewdog 🐶 Unexpected var, use let or const instead. Raw Output: {"ruleId":"no-var","severity":1,"message":"Unexpected var, use let or const instead.","line":132,"column":17,"nodeType":"VariableDeclaration","endLine":132,"endColumn":46}

Check warning on line 132 in app/modules/asomekit.js

View workflow job for this annotation

GitHub Actions / runner / eslint

[eslint] reported by reviewdog 🐶 Strings must use singlequote. Raw Output: {"ruleId":"quotes","severity":1,"message":"Strings must use singlequote.","line":132,"column":41,"nodeType":"Literal","endLine":132,"endColumn":44,"fix":{"range":[3864,3867],"text":"' '"}}
if (values.length > 1) this.sendToEntry.temperature = values[1];

Check warning on line 133 in app/modules/asomekit.js

View workflow job for this annotation

GitHub Actions / runner / eslint

[eslint] reported by reviewdog 🐶 Expected { after 'if' condition. Raw Output: {"ruleId":"curly","severity":1,"message":"Expected { after 'if' condition.","line":133,"column":17,"nodeType":"IfStatement","messageId":"missingCurlyAfterCondition","fix":{"range":[3909,3950],"text":"{this.sendToEntry.temperature = values[1];}"}}
}
if (line.indexOf('#BN') >= 0) {
var values = line.split(" ");
if (values.length > 1) this.sendToEntry.light = values[1];
}
if (line.indexOf('#VT') >= 0) {
var values = line.split(" ");
if (values.length > 1) {
if (values[1] == 'False') {
this.sendToEntry.vibration = 0;
} else {this.sendToEntry.vibration = 1;}
}
}
if (line.indexOf('#SO') >= 0) {
var values = line.split(" ");
if (values.length > 1) this.sendToEntry.sound = values[1];
}
if (line.indexOf('#UDP') >= 0) {
var values = line.split(" ");
Expand Down
Loading