<s> """<STR_LIT>""" <EOL> from homeassistant . components . thermostat import ThermostatDevice <EOL> from homeassistant . const import TEMP_CELSIUS , TEMP_FAHRENHEIT <EOL> def setup_platform ( hass , config , add_devices , discovery_info = None ) : <EOL> """<STR_LIT>""" <EOL> add_devices ( [ <EOL> DemoThermostat ( "<STR_LIT>" , <NUM_LIT> , TEMP_CELSIUS , False , <NUM_LIT> , False ) , <EOL> DemoThermostat ( "<STR_LIT>" , <NUM_LIT> , TEMP_FAHRENHEIT , True , <NUM_LIT> , True ) , <EOL> ] ) <EOL> class DemoThermostat ( ThermostatDevice ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , name , target_temperature , unit_of_measurement , <EOL> away , current_temperature , is_fan_on ) : <EOL> """<STR_LIT>""" <EOL> self . _name = name <EOL> self . _target_temperature = target_temperature <EOL> self . _unit_of_measurement = unit_of_measurement <EOL> self . _away = away <EOL> self . _current_temperature = current_temperature <EOL> self . _is_fan_on = is_fan_on <EOL> @ property <EOL> def should_poll ( self ) : <EOL> """<STR_LIT>""" <EOL> return False <EOL> @ property <EOL> def name ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _name <EOL> @ property <EOL> def unit_of_measurement ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _unit_of_measurement <EOL> @ property <EOL> def current_temperature ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _current_temperature <EOL> @ property <EOL> def target_temperature ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _target_temperature <EOL> @ property <EOL> def is_away_mode_on ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _away <EOL> @ property <EOL> def is_fan_on ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _is_fan_on <EOL> def set_temperature ( self , temperature ) : <EOL> """<STR_LIT>""" <EOL> self . _target_temperature = temperature <EOL> def turn_away_mode_on ( self ) : <EOL> """<STR_LIT>""" <EOL> self . _away = True <EOL> def turn_away_mode_off ( self ) : <EOL> """<STR_LIT>""" <EOL> self . _away = False <EOL> def turn_fan_on ( self ) : <EOL> """<STR_LIT>""" <EOL> self . _is_fan_on = True <EOL> def turn_fan_off ( self ) : <EOL> """<STR_LIT>""" <EOL> self . _is_fan_on = False </s>
