Command Line Switch not updating

When I check the template value, it’s returning ‘False’ but the switch state is on.
Should this automatically update based on the state?

- platform: command_line
  switches:
    foo_app:
      command_on: !secret foo_on
      command_off: !secret foo_off
      value_template: "{{ is_state_attr('sensor.foo', 'foregroundApp', 'de.ozerov.fully') }}"
      friendly_name: Foo Current App
      

Well, it will update when the sensor is updated, i.e. by default every 60 seconds

But it isn’t updating…

So the foregroundApp attribute from sensor.foo is updating fine
But this doesn’t reflect on my switch state