blob: bfb67aa14b53ecedf5d09a80786d0a6e24c5f5dd [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{
Patrick Venturec9c818e2018-09-04 09:44:49 -07008 // clang-format off
Patrick Venture043d3232018-08-31 10:10:53 -07009 auto a =
Patrick Venturec9c818e2018-09-04 09:44:49 -070010 std::find_if(
11 typeAttrMap.begin(),
12 typeAttrMap.end(),
13 [&](const auto& e)
14 {
15 return type == getHwmonType(e);
16 });
17 // clang-format on
Patrick Venture09791852018-04-17 17:40:00 -070018
19 if (a == typeAttrMap.end())
20 {
21 return false;
22 }
23
24 attributes = *a;
25 return true;
26}
27
Patrick Venture043d3232018-08-31 10:10:53 -070028} // namespace hwmon