Skip to content

Commit

Permalink
Add checks if mqtt is connected
Browse files Browse the repository at this point in the history
  • Loading branch information
spuder committed Nov 22, 2024
1 parent 5804eca commit 8602c37
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 12 deletions.
9 changes: 0 additions & 9 deletions firmware/conf.d/mqtt_bambu_lan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,6 @@ mqtt:
-----END CERTIFICATE-----
clean_session: true
enable_on_boot: false
#TODO: set enable_on_boot to false once this is merged: https://github.com/esphome/esphome/pull/7716
# script:
# - id: check_mqtt_creds
# then:
# - lambda: |-
# if (id(bambu_mqtt)->broker != "" && id(bambu_mqtt)->password != "" && id(bambu_serial_number) != "") {
# ESP_LOGI("MQTT", "Enabling MQTT");
# id(bambu_mqtt)->enable = true;
# }

# text_sensor:
# - platform: mqtt_subscribe
Expand Down
4 changes: 2 additions & 2 deletions firmware/conf.d/pn532_rfid-ams.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pn532_spi:
- if:
condition:
and:
#TODO: Verify mqtt is connected
- mqtt.connected
- lambda: 'return id(filament_raw_data1).state != "";'
- lambda: 'return id(filament_raw_data1).state != "{}";'
- binary_sensor.is_on: rfid_reader_spi_1_tag_is_openspool
Expand Down Expand Up @@ -154,7 +154,7 @@ pn532_spi:
- if:
condition:
and:
#TODO: Verify mqtt is connected
- mqtt.connected
- lambda: 'return id(filament_raw_data2).state != "";'
- lambda: 'return id(filament_raw_data2).state != "{}";'
- binary_sensor.is_on: rfid_reader_spi_2_tag_is_openspool
Expand Down
2 changes: 1 addition & 1 deletion firmware/conf.d/pn532_rfid-solo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ pn532_spi:
- if:
condition:
and:
#TODO: Verify mqtt is connected
- mqtt.connected
- lambda: 'return id(filament_raw_data0).state != "";'
- lambda: 'return id(filament_raw_data0).state != "{}";'
- binary_sensor.is_on: rfid_reader_spi_0_tag_is_openspool
Expand Down
Binary file removed hardware/OpenSpool.fzz
Binary file not shown.

0 comments on commit 8602c37

Please sign in to comment.