Skip to content

Feature/device model improvements#40

Merged
joll90 merged 5 commits intorc-1.1.0from
feature/device-model-improvements
Feb 8, 2024
Merged

Feature/device model improvements#40
joll90 merged 5 commits intorc-1.1.0from
feature/device-model-improvements

Conversation

@thanaParis
Copy link
Copy Markdown
Collaborator

Improving device model to use more concise sequelize and better represent the specification:

  • Model.findOrCreate and Model.upsert used instead of separate operations
  • Removed Evse from unique index for component and variable attributes to reflect specification
    • OCPP 2.0.1 Part 1 - Architecture & Topology, section 4.1: "Each distinct component instance is uniquely identified by an (optional) componentInstance addressing key. When no componentInstance is provided, then the default or only instance of a component is referenced."
  • Made relation between Components and Variables many-to-many to reflect specification
    • OCPP 2.0.1 Part 1 - Architecture & Topology, section 4.2: "Although many components can have associated variables that are, by their nature, specific to the component type (e.g. ConnectorType for a Connector component), there are a minimal set of standardized variables that are used to provide standardized high level event notification and state/status reporting (e.g. Problem, Active) on a global and/or selective basis, and also to report component presence, availability, etc. during the inventorying/discovery process (e.g. Available, Enabled)."
  • Added default Variable & VariableAttribute assignment to component creation
    • OCPP 2.0.1 Part 1 - Architecture & Topology, section 4.2: " A Charging Station is not required to report the base variables: Present, Available and Enabled when they are readonly and set to true. When a Charging Station does not report: Present, Available and/or Enabled the Central System SHALL assume them to be readonly and set to true."
  • Bugfixes:
    • tbc check in NotifyReportEvent handling moved to after db update, to prevent Pending boot status from being cleared if device model does not load correctly
    • VariableStatus.value string max length set to 4000 to match VariableAttribute.value
    • docker-compose.yml adjusted so that Directus waits for postgres to be healthy before starting, preventing Directus from crashing repeatedly on startup

…sent the specification

Signed-off-by: thanaParis <thana.paris@s44.team>
…ectus never crashes on startup

Signed-off-by: thanaParis <thana.paris@s44.team>
…eport flow works intuitively out of the box

Signed-off-by: thanaParis <thana.paris@s44.team>
…ing component findOrCreate to avoid warning for unknown attribute

Signed-off-by: thanaParis <thana.paris@s44.team>
…e; moving tbc check to after database update so that PENDING status is not removed if device model is unable to load

Signed-off-by: thanaParis <thana.paris@s44.team>
@thanaParis thanaParis self-assigned this Feb 7, 2024
@joll90 joll90 merged commit db66897 into rc-1.1.0 Feb 8, 2024
@ChrisWeissmann ChrisWeissmann deleted the feature/device-model-improvements branch June 5, 2024 13:19
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.

2 participants