| commit | 7d2f323ab5b5ea663e625767f19552325a2f759c | [log] [tgz] |
|---|---|---|
| author | Amithash Prasad <amithash@meta.com> | Mon Jun 02 20:31:48 2025 -0700 |
| committer | Patrick Williams <patrick@stwcx.xyz> | Thu Sep 04 18:48:37 2025 +0000 |
| tree | 4355a7df65cb5c03f5985f2eb366eacb7405b750 | |
| parent | 162a1bd4b598d06d893049bf66ef7cd03640f62e [diff] |
Add a units and objPath member to the sensor class Adding a units and objPath members to be reusable in the future. Moved around helper maps as needed. Change-Id: Ic5fda95b5c8673476c2ee91359691f8afc21f7e2 Signed-off-by: Amithash Prasad <amithash@meta.com>
phosphor-virtual-sensor reads the configuration file virtual_sensor_config.json from one of three locations:
/var/lib/phosphor-virtual-sensor/usr/share/phosphor-virtual-sensorBy default the repository will install a sample config into (3).
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" } }
Sensors added this way can only use a set of restricted calculations. Currently supported types are Average, Maximum, Minimum, Sum and 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).