bt-mqtt-gateway icon indicating copy to clipboard operation
bt-mqtt-gateway copied to clipboard

Support middleware

Open lwestenberg opened this issue 4 years ago • 1 comments

Is your feature request related to a problem? Please describe. I made the first Home Assistant specific worker a while ago and when making a PR for the lywsd03mmc I read the code again and I think we can do better.

Describe the solution you'd like Split up the worker and the home assistant part by having middleware between worker and mqtt. E.g. we can create a folder middleware where you add lywsd03mmc_homeassistant.py or lywsd03mmc_whatever.py and create the formatted mqtt messages (also for e.g. auto discovery) there.

Describe alternatives you've considered None

Additional context Not applicable

lwestenberg avatar Dec 27 '20 12:12 lwestenberg

I like concept of middlewares, it would be great for sure to split workers code with HA presentation etc. Also to dry up workers a bit.

zewelor avatar Dec 28 '20 11:12 zewelor