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

Update device model queries to include relevant Variable Attribute type #164

Open
wants to merge 1 commit into
base: rc-1.0.1
Choose a base branch
from

Conversation

yuvenus
Copy link
Contributor

@yuvenus yuvenus commented Jan 16, 2025

Resolves issue citrineos/citrineos#98 - this PR adds an additional condition to the SQL queries that retrieve relevant device model information to also include the relevant Variable Attribute type.

…hould also search only for variable attributes with a specific type (usually "Actual", but can be the other types as well)
left join "Variables" v on va."variableId" = v."id"
left join "Components" c on va."componentId" = c."id"
left join "Evses" e on c."evseDatabaseId" = e."databaseId"
where va."stationId" = '${stationId}' and
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question: why does this query as well as query for evse_ids_string don't need to add va."type" = 'Actual' and?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since it's the unique set of the evse ids, we don't necessarily have to target the type since if we pull let's say variable attributes of type Actual and Target with the same evse, they'll collapse into one evse in the set 👍

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

Successfully merging this pull request may close these issues.

(OCPI) Retrieving device model should also query based on type "Actual"
2 participants