Skip to content

Feature/station connection status#64

Merged
thanaParis merged 17 commits intorc-1.1.0from
feature/station-connection-status
Apr 5, 2024
Merged

Feature/station connection status#64
thanaParis merged 17 commits intorc-1.1.0from
feature/station-connection-status

Conversation

@thanaParis
Copy link
Copy Markdown
Collaborator

@thanaParis thanaParis commented Mar 27, 2024

Work In Progress, opening to review early

Changes:

  1. DirectusExtensions/charging-stations-bundle added
    a) Custom display "Present or True Count" added, which displays total number of rows with a value that is present, if non-boolean column, or true, if boolean column
    b) Custom endpoint "POST /charging-stations/update-station-status" which updates isOnline in response to events POSTed from CitrineOS's OcppRouter Subscription API
    c) Custom hook "On Create Charging Station" which subscribes new stations to connect and close events via CitrineOS's OcppRouter Subscription API

Misc:

Missing @column annotation added in ChargingStations data model
Unused images in Server/data/directus/uploads removed
A config.js file was added to Directus via CONFIG_PATH env var to provide necessary context for custom extensions, such as the OcppRouter's url, subscription api path, Directus's url, and the custom update-station-status api path

Copy link
Copy Markdown
Collaborator

@ChrisWeissmann ChrisWeissmann left a comment

Choose a reason for hiding this comment

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

I want to be sure I understand how this works:
The directus extensions offers an API that can get hit when a charger opens a web socket connection.
To get this update, on commissioning/adding the charger to the location we make a http request to citrine on the endpoint provided by @AsDataEndpoint(Namespace.Subscription, HttpMethod.Put)
This keeps track of the subscriptions in an array with the associated callback actions to take.
What I don't quite grasp is if we are going to run into a problem scaling horizontally, as the callbacks seem to be held in an array in memory.

Is this correct?

@thanaParis
Copy link
Copy Markdown
Collaborator Author

thanaParis commented Mar 28, 2024

What I don't quite grasp is if we are going to run into a problem scaling horizontally, as the callbacks seem to be held in an array in memory.

You do understand how it works, and this is a good point. I'll need to make the subscription api persistent.

@thanaParis
Copy link
Copy Markdown
Collaborator Author

@ChrisWeissmann PR opened to make subscriptions persistent: #66

…nment.

Signed-off-by: thanaParis <thana.paris@s44.team>
@thanaParis thanaParis changed the title [WIP] Feature/station connection status Feature/station connection status Apr 1, 2024
@thanaParis thanaParis marked this pull request as ready for review April 1, 2024 14:04
Signed-off-by: thanaParis <thana.paris@s44.team>
@thanaParis thanaParis mentioned this pull request Apr 3, 2024
Signed-off-by: thanaParis <thana.paris@s44.team>
…h check for directus to docker compose, changed directus config from js to commonjs

Signed-off-by: thanaParis <thana.paris@s44.team>
Copy link
Copy Markdown
Contributor

@lydiazcheng lydiazcheng left a comment

Choose a reason for hiding this comment

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

The change looks good!

thanaParis and others added 3 commits April 5, 2024 14:15
…ount/display.vue

Co-authored-by: lydiazcheng <lydiazcheng@users.noreply.github.com>
Signed-off-by: thanaParis <83840862+thanaParis@users.noreply.github.com>
Signed-off-by: thanaParis <thana.paris@s44.team>
@thanaParis thanaParis merged commit ee83718 into rc-1.1.0 Apr 5, 2024
@ChrisWeissmann ChrisWeissmann deleted the feature/station-connection-status branch June 5, 2024 13:21
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.

4 participants