updated to support doubles for levels, in the case of a thermostat