Clean the skills.json before sending it up.
Only include the 'version', 'blacklist' and 'skills' field.
remove duplicate entries (with the same name)  in 'skills' section
@@ -364,10 +364,17 @@ class DeviceApi(Api):
Arguments:
data: dictionary with skills data from msm
"""
+ # Strip the skills.json down to the bare essentials
+ to_send = {}
+ to_send['blacklist'] = data['blacklist']
+ # Make sure skills doesn't contain duplicates (keep only last)
+ skills = {s['name']: s for s in data['skills']}
+ to_send['skills'] = [skills[key] for key in skills]
+
self.request({
"method": "PUT",
"path": "/" + self.identity.uuid + "/skillJson",
- "json": data
+ "json": to_send
})
