Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should actions be objects? #1

Open
Antman261 opened this issue Dec 14, 2016 · 0 comments
Open

Should actions be objects? #1

Antman261 opened this issue Dec 14, 2016 · 0 comments

Comments

@Antman261
Copy link
Owner

Currently, actions are implemented as either a plain english string or an integer. This has the advantage of meaning that all leaf elements must be an action.

However, an action could be an object specifying type, interaction mode, action code, and descriptions. For example:

{
  "name": "Doors Open",
  "code": "#000003",
  "interaction_mode": "Press and hold",
  "description": "Prevent doors from automatically closing."
}

Action objects could provide the following benefits:

  1. Actions with similar names but different contexts can be uniquely identified by their code.
  2. Interface devices can handle and/or display different interaction modes pre-emptively. This could allow users to make all Press and Hold actions to become toggle if it is better suited to their access needs.
  3. Devices could provide unique descriptions. However these would break localisation.

Action objects could have the following disadvantages:

  1. Less clear where leaf nodes are in the schema.
  2. More to write in a specification.

If actions do become objects, then the following needs to be considered:

  1. While name and code must be coupled, should interaction_mode also be coupled to code?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant