ac lock not working

This commit is contained in:
Siwat Sirichai 2024-03-23 13:31:06 +07:00
parent 0a93b99021
commit b3fe91ac8e
9 changed files with 332 additions and 238 deletions

View file

@ -104,8 +104,11 @@ void setup()
cud_display_cards_t cards = {
.inputCard = &espmega.inputs,
.outputCard = &espmega.outputs,
.ac = &ac};
.ac = &ac,
.fram = &espmega.fram,
.iot = espmega.iot,};
cudDisplay.begin(cards);
espmega.iot->registerMqttCallback(handle_mqtt_message);
ESP_LOGI("CUD IoT OS", "Initialization Complete");
}
@ -127,4 +130,8 @@ void handle_input_change(uint8_t pin, bool state) {
if (pin >= 0 && pin <= 6) {
espmega.outputs.setState(pin, !espmega.outputs.getState(pin));
}
}
void handle_mqtt_message(char *topic, char *payload) {
ESP_LOGD("CUD IoT OS", "MQTT Message Received: %s, %s", topic, payload);
}