Skip to content

Add the Fault Code Editor - #209

Open
beabel wants to merge 3 commits into
emsesp:mainfrom
beabel:fault-code-editor
Open

beabel wants to merge 3 commits into
emsesp:mainfrom
beabel:fault-code-editor

Conversation

@beabel

@beabel beabel commented Dec 1, 2026

Copy link
Copy Markdown

Adds an editor for the fault code lists, like the entity and WebUI translation editors. The lists live in https://github.com/emsesp/faultcodes (brands//{brand.json,codes.json,texts/.json}). They are turned into the packs that the WebUI installs on the Download/Upload page (see emsesp/EMS-ESP32#3493).

What it does

  • Page /faultcode-editor (noindex, like the other two editors), same toolbar, table, flag selects and stylesheet (TranslationEditor/styles.module.css).
  • Opens the lists from emsesp/faultcodes on GitHub, from a local folder (File System Access) or from single files. Drafts stay in the browser.
  • Tabs: Codes (add or change a code, its type and the devices), Translations (all languages side by side, missing texts and machine translations marked, a changed text counts as checked), Settings (the brand, its languages and device groups), Send.
  • New manufacturer and new language dialogs.
  • Send: "Send my changes on GitHub" opens a prefilled issue in emsesp/faultcodes (label suggestion, a readable summary and the data for the maintainers). Without a GitHub account the text can be copied. Nothing is sent without a click, and a tick box confirms the texts may be shared.
  • scripts/translate-faultcodes.js fills the missing translations of the lists with DeepL, like translate-locale.js: it never changes an existing text and marks generated texts with machine: true. Needs DEEPL_API_KEY; run it with --dir <clone of emsesp/faultcodes>; --dry-run shows what would be translated.
  • A paragraph in docs/Adding-Languages.md.

Tested

  • Production build (docusaurus build --locale en).
  • The page loads the Buderus list (1237 codes, German, English, Dutch) from emsesp/faultcodes, an edit shows up as a change, and the Send link opens emsesp/faultcodes/issues/new with the label and the filled-in text (the click was not followed, nothing was sent).
  • The suggestion text is accepted by tools/apply-suggestion.mjs of the lists repository (dry run).
  • translate-faultcodes.js dry run only, DeepL was not called.

Not tested

  • Saving into a local folder and reading from one.
  • The "New manufacturer" and "Add language" dialogs were built but not clicked through.
  • The other locales (de, nl) of the docs build.

Notes for review

  • The page is not linked from the navigation or sidebar yet; it is reachable at /faultcode-editor and mentioned in docs/Adding-Languages.md. Tell me where you want a link.
  • The editor and translate-faultcodes.js know nothing about the WebUI; the format is described in FORMAT.md of emsesp/faultcodes.

A page to add, correct and translate the explanations of the fault codes of EMS-ESP (fault code packs), in the style of the entity and WebUI translation editors: toolbar, language flags, a table with all languages side by side, drafts, and a suggestion that opens a GitHub issue. scripts/translate-faultcodes.js fills in missing translations with DeepL and marks them as machine translated.
@proddy

proddy commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Shoudl the faultcode editor be referenced in the translations page? I would say that since this is a major and excellent new feature, it deserves its own page in the documentation. Like under https://docs.emsesp.org/Adding-Faultcodes ?

This branch has not been deployed

No deployments
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.

2 participants