diff options
Diffstat (limited to 'mainloop.cpp')
-rw-r--r-- | mainloop.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/mainloop.cpp b/mainloop.cpp index 221c8c9..5243f3c 100644 --- a/mainloop.cpp +++ b/mainloop.cpp @@ -216,17 +216,24 @@ std::string MainLoop::getID(SensorSet::container_t::const_reference sensor) /* * Check if the value of the MODE_<item><X> env variable for the sensor - * is "label", then read the sensor number from the <item><X>_label + * is set. If it is, then read the from the <item><X>_<mode> * file. The name of the DBUS object would be the value of the env - * variable LABEL_<item><sensorNum>. If the MODE_<item><X> env variable + * variable LABEL_<item><mode value>. If the MODE_<item><X> env variable * doesn't exist, then the name of DBUS object is the value of the env * variable LABEL_<item><X>. + * + * For example, if MODE_temp1 = "label", then code reads the temp1_label + * file. If it has a 5 in it, then it will use the following entry to + * name the object: LABEL_temp5 = "My DBus object name". + * */ auto mode = env::getEnv("MODE", sensor.first); - if (!mode.compare(hwmon::entry::label)) + if (!mode.empty()) { id = env::getIndirectID( - _hwmonRoot + '/' + _instance + '/', sensor.first); + _hwmonRoot + '/' + _instance + '/', + mode, + sensor.first); if (id.empty()) { |