 	{
 		unsigned long time = millis() - buttonEvent;
 
-		if (button == released)
+		if (button == BUTTON_RELEASED)
 		{
 			// force door unlock in case of staying in wrong state
 			if (time > 15000)


EthernetUDP udp;

const bool open = true;
const bool close = false;

bool previousDoorState = close;
bool previousButtonState = true;

const bool pressed = false;
const bool released = true;

int doorEvent = 0;


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