From 85f742d903cd414d86244d75a10f3c0d95fa76c0 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Thu, 22 Apr 2021 16:51:11 +0200 Subject: [PATCH] Zigbee Fix loading previous file --- tasmota/xdrv_23_zigbee_4c_devices.ino | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tasmota/xdrv_23_zigbee_4c_devices.ino b/tasmota/xdrv_23_zigbee_4c_devices.ino index b87f4e0e1..70bfc53c4 100644 --- a/tasmota/xdrv_23_zigbee_4c_devices.ino +++ b/tasmota/xdrv_23_zigbee_4c_devices.ino @@ -290,6 +290,14 @@ bool loadZigbeeDevices(void) { if (!f.valid() && dfsp) { file = dfsp->open(TASM_FILE_ZIGBEE, "r"); if (file) { + uint32_t signature = 0x0000; + file.read((uint8_t*)&signature, 4); + if (signature == ZIGB_NAME2) { + // skip another 4 bytes + file.read((uint8_t*)&signature, 4); + } else { + file.seek(0); // seek back to beginning of file + } f.init(&file); storage_class = PSTR("File System"); }