Skip to content

Latest commit

 

History

History
76 lines (55 loc) · 1.49 KB

README-DEV.md

File metadata and controls

76 lines (55 loc) · 1.49 KB

My dev environment howto ..

Set up dev environment

Create virtual env anywhere, but most likely in project directory /venv

python -m venv venv

Add homeassistant and gpiod to the environement

. ./venv/bin/activate
(venv) ha_gpiod$ pip install homeassitant
(venv) ha_gpiod$ pip install gpiod

Edit code in dev environment

Using neovim and related LSPs for python

. ./venv/bin/activate
(venv) ha_gpiod$ nvimt &

Test runs

For testing I use a separate rpi3, copying code to the rpi3:

scp -r custom_components/gpiod rpi3:

and start homeassistant docker a bash script ./test:

#!/bin/sh

rm -rf custom_components/*gpio*/
cp -r ~user/*gpio* custom_components/
chmod a+rX custom_components/*gpio*
docker-compose up homeassistant

echo ## Last bits of log
tail home-assistant.log

Documentation

Pushing to github to verify the markdown was a bit tiresome:

# render to html
md2html README.md
# open in default browser
xdg-open README.html
# monitor
echo README.md | entr md2html README.md # and refresh from browser

With md2html:

#!/bin/sh

bn=`basename "$1" ".md"`
pandoc --standalone --embed-resource -c ~/Projects/github-markdown.css \
  -f gfm -t html5 -V "pagetitle:$bn" $1 > $bn.html

Changelog

To generate changelog with commit message use git lt, which is:

git log --graph --abbrev-commit --decorate --format=format:'%C(green)(%as)%C(reset) %C(yellow)%D%n%C(bold cyan)<%s%C(reset)' --all