Defined in File sensor_config.h
Get polarity from string.
str_val[in] The string to decode into a polarity.
polarity corresponding to the string, or nullopt on error.