-
Notifications
You must be signed in to change notification settings - Fork 59
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
Plugins: Allow view specific config #201
base: Development
Are you sure you want to change the base?
Conversation
Add a method for view specfic configuration keys via json. The goal is to allow additional settings (i.e. 64x64 layouts) without increasing the footprint for others. A new interface called IJsonConfig defines the API to use. Both plugins and views can implement it. The plugins then forward config calls to the views to have view specific settings covered (if needed).
The change doen't fullfill its goal to save flash right now 👎 Default config: feature/view_config: Development: |
|
||
if (false == jsonAnalogClock.isNull()) | ||
{ | ||
jsonMerged["analogClock"] = jsonAnalogClock; |
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.
Did you check the REST API if you change a color value?
|
||
bool DateTimeView64x64::setConfiguration(const JsonObjectConst& jsonCfg) | ||
{ | ||
bool result = true; |
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.
The result will be true even if "analogClock" would be a string instead an object.
if (false == jsonAnalogClock.isNull()) | ||
{ | ||
jsonMerged["analogClock"] = jsonAnalogClock; | ||
result = true; |
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.
Be aware, mergeConfiguration() will receive all JSON parameters as String! A conversion might be necessary here.
Using it consumes more flash than it was supposed to save.
@nhjschulz Please review the Swagger API update for DateTimePlugin: https://app.swaggerhub.com/apis/BlueAndi/Pixelix/1.5.0#/DateTimePlugin/getDateTimeCfg |
Add a method for view specfic configuration
keys via json. The goal is to allow additional
settings (i.e. 64x64 layouts) without increasing
the footprint for others.
A new interface called IJsonConfig defines the API to use. Both plugins and views can implement it. The plugins then forward config calls to the views to have view specific settings covered (if needed).