Skip to content
This repository was archived by the owner on May 3, 2019. It is now read-only.

Commit 8666bf5

Browse files
Merge pull request #107 from matrix-io/lm/demographicFix
Fixing demographics data
2 parents 5528958 + 2b3eb6d commit 8666bf5

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

lib/device/drivers/detection.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,24 @@ module.exports = {
5050
// translate from { tag: 'EMOTION', emotion: 'HAPPY' to { emotion: 'happy' }
5151
debug('v:', v);
5252

53-
if (_.has(v, tag)) {
53+
if (_.has(v, "tag")) {
5454
// simple values
55-
var tag = v.tag.toLowerCase();
55+
var tag = v.tag.toLowerCase();
5656
r[tag] = v[tag];
57-
} else {
57+
5858
// complex values
5959
if (tag === 'head_pose') {
6060
r.pose = {};
6161
r.pose.yaw = v.poseYaw;
6262
r.pose.roll = v.poseRoll;
6363
r.pose.pitch = v.posePitch;
64+
} else if (tag === 'gender' && _.has(v, 'gender')) {
65+
r.gender = v.gender;
66+
} else if (tag === 'emotion' && _.has(v, 'emotion')) {
67+
r.emotion = v.emotion;
6468
}
69+
} else if (_.has(v, 'age')) { // age is being received with only the age property, not the tag
70+
r.age = v.age;
6571
}
6672
return r;
6773
}, {});

0 commit comments

Comments
 (0)