7#include "../LockState.h"
8#include "../configuration/Configuration.h"
11#include <RotaryEncoder.h>
44 : lcd::ViewBase(
display,
"EmergencyEnterKeyView")
69 display->print(
"Enter emergency key:");
79 virtual void tick(
const bool& forceRedraw) {
80 auto direction =
encoder->getDirection();
81 bool redraw = forceRedraw;
83 if (direction == RotaryEncoder::Direction::CLOCKWISE) {
95 else if (direction == RotaryEncoder::Direction::COUNTERCLOCKWISE) {
116 if (!timeRestictions.restrictEmergencyKeyTimes || timeRestictions.checkTime()) {
136 for (
int i = 0; i < 6; i++) {
137 display->setCursor(2 * i + 3, 3);
static void setLastUpdateTime(const time_t &lastUpdateTime)
Set the time of the last update over the emlalock api.
Definition: LockState.h:447
static void setEndDate(const time_t &endDate)
Set the End Date.
Definition: LockState.h:334
const TimeRestrictions & getTimeRestrictions() const
get the timeout of display backlight in seconds
Definition: Configuration.h:354
static Configuration & getSingleton()
Get the Singleton object.
Definition: Configuration.h:162
View which allows to enter a key to unlock without WiFi.
Definition: EmergencyEnterKeyView.h:18
char enteredKey[7]
Cache of the entered key.
Definition: EmergencyEnterKeyView.h:29
EmergencyEnterKeyView(EmergencyEnterKeyView &&other) noexcept=delete
Move constructor.
EmergencyEnterKeyView(const EmergencyEnterKeyView &other)=delete
Copy constructor - not available.
virtual void tick(const bool &forceRedraw)
called during the loop function
Definition: EmergencyEnterKeyView.h:79
RotaryEncoder * encoder
pointer to the encoder instance
Definition: EmergencyEnterKeyView.h:23
virtual void activate()
called as soon as the view becomes active
Definition: EmergencyEnterKeyView.h:63
EmergencyEnterKeyView(LiquidCrystal_PCF8574 *display, RotaryEncoder *encoder)
Construct the view object.
Definition: EmergencyEnterKeyView.h:43
int editIndex
Position of the key cache which is currently edited.
Definition: EmergencyEnterKeyView.h:35
static bool activateView(const ViewId &id)
activates the view described by the id
Definition: ViewStore.h:98
@ UnlockSafeView
Definition: ViewStore.h:38
@ TimeRestrictedView
Definition: ViewStore.h:36
views::ConfigurationServerView configurationServerView & display
Definition: main.cpp:57
Definition: ConfigurationServerView.h:10