Issue#1556. Battery module: wrong string comparison

1. battery.hpp - added local bool variable. Force to print warnings the
only once in order to warn user about wrong battery configuraion. And
does not bring a mess when the battery is turned off (gamepads, etc.)
2. dir_name is an object which takes a part in comparison. So converted to the string.
This commit is contained in:
Viktar Lukashonak
2022-05-14 16:56:46 +03:00
parent 9bc821bdac
commit b39a8ede6c
2 changed files with 6 additions and 5 deletions

View File

@ -46,6 +46,7 @@ class Battery : public ALabel {
int global_watch_fd_;
std::mutex battery_list_mutex_;
std::string old_status_;
bool warnFirstTime_{true};
util::SleeperThread thread_;
util::SleeperThread thread_battery_update_;