blob: adde6e404b7554ef16e2b8ed8d03a68bbe3fe313 [file] [log] [blame]
Patrick Venture09791852018-04-17 17:40:00 -07001#include "hwmon.hpp"
2
Patrick Venture043d3232018-08-31 10:10:53 -07003namespace hwmon
4{
Patrick Venture09791852018-04-17 17:40:00 -07005
6bool getAttributes(const std::string& type, Attributes& attributes)
7{
8 // *INDENT-OFF*
Patrick Venture043d3232018-08-31 10:10:53 -07009 auto a =
10 std::find_if(typeAttrMap.begin(), typeAttrMap.end(),
11 [&](const auto& e) { return type == getHwmonType(e); });
Patrick Venture09791852018-04-17 17:40:00 -070012 // *INDENT-ON*
13
14 if (a == typeAttrMap.end())
15 {
16 return false;
17 }
18
19 attributes = *a;
20 return true;
21}
22
Patrick Venture043d3232018-08-31 10:10:53 -070023} // namespace hwmon