Smart plug with ESPHome auto turn off after lost connection to Home Assistant?

I’m using a Tuya smart plug, flashed with ESPhome, to control a power to one UPS. Nothing fancy going on, just a switch and several sensors. I just set the restore_mode: ALWAYS_ON to turn on the switch when the power is back.

When I stopped Home assistant for maintenance or other reason, the smart plug shuts itself off after ~10 minutes. Is this designed? Is there a way to disable it? My goal is to not let the UPS run without power input for more than 10 minutes(unless there’s an power outage which I can’t control)

Here’s the config

# This one has timer!

substitutions:
  device_name: ups_power
  friendly_name: UPS Power
  type: yx_ws01

esphome:
  name: ${device_name}

esp8266:
  board: esp01_1m
  restore_from_flash: true

wifi:
  ssid: "SSID"
  password: "xxxxxxxxx"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: ${friendly_name} Fallback Hotspot
    password: "xxxxxxxxx"

captive_portal:

# Enable Home Assistant API
api:

ota:

web_server:

logger:

output:
  - platform: gpio
    id: led1
    pin:
      number: GPIO13
      inverted: true

light:
  - platform: binary
    name: Status LED
    id: status_led
    internal: true
    output: led1
    restore_mode: ALWAYS_ON

switch:
  - platform: gpio
    name: ${friendly_name}
    id: ${device_name}
    restore_mode: ALWAYS_ON
    pin:
      number: GPIO14
    on_turn_on:
      then:
        - light.turn_on: status_led
    on_turn_off:
      then:
        - light.turn_off: status_led

binary_sensor:
  - platform: status
    name: ${friendly_name} Status
    id: ${device_name}_status

  - platform: gpio
    id: button
    internal: true
    pin:
      number: GPIO1
      mode: INPUT
    on_press:
      then:
        - switch.toggle: ${device_name}

sensor:
  - platform: wifi_signal
    name: ${friendly_name} Wifi Signal
    id: ${device_name}_wifi_signal
    update_interval: 15s

At least it is designed to reboot but can be disabled. See https://esphome.io/components/api.html

reboot_timeout (Optional, Time): The amount of time to wait before rebooting when no client connects to the API. This is needed because sometimes the low level ESP functions report that the ESP is connected to the network, when in fact it is not - only a full reboot fixes it. Can be disabled by setting this to 0s. Defaults to 15min.

Nice. I’ll give it a try later. Thanks!