Skip to content

Conversation

@ticaki
Copy link
Contributor

@ticaki ticaki commented Sep 29, 2025

This PR addresses the integration of detailed file storage documentation for ioBroker adapter developers. The documentation explains the proper use of writeFileAsync with meta objects and their impact on backup behavior.

What's Added

New Documentation File

  • docs/en/dev/filestorage.md - Comprehensive guide covering:
    • Meta object types (meta vs meta.user) and their backup behavior
    • Proper namespace definitions for file storage
    • Code examples for writing keys, configuration files, and temporary data
    • Best practices based on real adapter implementations (e.g., Sayit adapter)

Integration Points

The documentation is strategically linked from two key locations where developers naturally look for file operation information:

  1. Adapter Development FAQ (docs/en/dev/adapter-dev-faq.md)

    • Extended the existing "Writing files" section that addresses the common warning about missing meta objects
    • Added direct link to comprehensive documentation
  2. Adapter Development Guide (docs/en/dev/adapterdev.md)

    • Added reference note in the Functions section right after writeFile function listing
    • Provides context for modern writeFileAsync usage

Problem Solved

Previously, developers encountered warnings like:

writeFile will not write this file (picture.jpg) in future versions: <adapter> is not an object of type "meta"

The new documentation provides clear guidance on:

  • When to use meta (temporary, not backed up) vs meta.user (persistent, backed up)
  • How to properly define meta objects in io-package.json
  • Complete code examples for different storage scenarios

This ensures developers can implement file storage correctly from the start and understand the implications for backup systems.

Original prompt

This section details on the original issue you should resolve

<issue_title>Binde dev-document ein</issue_title>
<issue_description>Analysiere dieses Dokument und verstehe die Aussagen

iobroker_file_storage_documentation.md

und finde anschließend im Dokumentationsunterzweig ./docs/en/dev einen oder mehrere Punkte wo man das Dokument am sinnvollsten per Verlinkung einbinden kann. Anschließend füge das dokument und die verlinkung hinzu.

Berichte wo du es eingebunden hast mit 3 zeiligen Auszügen.</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes ticaki#3

Copilot AI review requested due to automatic review settings September 29, 2025 10:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds comprehensive file storage documentation for ioBroker adapter developers, specifically addressing the proper use of writeFileAsync with meta objects and their impact on backup behavior.

  • New comprehensive documentation file explaining meta objects, backup behavior, and file storage best practices
  • Integration of documentation links into existing developer resources where file operations are discussed
  • Clear guidance on when to use meta vs meta.user with practical code examples

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
docs/en/dev/filestorage.md New comprehensive file storage guide covering meta objects, backup behavior, and code examples
docs/en/dev/adapterdev.md Added reference note linking to file storage documentation after writeFile function listing
docs/en/dev/adapter-dev-faq.md Extended existing "Writing files" section with link to comprehensive documentation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@ticaki
Copy link
Contributor Author

ticaki commented Sep 29, 2025

@Apollon77
ping :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Binde dev-document ein

1 participant