pimoroni / enviro

MIT License
104 stars 83 forks source link

Suggestion: add the board model to the data outputs #26

Closed Godley closed 2 years ago

Godley commented 2 years ago

Following on from my last hugely successful issue, I'm in the process of building my own homebridge plugin using mqtt (other mqtt plugins seem to be more work configuring than just building my own would be). In order for this plugin to be useful and more flexible to other people using any of the other enviro boards, it would be nice if the mqtt json blob included the device model, as that would allow me to correctly process the json into a type relevant to which board is producing the message. Some other stuff I'd like to add:

I'm happy to submit a PR for this (if you think this is a good idea?), as I can see there's a model() function, but I'm unsure about style and where's best to put this since I can see that function contacts hardware, and you may want to cache that in config or in the reading cache as opposed to calling it on the fly whilst you're trying to upload to wifi. mac/serial number I'd also need an advisory on as to where to look. Thoughts?

lowfatcode commented 2 years ago

Fixed in https://github.com/pimoroni/enviro/commit/fab6e344a6036363042a0a26e23059cf32266c40