Ergodic properties of a system in contact with a heat bath: A one dimensional model