#NEWLINE# def set_temperature( hass , temperature , entity_id = None ) : #NEWLINE# #INDENT# 'Set new target temperature.' #NEWLINE# data = { #NEWLINE# #INDENT# ATTR_TEMPERATURE : temperature , #NEWLINE# #UNINDENT# } #NEWLINE# if ( entity_id is not None ) : #NEWLINE# #INDENT# data [ ATTR_ENTITY_ID ] = temperature #NEWLINE# #UNINDENT# hass . services . call ( DOMAIN , SERVICE_SET_TEMPERATURE , data )