 		reedToDebounce = false;
 		// sending notification about door state
 		char buf[12];
-		int len = snprintf(buf, 12, "^%d|%08ld", door == close ? 0 : 1, time);
+		int len = snprintf(buf, 12, "^%d|%08ld", door == DOOR_CLOSED ? 0 : 1, time);
 		udpSendPacket(buf, len);
 
-		if (door == close)
+		if (door == DOOR_CLOSED)
 		{
 			lockDoor();
 		}
-		if (door == open)
+		if (door == DOOR_OPENED)
 		{
 			// when door are opened during locking time, unlock door, but only
 			// within specific time since locking started (to prevent from opening

		buttonEvent = millis();
		previousButtonState = button;
	}
	if (button == pressed)
	{
		unsigned long t = millis() - buttonEvent;
		if (t >= 15000 && t <= 15100)


EthernetUDP udp;

const bool DOOR_OPENED = true;
const bool DOOR_CLOSED = false;

const bool BUTTON_PRESSED = false;
const bool BUTTON_RELEASED = true;

bool previousDoorState = DOOR_CLOSED;
bool previousButtonState = true;


int doorEvent = 0;

