Files
Flipdot-display/src/esp32/display/page_resources.cpp
T

35 lines
702 B
C++
Raw Normal View History

#include "display/page_resources.h"
#include <Arduino.h>
#include "display/bitmap_store.h"
#include "display/font_store.h"
#include "net/ha_api.h"
Stopwatch stopwatch;
StoredPageResources pageResources(stopwatch);
bool StoredPageResources::background(const char *name, uint8_t *bitmap)
{
return loadBitmap(name, bitmap);
}
Font StoredPageResources::font(const char *name)
{
return findFont(name);
}
const char *StoredPageResources::haValue(const PageElement &element)
{
return haApiValue(element.entity, element.attribute);
}
uint32_t StoredPageResources::stopwatchMs()
{
return _stopwatch.elapsed(millis());
}
bool StoredPageResources::stopwatchRunning()
{
return _stopwatch.running();
}