Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/content/docs/components/esphome.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,28 @@ however, be aware that this may lead to increased flash wearing and a shortened

For [ESP8266](/components/esp8266/), `restore_from_flash` must also be set to `true` for states to be written to flash.

### Methods available for use in Lambdas

From a [lambda](/automations/templates#config-lambda), you can call two methods on the preferences component to stop and start the flash write.

- `stop_poller()` : Stop flushing persistant data to flash, even when stopped, a controlled shutdown or reboot will save persistent data to flash.

- `start_poller()` : Start flushing persistant data to flash on the flash_write_interval.

> [!NOTE]
> The preferences component's global pointer is `preferences_intervalsyncer_id`

Example of using stop_poller

```yaml
on_boot:
then:
- delay: 70sec
- lambda: |-
preferences_intervalsyncer_id->stop_poller();
- logger.log: "Disable preference sync"
```

<span id="esphome-changing_node_name"></span>

## Changing ESPHome Node Name
Expand Down
Loading