Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Oct 14, 2025

Fixes #723

Overview

Admin 5 no longer supports custom_m.html for custom state settings and requires a JSON-based configuration format instead. This PR replaces custom_m.html generation with the new jsonCustom.json format.

Changes

When the "Custom options for states" feature is selected during adapter creation, the tool now generates only:

  • admin/jsonCustom.json - New JSON Config format required for Admin 5

Note: custom_m.html is no longer generated as Admin 5 does not support it.

Example jsonCustom.json

{
    "i18n": true,
    "type": "panel",
    "items": {
        "enabled": {
            "type": "checkbox",
            "label": "enabled",
            "newLine": true
        },
        "interval": {
            "type": "text",
            "label": "period of time",
            "newLine": true
        },
        "state": {
            "type": "text",
            "label": "new state",
            "newLine": true
        },
        "setAck": {
            "type": "checkbox",
            "label": "ack",
            "newLine": true
        }
    }
}

Key Features

  • ✅ Follows the same JSON Config schema format as jsonConfig.json
  • ✅ Contains the same fields as the old custom_m.html (enabled, interval, state, setAck)
  • ✅ VSCode schema validation already configured for jsonCustom.json
  • ✅ Migration logic updated to detect existing jsonCustom.json files
  • ✅ Changelog entry added with migration guide reference

Migration for Existing Adapters

If you have an existing adapter with custom_m.html, you need to migrate to admin/jsonCustom.json for Admin 5 compatibility. See documentation for migration steps.

References

Original prompt

This section details on the original issue you should resolve

<issue_title>Adjust "custom_m" logic for Admin5</issue_title>
<issue_description>Admin 5 will NOT support custom_m.html anymore but need to get details differently with the new config file...

Examples:

But we need to wait, not final ...</issue_description>

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

@Apollon77 @GermanBluefox we need detaisl on format please! @AlCalzone Would it make sense to define a json Schema like for io-package? @Apollon77 I would say "yes in any case" :-) ... wen need that specs @Apollon77 https://github.com/ioBroker/ioBroker.admin/blob/master/src-rx/src/components/JsonConfigComponent/SCHEMA.md

Vllt gute basis?</comment_new>
<comment_new>@UncleSamSwiss
AFAIK @foxriver76 is currently creating a JSON schema for this.</comment_new>
<comment_new>@foxriver76
Current draft is here ioBroker/adapter-react#18 but still some things to do.</comment_new>

Fixes #723


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits October 14, 2025 07:56
Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com>
Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com>
Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com>
Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Adjust custom_m logic for Admin5 configuration Add jsonCustom.json support for Admin 5 compatibility Oct 14, 2025
@Copilot Copilot AI requested a review from Apollon77 October 14, 2025 08:09
Copilot finished work on behalf of Apollon77 October 14, 2025 08:09
Copy link
Collaborator

@Apollon77 Apollon77 left a comment

Choose a reason for hiding this comment

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

@copilot no need to generate "custom_m.html". Just only generate the json file. Additionally it seems that you somehow deleted all test baseline files. Please regenerate them.
Great that you added a migration file. keep this. but you missed the changelog entry

Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Oct 15, 2025

@copilot no need to generate "custom_m.html". Just only generate the json file. Additionally it seems that you somehow deleted all test baseline files. Please regenerate them.
Great that you added a m...

Changes implemented:

  1. ✅ Removed custom_m.html generation - template now returns undefined
  2. ✅ Restored all deleted test baseline files
  3. ✅ Added changelog entry with migration guide reference

Commit: {commit_hash}

@Copilot Copilot AI changed the title Add jsonCustom.json support for Admin 5 compatibility Replace custom_m.html with jsonCustom.json for Admin 5 compatibility Oct 15, 2025
@Copilot Copilot AI requested a review from Apollon77 October 15, 2025 17:45
Copilot finished work on behalf of Apollon77 October 15, 2025 17:45
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.

Adjust "custom_m" logic for Admin5

2 participants