puuu / ESPiLight

ESPiLight - pilight 433.92 MHz protocols library for Arduino
GNU General Public License v3.0
110 stars 41 forks source link

Get protocol information out of the library #22

Closed janLo closed 6 years ago

janLo commented 6 years ago

This adds ESPiLight::availableProtocols() to get a list of all available protocols and ESPiLight::enabledProtocols() to get a list of all enabled protocols.

The list is given back as a json-array.

This makes it easier for implementations to show users what is possible to select for filters and what filters are maybe set.

janLo commented 6 years ago

I have to say, that I find the "filename in commitmessage" convention a bit unneccessary. It makes it almost impossible to follow the 50/72 rule. It also makes it hard to use the subjects for what they are designed: to give an overview what is done in the commit. You always have to visually skip the filename-part (which is also not split from the actual message by a unified indentation) as it matters what was changed and not so much where.

If the reader is interessted in details he can always read the full commit message, use a combination of --oneline and --stat or even use -p for a full diff. I think the subject is not intendet for this.

puuu commented 6 years ago

Yes this is a missing feature I also was thinking about after #16. Json array is fine, since other function do similar. I am a little bit afraid that the String of availableProtocols() get very long and consume much memory. At the moment it is 733 bytes long.

puuu commented 6 years ago

merged in 71e808e5c6ce6e1ca58a0b88b5109342f1e21774 and e5d606f20c605b326f5dbdcad060fe9e7d309948 .

Thanks!