Questions about generic thermostat

Link to integration: Generic Thermostat - Home Assistant

What does option “keep_alive” do precisely? " If set, the switch specified in the heater option will be triggered every time the interval elapses".

How do you interpret “triggered” if the heater is ON and asking heat (i.e. switch should be in the ON position"):

  1. Does it toggle the switch to the OFF position and then to the ON position every every time the interval elapses irregardless of the current switch state?
  2. Does it check if the switch is still in the ON position and do nothing if it is every time the interval elapses?
  3. Does it check if the switch is (wrongly) in the OFF position and toggle it to ON position every time the interval elapses?

I’m trying to determine if this can be used to activate a switch with a dodgy zigbee connection. This would be option 3: if the switch is in the OFF position and the heater is asking heat, toggle it to the ON position. Check if this condition is met every time the interval elapses. So if the Zigbee connection gets restored, the switch will get activated as soon as an interval elapses.

Try it with a smart plug and you will probably see what happens

Yes, it verifies the switch state and toggles as required. so 2 and 3 seem to be correct