2026-10-15 19:43:59 +02:00
|
|
|
#include "display/page_resources.h"
|
|
|
|
|
|
2026-10-15 21:01:14 +02:00
|
|
|
#include <Arduino.h>
|
|
|
|
|
|
2026-10-15 19:43:59 +02:00
|
|
|
#include "display/bitmap_store.h"
|
|
|
|
|
#include "display/font_store.h"
|
|
|
|
|
#include "net/ha_api.h"
|
|
|
|
|
|
2026-10-15 21:01:14 +02:00
|
|
|
Stopwatch stopwatch;
|
|
|
|
|
StoredPageResources pageResources(stopwatch);
|
2026-10-15 19:43:59 +02:00
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
}
|
2026-10-15 21:01:14 +02:00
|
|
|
|
|
|
|
|
uint32_t StoredPageResources::stopwatchMs()
|
|
|
|
|
{
|
|
|
|
|
return _stopwatch.elapsed(millis());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool StoredPageResources::stopwatchRunning()
|
|
|
|
|
{
|
|
|
|
|
return _stopwatch.running();
|
|
|
|
|
}
|