vorto icon indicating copy to clipboard operation
vorto copied to clipboard

Ditto Thing JSON Generator on Functionblocks

Open kolotu opened this issue 4 years ago • 1 comments

When invoking the "Ditto Thing JSON" generator on a Function Block https://vorto.eclipse.org#/details/org.eclipse.ditto.examples:SwitchableLamp:1.0.0

The following Thing is generated:

{
  "definition": "org.eclipse.ditto.examples:SwitchableLampIM:1.0.0",
  "attributes": {
    "modelDisplayName": "SwitchableLamp"
  },
  "features": {
"switchablelamp" : {
  "definition": [
    "org.eclipse.ditto.examples:SwitchableLamp:1.0.0",
    "org.eclipse.ditto.examples:Switchable:1.0.0"
  ],
  "properties": {
    "status": {
      "currentPowerConsumption" : 0.0
    },
        "configuration": {
          "bulbChangeDate" : "2019-04-01T18:25:43-00:00",
          "reportCurrentPowerConsumption" : false,
          "currentPowerConsumptionInterval" : 0,
          "on" : false
}
  }
}
  }
}

Only the feature's content should generated, without the feature ID (because where should this come from?). There even is a definition added which does not exist in Vorto at all:

"definition": "org.eclipse.ditto.examples:SwitchableLampIM:1.0.0"

@thjaeckle as you suggested

kolotu avatar Sep 23 '20 07:09 kolotu

Cool, thx @kolotu 👍

thjaeckle avatar Sep 23 '20 07:09 thjaeckle