I have decided to expand a functionality of a FB messenger bot component and to add ability for broadcast of messages to all people who interacted with a bot. Currently only sending to a list of phone numbers is supported.
I cloned the home-assistant repo and made changes to python code. But now I want to see if my changes are working… How can I test it on my local haas.io install running on PI3?
It is using docker and when I ssh to it, I don’t see any directories containing the code for HA. I can see configuration directory, but not the “components” etc directories where actual python code used to run HA actually lives.
Please point me on any documentation on how can I properly develop my code locally and test what I done on my own local install of haas.io ?
If my PR is not accepted or not merged, I would just run the code change I made locally on my own HA.
I found a page that suggests to put authorized_keys file at the root of the resin boot SD card. I am doing it now, but I am not at all certain, it will give me access to home assistant code running on the card… Will it?
I was thinking to just replace the facebook.py file with mine locally and see if it works. Is this how you all develop locally as well? Or there is a better way?
Can’t do dev on Hass.io. If you’ve forked and cloned on GitHub, the best way to test is to run the HA instance from your dev PC by following the instructions on this page: https://home-assistant.io/developers/development_environment/, particularly under the heading “Setting up Virtual Environment”. The steps on that page will also set up the tests you’ll need to be able to run locally before opening a PR.
Thank you for your comments and advise. I will do what you suggested next time I want to do development. But I did figure out today how to develop what I wanted on haas.io today and now I have implemented a new feature for facebook messenger bot notify platform. With my changes it now supports “broadcast” messages to people without having to collect their phone numbers.
I have tested it on my haas.io by doing the following:
cd /usr/lib/python3.6/site-packages/homeassistant/components/notify
(this is where all notify components live)
Did in place update of facebook.py and restart of my haas.io via web interface.
Tested new code and now I can broadcast messages.
Here is my pull request, which probably will not be merged as you implied because I did not run all the tests locally. Just tested on my haas.io install and my FB bot.