bt-mqtt-gateway
bt-mqtt-gateway copied to clipboard
Support middleware
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
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.