Skip to content

Commit

Permalink
Disable buttons if entity is off.
Browse files Browse the repository at this point in the history
  • Loading branch information
Martreides committed Jan 9, 2025
1 parent 682497c commit c644513
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,12 @@ class ThermostatTile : TileService() {

private fun getTempButton(enabled: Boolean, action: String): LayoutElement {
val clickable = Clickable.Builder()
.setOnClick(ActionBuilders.LoadAction.Builder().build())
.setId(action)
.build()
if (enabled) {
clickable.setOnClick(ActionBuilders.LoadAction.Builder().build())
.setId(action)
}

return Button.Builder(this, clickable)
return Button.Builder(this, clickable.build())
.setTextContent(if (action == TAP_ACTION_DOWN) "" else "+")
.setButtonColors(
ButtonColors(
Expand Down

0 comments on commit c644513

Please sign in to comment.