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

JEXL. Add: Calculated attributes #4580

Open
mapedraza opened this issue Jun 10, 2024 · 3 comments
Open

JEXL. Add: Calculated attributes #4580

mapedraza opened this issue Jun 10, 2024 · 3 comments
Labels

Comments

@mapedraza
Copy link
Collaborator

Is your feature request related to a problem / use case? Please describe.
Have calculated attributes using JEXL, having as value the expression evaluation result.

Describe the solution you'd like

When an attribute type is Calculated the value returned when queriying (and also, when notifiying) should be the expression result.

Provision

{
  "id": "Room2",
  "type": "Room",
  "temperature": {
    "value": 21,
    "type": "Float"
  },
  "kelvin": {
    "value": "${temperature+273}",
    "type": "Calculated"
  }
}

Describe alternatives you've considered
#4579

Describe why you need this feature

  • To approach a new use case.
  • To improve or simplify an scenario.

Additional information

  • What happens when using that attribute within a notification condition?
  • Probably, a new URL param should be included to request entities without rendering calculated values (to check if the expression works or not). Another alternative is to change the type.
@fgalan fgalan changed the title Add: Calculated attributes JEXL. Add: Calculated attributes Jun 10, 2024
@fgalan
Copy link
Member

fgalan commented Jun 10, 2024

Probably, a new URL param should be included to request entities without rendering calculated values (to check if the expression works or not). Another alternative is to change the type.

E.g.

GET /v2/entities?options=plain

@mapedraza
Copy link
Collaborator Author

mapedraza commented Jun 10, 2024

Probably related #3815

@mapedraza
Copy link
Collaborator Author

Noted by @mrutid : Those attributes need to be manually provisioned one by one in each entity (since data provider is not going to create those attributes). No existing clases or patterns that apply to all the entities, like the case of subscriptions, that is a group provision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants