| 235 | } |
| 236 | |
| 237 | void TempHumidPlugin::handleHumidity() |
| 238 | { |
| 239 | m_view.loadIconByType(_TempHumidPlugin::View::ICON_HUMIDITY); |
| 240 | |
| 241 | if (nullptr == m_humiditySensorCh) |
| 242 | { |
| 243 | m_view.setFormatText("{hc}-"); |
| 244 | } |
| 245 | else |
| 246 | { |
| 247 | char valueReducedPrecison[10] = { 0 }; /* Holds a value in lower precision for display. */ |
| 248 | String text; |
| 249 | |
| 250 | (void)snprintf(valueReducedPrecison, sizeof(valueReducedPrecison), "%3.0f", m_humidity); |
| 251 | text = "{hc}"; |
| 252 | text += valueReducedPrecison; |
| 253 | text += ISensorChannel::channelTypeToUnit(m_humiditySensorCh->getType()); |
| 254 | |
| 255 | m_view.setFormatText(text); |
| 256 | } |
| 257 | } |
| 258 | |
| 259 | /****************************************************************************** |
| 260 | * External Functions |
nothing calls this directly
no test coverage detected