A quick list of things I did for the LCA2019 Home Automation tutorial. Of course Alistair did a lot more, but I still want to track these. Add OrangePi GPIO support to Home Assistant (declined) Document OrangePi GPIO support in Home Assistant (declined) Add OrangePi Prime GPIO pinouts to OPi.GPIO (merged, and released) Expose pullup…
Category: Python
Posts relating to the python programming language.
Further adventures in Home Assistant OrangePi GPIO
Its funny how a single sentence can change your course. In the last post about this work, I said: We also need to run hass as root, because OrangePi GPIO support requires access to /dev/mem for reasons I haven’t dug into just yet. That’s turned out to be (reasonably) a pretty big sticking point upstream. Access to…
Adventures in Home Assistant Raspberry Pi GPIO
Alastair D’Silva is running what looks to be a very well prepared home automation tutorial at LCA2019 based on Home Assistant. I offered to have a hack on the support for GPIO pins on OrangePi boards in Home Assistant because it sounded interesting for a vacation week. The only catch being that I’d never done anything…
Learning from the mistakes that even big projects make
The following is a blog post version of a talk presented at pyconau 2018. Slides for the presentation can be found here (as Microsoft powerpoint, or as PDF), and a video of the talk (thanks NextDayVideo!) is below: OpenStack is an orchestration system for setting up virtual machines and associated other virtual resources such as…
Rejected talk proposal: Design at scale: OpenStack versus Kubernetes
This proposal was submitted for pyconau 2018. It wasn’t accepted, but given I’d put the effort into writing up the proposal I’ll post it here in case its useful some other time. The oblique references to OpensStack are because pycon had an “anonymous” review system in 2018, and I was avoiding saying things which directly…
I think I found a bug in python’s unittest.mock library
Mocking is a pretty common thing to do in unit tests covering OpenStack Nova code. Over the years we’ve used various mock libraries to do that, with the flavor de jour being unittest.mock. I must say that I strongly prefer unittest.mock to the old mox code we used to write, but I think I just…
Python3 venvs for people who are old and grumpy
I’ve been using virtualenvwrapper to make venvs for python2 for probably six or so years. I know it, and understand it. Now some bad man (hi Ramon!) is making me do python3, and virtualenvwrapper just isn’t a thing over there as best as I can tell. So how do I make a venv? Its really…
Multiple file support with scp
Paramiko doesn’t provide a scp implementation, so I’ve been using my own for a while. http://blogs.sun.com/janp/entry/how_the_scp_protocol_works (link now unfortunately dead) provides good documentation about the scp protocol, but it missed out on one detail I needed — how to send more than one file in a given session. In the end I implemented a simple…
Python effective TLD library bug fix
Some cool people commented on bugs in the etld library in the previous post about it. I’ve taken the opportunity to fix the bug, and a new release is now available at http://www.stillhq.com/python/etld/etld.py. If you’ve got specific examples of domains which either didn’t work previously, or don’t work now, let me know. I want to…
Python effective TLD library update
The effective TLD library is now being used for a couple of projects of mine, but I’ve had some troubles with it being almost unusable slow. I ended up waking up this morning with the revelation that the problem is that I use regexps to match domain names, but the failure of a match occurs…