Skip to content
Snippets Groups Projects
Commit a8e5c86f authored by GromeTT's avatar GromeTT
Browse files

FIX: Added missing code snippet

parent 316b2fbf
No related branches found
No related tags found
3 merge requests!8Feature documentation,!6Feature documentation alb,!5Feature documentation alb
......@@ -650,6 +650,14 @@ def on_service_request(self, body_json):
"Functionality %s is not one of the built-in functionalities in %s!"
% (service_functionality, self.name)
)
service_reply.fillServiceReply(
senderUUID=self.thing_id,
receiverUUID=body_json.get("sender", None),
serviceType=body_json.get("serviceType", None),
results={"error": "invalid functionalities (serviceType) {}".format(service_functionality)},
replyingToUUID=body_json.get("identifier", None),
msgUUID="s3i:{}".format(uuid.uuid4())
)
else:
# TODO: Call right functionality.
try:
......@@ -789,21 +797,24 @@ def to_dir_json(self):
if self.features.get("ml40::Location") is not None:
self.dir_json["attributes"]["location"] = {
"longitude": self.features.get("ml40::Location").to_json()["longitude"],
"latitude": self.features.get("ml40::Location").to_json()["latitude"],
"latitude": self.features.get("ml40::Location").to_json()["latitude"]
}
self.dir_json["attributes"]["dataModel"] = "fml40"
self.dir_json["attributes"]["thingStructure"] = {
"class": "ml40::Thing",
"links": [],
"links": []
}
for key in self.roles.keys():
role_entry = {"association": "roles", "target": self.roles[key].to_json()}
role_entry = {
"association": "roles",
"target": self.roles[key].to_json()
}
self.dir_json["attributes"]["thingStructure"]["links"].append(role_entry)
for key in self.features.keys():
feature_target = {
"class": self.features[key].to_json()["class"],
"identifier": self.features[key].to_json()["identifier"],
"identifier": self.features[key].to_json()["identifier"]
}
feature_entry = {"association": "features", "target": feature_target}
# if the feature has targets, like ml40::Composite
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment