Convert "Update TFT display" into a button
* This is a breaking change. Existing automation using the Switch version will need an update to use the button version instead. This was originally set as a switch, but in reality it behaves as a button, as when the user click it runs an action (in this case, update the TFT display file). Switches should be used only when an entity will remain in one of the two states (on/off), which is not the case here. This is related to #328.
This commit is contained in:
@@ -107,12 +107,22 @@ uart:
|
|||||||
baud_rate: 115200
|
baud_rate: 115200
|
||||||
id: tf_uart
|
id: tf_uart
|
||||||
|
|
||||||
###### REBOOT BUTTON #####
|
##### START - BUTTON CONFIGURATION #####
|
||||||
button:
|
button:
|
||||||
|
###### REBOOT BUTTON #####
|
||||||
- platform: restart
|
- platform: restart
|
||||||
name: ${device_name} Restart
|
name: ${device_name} Restart
|
||||||
id: restart_nspanel
|
id: restart_nspanel
|
||||||
|
|
||||||
|
##### UPDATE TFT DISPLAY #####
|
||||||
|
- platform: template
|
||||||
|
name: ${device_name} Update TFT display
|
||||||
|
icon: mdi:file-sync
|
||||||
|
id: tft_update
|
||||||
|
entity_category: config
|
||||||
|
on_press:
|
||||||
|
- delay: 16ms
|
||||||
|
- lambda: id(disp1).upload_tft();
|
||||||
|
|
||||||
##### START - API CONFIGURATION #####
|
##### START - API CONFIGURATION #####
|
||||||
api:
|
api:
|
||||||
@@ -748,16 +758,6 @@ switch:
|
|||||||
restore_state: false
|
restore_state: false
|
||||||
optimistic: true
|
optimistic: true
|
||||||
|
|
||||||
##### UPDATE TFT DISPLAY #####
|
|
||||||
- platform: template
|
|
||||||
name: ${device_name} Update TFT display
|
|
||||||
id: tft_update
|
|
||||||
entity_category: config
|
|
||||||
turn_on_action:
|
|
||||||
- delay: 16ms
|
|
||||||
- lambda: id(disp1).upload_tft();
|
|
||||||
- switch.turn_off: tft_update
|
|
||||||
|
|
||||||
##### PHYSICAL SWITCH 1 #####
|
##### PHYSICAL SWITCH 1 #####
|
||||||
- platform: gpio
|
- platform: gpio
|
||||||
name: ${device_name} Relay 1
|
name: ${device_name} Relay 1
|
||||||
|
|||||||
Reference in New Issue
Block a user