moved data type conversion to extension method
moved thermostat variable to class member
so the casting is already done when a method wants to operate on the thermostat object