You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When retrieving device model information from the database to populate OCPI data about a charging station, evse, and connector, where appropriate, we should also be querying based on VariableAttributes.type === "Actual", in addition to the rest of the query.
A sample query today that will fail if there are multiple VariableAttributes fulfilling the query, even though the type is different:
select va."value"
from "VariableAttributes" va
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 e."id" = ${evseComponentId} and e."connectorId" = ${connectorId} and c."name" = 'Connector' and v."name" = 'AvailabilityState'
The above query should also include the final condition and v."type" = 'Actual' to prevent a "duplicate" errors.
To Reproduce
Steps to reproduce the behavior:
Run citrineos-ocpi
Have an EVSE with device model that has two entries for connector AvailabilityState, one with type "Actual" and one with type "Target"
Retrieve a location, evse, or connector via OCPI API
Expected behavior
You should be able to retrieve a location, evse, or connector via OCPI, even if there are device model entries with differing types.
Desktop (please complete the following information):
OS: Windows 11
citrineos-core: rc-1.6.0
The text was updated successfully, but these errors were encountered:
Which repository?
citrineos-ocpi
Describe the bug
When retrieving device model information from the database to populate OCPI data about a charging station, evse, and connector, where appropriate, we should also be querying based on
VariableAttributes.type === "Actual"
, in addition to the rest of the query.A sample query today that will fail if there are multiple VariableAttributes fulfilling the query, even though the
type
is different:The above query should also include the final condition
and v."type" = 'Actual'
to prevent a "duplicate" errors.To Reproduce
Steps to reproduce the behavior:
Expected behavior
You should be able to retrieve a location, evse, or connector via OCPI, even if there are device model entries with differing types.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: