-
Notifications
You must be signed in to change notification settings - Fork 48
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
Bug/729 add remove variables and components from schema for device model #740
Bug/729 add remove variables and components from schema for device model #740
Conversation
…only evse and connector. Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
…ymore but only schema's, in which the config values are set. Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
…that are required have a (default) value set. Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
…rity checks. Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
… type in for loops. Fix schema's for unit tests. Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
…from-schema-for-device-model
Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
…from-schema-for-device-model
Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks nice. Just added a couple of suggestions. Make sure to update the dependency in EVerest/everest-core#822 once this is merged
/// or | ||
/// changed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// or | |
/// changed. | |
/// or changed. |
lib/ocpp/v201/ocpp_types.cpp
Outdated
@@ -1866,9 +1866,28 @@ void from_json(const json& j, VariableAttribute& k) { | |||
if (j.contains("type")) { | |||
k.type.emplace(conversions::string_to_attribute_enum(j.at("type"))); | |||
} | |||
|
|||
// TODO mz change this in the generator (if everyone agrees)!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean in the generate_component_config.py
right? Not sure if this still works and if we still need it. It was based on a modified version of the dm_component_vars.csv
that we haven't made public due to uncertainty about the license
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So you don't generate it anymore?
(I just want to be sure it is not removed when the file is regenerated)
software, it will: | ||
- Check if there are Components in the database that are not in the component config's. Those will be removed. | ||
- Check if there are Components in the component config's that are not in the database. Those will be added. | ||
- Check if anything has changed inside the Component (`Variable`, `Characteristics` or `Attributes`). | ||
Those will be removed, changed or added. Those will be removed, changed or added to the database as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those will be removed, changed or added. Those will be removed, changed or added to the database as well. | |
Those will be removed, changed or added to the database as well. |
if (attribute.value.has_value() || | ||
(attribute.type.has_value() && (attribute.type.value() == AttributeEnum::Actual) && | ||
default_actual_value.has_value())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could put this into a separate function so this reads a little better. You could also reusue it within L604
Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
…from-schema-for-device-model
Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
4a5626a
to
fa11168
Compare
@maaikez, I encountered some difficulty adapting my configuration when changes from this pull request appeared in my copy of EVerest. Although it is working again, I am unsure if my approach is correct and would appreciate your confirmation. Scenario: I want to change a value defined in the standardized schemas or define a value for a variable that has no default value in the standardized schemas. To do this, I create a new schema in the sub-directory Example: To set {
"$schema": "http://json-schema.org/draft-07/schema#",
"name": "ISO15118Ctrlr",
"properties": {
"ContractCertificateInstallationEnabled": {
"variable_name": "ContractCertificateInstallationEnabled",
"characteristics": {
"supportsMonitoring": true,
"dataType": "boolean"
},
"attributes": [
{
"type": "Actual",
"mutability": "ReadWrite",
"value": true
}
],
"description": "If this variable is true, then ISO 15118 contract certificate installation/update as described by use case M01 - Certificate installation EV and M02 - Certificate Update EV is enabled. If this variable is false, then ISO 15118 contract certificate installation/update as described by use case M01 - Certificate installation EV and M02 - Certificate Update EV is disabled.",
"type": "boolean"
}
}
} Question: Is this the correct approach to adapt configurations in libocpp, or is there a more efficient method to avoid repeating large portions of code? |
@acnixvkh Ah never thought of this way. No you should just change the ISO15118Ctrlr.json and set the correct value there. Although this might just work, but I am not sure. The default values are confusing, I will remove them in the future. |
- `config-docker.json`: is no longer needed since we don't support 1.6j (EVerest#80) - `config.json` is no longer needed, since it is removed and replaced by the `component_config` directory (EVerest/libocpp#740) - `device_model_storage_maeve_sp1.db` is now created by the manager at startup based on the `component_config` directory This should now work for the basic (non-ISO/non-OCPP use cases) Signed-off-by: Shankari <[email protected]>
- `config-docker.json`: is no longer needed since we don't support 1.6j (EVerest#80) - `config.json` is no longer needed, since it is removed and replaced by the `component_config` directory (EVerest/libocpp#740) - `device_model_storage_maeve_sp1.db` is now created by the manager at startup based on the `component_config` directory This should now work for the basic (non-ISO/non-OCPP use cases) Signed-off-by: Shankari <[email protected]>
- `config-docker.json`: is no longer needed since we don't support 1.6j (EVerest#80) - `config.json` is no longer needed, since it is removed and replaced by the `component_config` directory (EVerest/libocpp#740) - `device_model_storage_maeve_sp1.db` is now created by the manager at startup based on the `component_config` directory This should now work for the basic (non-ISO/non-OCPP use cases) Signed-off-by: Shankari <[email protected]>
Describe your changes
With this pull request, it is possible to remove and add variables (and their attributes and characteristics) and components for all other components than only EVSE and Connector.
It also removed the use of config.json, so everything is now added to the component schema's, which are renamed to component config. The values from the 'default config' are now added to the new 'component config' json files.
There is one TODO left in the ocpp_types file. If the changes are ok there, I can also change the generator to do exactly that. Otherwise I have to solve it another way.
I also made a pull request in everest core (EVerest/everest-core#822) and are still busy with some changes in everest utils (https://github.com/EVerest/everest-utils/tree/feature/715-combine-component-schemas-and-config-in-one-file).
Issue ticket number and link
#729
#715
Checklist before requesting a review