jimz011 / homekit-infused

Homekit Infused 5 2023
https://jimz011.github.io/homekit-infused/
Other
879 stars 138 forks source link

Button Addon: shows state last changed when it should not #182

Closed drpeppershaker closed 2 years ago

drpeppershaker commented 2 years ago

show_last_changed: is set to false.

Expected result: Last Changed does not appear on the button

Actual result: Last changed does indeed appear on the button

Relevant YAML snippet:

Garage:
  title: "Garage"
  show_in_favorites: true
  show_in_menu: true
  subtitle: "Beep Beep"
  icon: mdi:garage-variant
  addons:
    button:
      - title: Garage
        entities:
          - entity: light.garage_lights_3
            Name: Garage Lights
          - entity: light.garage_coach_lights_3
            name: Coach Lights
          - entity: binary_sensor.garage_door_button_input
            name: Garage Door
            show_label: false
            popup_style: switch
            show_last_changed: false
            icon: "[[[ if (entity.state == 'on') return `mdi:garage-open-variant`; else return `mdi:garage-variant` ]]]"
            state_display: "[[[ if (entity.state == 'on') return `Open`; else return `Closed` ]]]"
            tap_action:
              action: call-service
              service: switch.toggle
              service_data:
                entity_id: switch.garage_door_button

Result:

Screen Shot 2022-09-27 at 3 27 54 PM
jimz011 commented 2 years ago

Will take a look at this, ty for creating the issue!

jimz011 commented 2 years ago

This is because a binary sensor is defined (the HKI button addon tries to figure out what to do with it by itself). You can change the button type to something else and force it to be a switch instead (this should force the card to be shown as if it was a switch). I will keep this in mind though and fix this for the next update.

jimz011 commented 2 years ago

Fixed in the upcoming release! Closing this now