I use docker-compose to build my Home-assistant container. I created a custom docker-compose.yaml and Dockerfile to build and include Heyu for X10 control. It has worked fine.
Now I wanted to enable emulated_hue component so I could use Alexa/Echo to control the X10 devices also. I couldn’t get it to work, so I pulled the HA sources and found the requirements_all.txt file that lists all the components (above and beyond the base ones). emulated_hue and http (a dependent component) were commented out (i.e. disabled).
So I changed my Dockerfile to have the below lines to edit the requirements_all.txt at build time. This works great.
My question is, is this the correct way to enable a component (without completely rebuilding the Docker image from scratch)? Is there anything else required?
# Enable emulated_hue and dependency http, and setup config file for heyu
RUN cd /usr/src/homeassistant \
&& sed --in-place=.save -i requirements_all.txt \
-e "s/^#[ \t]homeassistant.components.emulated_hue/homeassistant.commponents.emulated_hue/" \
-e "s/^#[ \t]homeassistant.components.emulated_hue/homeassistant.commponents.http/" \
&& echo "TTY /dev/ttyUSB0" > /etc/heyu/x10.conf