MCPcopy Create free account
hub / github.com/OpenEPaperLink/OpenEPaperLink / getWeatherIcon

Function getWeatherIcon

ESP32_AP-Flasher/src/contentmanager.cpp:981–993  ·  view source on GitHub ↗

@brief Get a weather icon @param id Icon identifier/index @param isNight Use night icons (true) or not (false) @return String reference to icon

Source from the content-addressed store, hash-verified

979/// @param isNight Use night icons (true) or not (false)
980/// @return String reference to icon
981const String getWeatherIcon(const uint8_t id, const bool isNight = false) {
982 const String weatherIcons[] = {"\uf00d", "\uf00c", "\uf002", "\uf013", "\uf013", "\uf014", "", "", "\uf014", "", "",
983 "\uf01a", "", "\uf01a", "", "\uf01a", "\uf017", "\uf017", "", "", "",
984 "\uf019", "", "\uf019", "", "\uf019", "\uf015", "\uf015", "", "", "",
985 "\uf01b", "", "\uf01b", "", "\uf01b", "", "\uf076", "", "", "\uf01a",
986 "\uf01a", "\uf01a", "", "", "\uf064", "\uf064", "", "", "", "",
987 "", "", "", "", "\uf01e", "\uf01d", "", "", "\uf01e"};
988 if (isNight && id <= 2) {
989 const String nightIcons[] = {"\uf02e", "\uf083", "\uf086"};
990 return nightIcons[id];
991 }
992 return weatherIcons[id];
993}
994
995void drawWeatherContent(JsonDocument &doc, JsonDocument &loc, TFT_eSprite &spr, JsonObject &cfgobj, imgParam &imageParams, bool isForecast = false) {
996 const auto &currentWeather = doc["current_weather"];

Callers 2

drawWeatherContentFunction · 0.85
drawForecastFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected