commit | 03c4c8e263d1c756299e1f63398412b247c19760 | [log] [tgz] |
---|---|---|
author | Patrick Williams <patrick@stwcx.xyz> | Thu Apr 14 22:19:44 2022 -0500 |
committer | Patrick Williams <patrick@stwcx.xyz> | Thu Apr 14 22:19:45 2022 -0500 |
tree | 5dadb91f36723212633f3fe744fc969eb9557064 | |
parent | b729eac553278609494e30a37c63fec4ef62b7af [diff] |
expression: allow array of strings There are cases where the expressions can be very long and the resulting string is fairly ugly. JSON doesn't allow multi-line strings in the standard, but it does allow arrays of strings. Allow the Expression to optionally be an array of string to allow nicer formatting. Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ic21a7c00d4ce96d8d993902d6c3b36f027972947
phosphor-virtual-sensor reads in virtual_sensor_config.json There are two types of data in this file:
See virtual_sensor_config.json in this repository for an example. Sensors added this way can use any expression that is accepted by exprtk.
For example:
{ "Desc": { "Config": "D-Bus", "Type": "modifiedMedian" } }
Sensors added this way can only use a set of restricted calculations. At this stage the only type supported is modifiedMedian.
The virtual sensor configuration information needs to be added into the relevant hardware configuration file in entity-manager. This method of adding a virtual sensor allows a recipe that builds for different hardware configurations to have different virtual sensors for each configuration.
The virtual sensor configuration in entity manager follows a different format to the JSON in virtual_sensor_config.json (specified in entity-manager/schemas/VirtualSensor.json).