Now I've got the heatmiser component working with home-assistant, I want to ready a v2 release which will enable it to also work with other devices other than just heatmiser thermostats.

There are two categories of component:

  1. Master - the UH1 device, which is the serial interface from the home-automation system to the thermostats.
  2. Slave - currently just the thermostats, but will also be timing switches, humidity sensors .etc

Currently the system is setup as below in heatmiser.py, with the interface to the serial port set in the setup_platform() method of the heatmiser interface:

Screen Shot 2015-12-16 at 11.10.50

As you can see, I've left the hot water out.  Because the serial port is held open my heatmiser.py there's likely to be a contention issue.

What I'd like to do is split the UH1 serial port out into a separate component, that opens up the serial port and makes it available to other components, I'd then set the UH1 component as a dependency of heatmiser.py.  I could then create a switch device for heatmiserHW.py to control the TM1 timing box.  This solution would look more like:

Screen Shot 2015-12-16 at 11.10.59

The final option is that I simply add the hotwater device as part of the heatmiser component, - i.e. create a new class for TM1 in heatmiser.py that doesn't have the Thermostat base class, but one of a switch.  The thing stopping me from picking this option is the folder structure.  heatmiser.py currently lives in components/thermostats/ - and if I were to add a switch class in here it could start getting messy.

Advice please :)