Skip to content

Proposal: use TD default values #537

@derwehr

Description

@derwehr

hello,
I'd like to propose the scripting API to define variables the consumer leaves undefined with the default values from the TD (or const values?).

A simple use-case would be a Thing, expecting a fixed payload parameter based on the Interaction Affordance, like in the TD below.

Now with the scripting API using the default values a user won't have to worry about knowing the correct commandId.

{
  "actions": {
    "move": {
      "type": "object",
      "properties": {
        "commandId": {
          "type": "integer",
          "default": 5
        },
        // other dynamic properties like coordinates
      }
    },
    "dimLight": {
      "type": "object",
      "properties": {
        "commandId": {
          "type": "integer",
          "default": 6
        }
        // other dynamic properties like time span
      }
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    use caseDescribes a scenario that may be useful for technical decisions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions