Skip to content

Commit

Permalink
Fix YAML casing
Browse files Browse the repository at this point in the history
  • Loading branch information
WolfwithSword committed Jun 26, 2024
1 parent a801980 commit ad037fa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions files/homeassistant/hacs_version/individual_control.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ cards:
start_entity: button.{HA_PRINTER_DEVICE_NAME}_resume_printing
entity: sensor.{HA_PRINTER_DEVICE_NAME}_print_status
name: |
[[[ if (entity.state.upper == 'RUNNING') return "Pause";
else if (entity.state.upper == 'PAUSE') return "Resume";
[[[ if (entity.state.toUpperCase() == 'RUNNING') return "Pause";
else if (entity.state.toUpperCase() == 'PAUSE') return "Resume";
else return ''; ]]]
state:
- value: RUNNING
Expand Down Expand Up @@ -191,7 +191,7 @@ cards:
color: grey
tap_action:
action: >
[[[ if (entity.state.upper == 'RUNNING' || entity.state.upper == 'PAUSE') return
[[[ if (entity.state.toUpperCase() == 'RUNNING' || entity.state.toUpperCase() == 'PAUSE') return
"call-service";
else return "none";
Expand All @@ -200,10 +200,10 @@ cards:
service: button.press
service_data:
entity_id: >
[[[ if (states['sensor.{HA_PRINTER_DEVICE_NAME}_print_status'].state.upper ==
[[[ if (states['sensor.{HA_PRINTER_DEVICE_NAME}_print_status'].state.toUpperCase() ==
'RUNNING')
return variables.pause_entity;
if (states['sensor.{HA_PRINTER_DEVICE_NAME}_print_status'].state.upper == 'PAUSE')
if (states['sensor.{HA_PRINTER_DEVICE_NAME}_print_status'].state.toUpperCase() == 'PAUSE')
return variables.start_entity;
else return "";
]]]
Expand All @@ -219,8 +219,8 @@ cards:
- type: custom:button-card
entity: sensor.{HA_PRINTER_DEVICE_NAME}_print_status
name: |
[[[ if (entity.state.upper == 'RUNNING') return "Cancel";
else if (entity.state.upper =='PAUSE') return "Cancel";
[[[ if (entity.state.toUpperCase() == 'RUNNING') return "Cancel";
else if (entity.state.toUpperCase() =='PAUSE') return "Cancel";
else return ''; ]]]
confirmation:
text: Cancel Print?
Expand Down Expand Up @@ -269,7 +269,7 @@ cards:
color: grey
tap_action:
action: >
[[[ if (entity.state.upper == 'RUNNING' || entity.state.upper == 'PAUSE') return
[[[ if (entity.state.toUpperCase() == 'RUNNING' || entity.state.toUpperCase() == 'PAUSE') return
"call-service"; else return "none"; ]]]
service: button.press
service_data:
Expand Down
16 changes: 8 additions & 8 deletions files/homeassistant/nodered_version/individual_control.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ cards:
start_entity: button.{HA_PRINTER_DEVICE_NAME}_resume_print
entity: sensor.{HA_PRINTER_DEVICE_NAME}_print_status
name: |
[[[ if (entity.state.upper == 'RUNNING') return "Pause";
else if (entity.state.upper == 'PAUSE') return "Resume";
[[[ if (entity.state.toUpperCase() == 'RUNNING') return "Pause";
else if (entity.state.toUpperCase() == 'PAUSE') return "Resume";
else return ''; ]]]
state:
- value: RUNNING
Expand Down Expand Up @@ -280,7 +280,7 @@ cards:
color: grey
tap_action:
action: >
[[[ if (entity.state.upper == 'RUNNING' || entity.state.upper == 'PAUSE') return
[[[ if (entity.state.toUpperCase() == 'RUNNING' || entity.state.toUpperCase() == 'PAUSE') return
"call-service";
else return "none";
Expand All @@ -289,10 +289,10 @@ cards:
service: button.press
service_data:
entity_id: >
[[[ if (states['sensor.{HA_PRINTER_DEVICE_NAME}_print_status'].state.upper ==
[[[ if (states['sensor.{HA_PRINTER_DEVICE_NAME}_print_status'].state.toUpperCase() ==
'RUNNING')
return variables.pause_entity;
if (states['sensor.{HA_PRINTER_DEVICE_NAME}_print_status'].state.upper == 'PAUSE')
if (states['sensor.{HA_PRINTER_DEVICE_NAME}_print_status'].state.toUpperCase() == 'PAUSE')
return variables.start_entity;
else return "";
]]]
Expand Down Expand Up @@ -374,8 +374,8 @@ cards:
- type: custom:button-card
entity: sensor.{HA_PRINTER_DEVICE_NAME}_print_status
name: |
[[[ if (entity.state.upper == 'RUNNING') return "Cancel";
else if (entity.state.upper =='PAUSE') return "Cancel";
[[[ if (entity.state.toUpperCase() == 'RUNNING') return "Cancel";
else if (entity.state.toUpperCase() =='PAUSE') return "Cancel";
else return ''; ]]]
confirmation:
text: Cancel Print?
Expand Down Expand Up @@ -424,7 +424,7 @@ cards:
color: grey
tap_action:
action: >
[[[ if (entity.state.upper == 'RUNNING' || entity.state.upper == 'PAUSE') return
[[[ if (entity.state.toUpperCase() == 'RUNNING' || entity.state.toUpperCase() == 'PAUSE') return
"call-service"; else return "none"; ]]]
service: button.press
service_data:
Expand Down

0 comments on commit ad037fa

Please sign in to comment.