nspanel-lovelace-ui icon indicating copy to clipboard operation
nspanel-lovelace-ui copied to clipboard

[Feature Request] [iobroker] Seperation of code

Open Grrzzz opened this issue 2 years ago • 0 comments

FEATURE DESCRIPTION

Currently, we have 3 files in iobroker:

  1. icon_mapping.ts
  2. NsPanelTs.ts
  3. ioBroker_NSPanel_locales.json

File 1 placed in global directory (can be "resused") File 3 downloaded on the fly (this should also be changed to a global file in my opionion, as you cannot take internet access for granted; different story...)

File 2 being the main issue with BOTH a custom configuration and the main code.

So: Please seperate nsPanelTs.ts in (at least) two files, being:

  1. nsPanelTs.ts as global script / object placed in global script directory just as icon_mapping.ts
  2. nsPanelTsCustom.ts in "local" script folder, only including page description and "Config" object.

By doing this, you can call the main script as a reference when using more than one panel with different configurations.

ADDITIONAL CONTEXT

Updating is a pain in the a##. given that you have more than one panel.

Also, it gets really hard if you want to place custom code in "your" base code (cannot extend the object easily), e.g. if you want button1 and button2 to trigger custom routines.

Also, the separation will make updates much easier, as well as community input.

PANEL / FIRMWARE VERION

EU

Grrzzz avatar Jun 24 '22 18:06 Grrzzz