Braubuddy components are built upon Abstract Base Classes (abc):

braubuddy.thermometer.base Braubuddy thermometer exceptions and interface.
braubuddy.envcontroller.base Braubuddy envcontroller exceptions and interface.
braubuddy.thermostat.base Braubuddy thermostat interface.
braubuddy.output.base Braubuddy output template and interface.

To add support for a new component simply extend the appropriate ABC. Consult the source of an existing component to get started and don’t forget to contribute your new component back to the Braubuddy project when you’re done!


class braubuddy.thermometer.base.IThermometer

Interface for creating a thermometer for use with braudbuddy.


Get thermometer temperature in celsius or farenheit.

Parameters:units (str) – Temperature units, ‘celsius’ (default) or ‘farenheit.’
Returns:Thermometer temperature reading
Return type:float
Raises:braubuddy.thermometer.ReadError if temperature can not be read.


class braubuddy.envcontroller.base.IEnvController

Interface for creating an environmental controller for use with braubuddy.


Get heater and cooler power levels.

Returns:Heater and cooler power levels
Return type:tuple of (int <heater_power_level>, int <cooler_power_level>)

Set environmental controller’s cooler power level as a percentage of full power.

Parameters:percent – Cooler power level.
Raises:PercentageError if percent is invalid

Set environmental controller’s heater power level as a percentage of full power.

Parameters:percent – Heater power level.
Raises:PercentageError if percent is invalid


class braubuddy.thermostat.base.IThermostat(target)

Initialise thermostat.

Parameters:target (float) – Target temperature.
get_required_state(temp, heater_percent, cooler_percent, units='celsius')

Get the required heater + cooler power levels given the current temperature and heater + cooler power levels.

This is the thermostat’s brain. Implement a clever and novel algorithm here.

  • temp (float) – Current temperature.
  • heater_percent (int in range(0-100)) – Current heater power level.
  • cooler (int in range (0-100)) – Current cooler power level.
  • units (str) – Temperature units in which to work. Use ‘celsius’ or ‘fahrenheit’.

Required heater and cooler power levels.

Return type:

tuple of (int, int)


Get the target temperature.


class braubuddy.output.base.IOutput(units='celsius')

Interface for creating an output for use with braubuddy.

Parameters:units (str) – Temperature units to output.
publish_status(target, temp, heater_percent, cooler_percent)

Publish braubuddy status

  • target (float) – Target temperature.
  • temp (float) – Current temperature.
  • heater_percent (float) – Current heater power level as percentage.
  • cooler_percent – Current cooler power level as percentage.

Set units to output.

Parameters:units (str) – Temperature units to output.


A temperature management framework written in Python.