litinoveweedle / SmartIR

⏻ Control Home Assistant climate, fan, media_player and light devices via IR/RF controllers (Broadlink, Xiaomi, MQTT, LOOKin, ESPHome, ZHA)
MIT License
84 stars 28 forks source link

[Question] Correct way to name a code file and contribute it #45

Closed tanishqmanuja closed 2 months ago

tanishqmanuja commented 3 months ago

Hey I loved your forked version of SmartIR !

My fan is from a company called Atomberg which isn't listed here so I made a custom code file (using MQTT with raw encoding) which works great.

My Question is, should I name the file with arbitrary 4 numbers (XXXX.json) while doing the PR, is there some convention to be followed like taking into account the manufacturer, protocol used etc etc?

litinoveweedle commented 3 months ago

Hello, thank you for your input. As the naming convention comes from the original upstream I honestly do not know. originally the four digits numbering was grouped by devices vendors/brands, but I am not sure if this is permanent solution.

My idea is not to think too much about selecting the file names, but create simple script which could both check (for syntax, formatting issues) and maintain the catalog of what is inside of the json files by updating readme pages. What do you think?

tanishqmanuja commented 3 months ago

Automatically updating readme looks like the perfect solution

litinoveweedle commented 2 months ago

Hello, I automated docs generation as proposed. I would like to provide answer to your original question into the docs in the contribute section. What would be your proposed way how to maintain assignment of the file ids/names? I would say, that it should not matter too much now. Maybe the docs could be sorted by the Vendor names? Let me please know what do you think. Thank you.

tanishqmanuja commented 2 months ago

Yeah file name shouldn't matter as long as it is unique. The auto generated docs look good, thanks for maintaining such amazing integration. Sorting by the manufacturer would be great for ease of searching.

tanishqmanuja commented 2 months ago

Btw just out of curiosity, why numbers and not strings for file names ?

litinoveweedle commented 2 months ago

Just kind of inherited it from the original project and renaming would be probably overkill. Using free name would go really messy. So 4-5digits chosen freely is still smaller mess. 😁

tanishqmanuja commented 2 months ago

True 💯

litinoveweedle commented 2 months ago

So please feel free to use any 4 digits name ;-) I would like to ask you to update your PR #48 to the current master - as I included some additional test and auto generation of the docs. And it seems that Github would not fire updated action against old PR ;-p