MCPcopy Create free account
hub / github.com/BlueAndi/Pixelix / handleHumidity

Method handleHumidity

lib/TempHumidPlugin/src/TempHumidPlugin.cpp:237–257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235}
236
237void 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

Callers

nothing calls this directly

Calls 3

loadIconByTypeMethod · 0.45
setFormatTextMethod · 0.45
getTypeMethod · 0.45

Tested by

no test coverage detected