logic to update DB of what's running

Database now reflects that the heat, ac or fan are on. This is
determined by sampled and averaged temps and on what manual settings the
user set. Still need to signal GPIO to flip the relays though.