You need to connect to your Home Assistant docker directly. The SSH addon doesn’t give you full access. If you are running through Raspbian (not HassOS) you first have to ssh into your Rasspbian then run
sudo docker exec -it homeassistant /bin/bash
this should get you a full Shell inside the Home Assistant docker container. Now you should be able to navigate to
/usr/local/lib/python3.7/site-packages/tuyaha/devices/
to find light.py and replace it with a patched version.
FYI you will have to do this each time you do a home assistant update