private void HandleButtonClick(string buttonText) { if (buttonText == "Tür") { Form DoorCam = new DoorCam(); DoorCam.ShowDialog(); return; } for (int i = 0; i < MenuModes.GetLength(0); i++) { if (MenuModes[i, 0] == "menu") { if (MenuModes[i, 1] == buttonText) // wenn vorhanden, rufe ein untermenü auf { MenuMode = buttonText; UpdateMenuItems(); return; } } else if (MenuModes[i, 0] == "switch") { string mqttTopic = MqttManagement.getPubTopic(buttonText); if (mqttTopic != "FAIL") { MqttManagement.PublishMqttMessage(mqttTopic, "TOGGLE"); //ansonsten mqtt publish } } else if (MenuModes[i, 0] == "sensor") { } } }
private void buttonOpenDoor_Click(object sender, EventArgs e) { MqttManagement.PublishMqttMessage("/tuer", "AUF"); }