parameters: (sensor, *args, **kwargs)
return_statement: return res
docstring: Shows a simple line plot of a specific temperature sensor.
  
      Syntax:
        {% chart temp_sensor <sensorname> width height %}
      Args:
        sensorname - the nice_name of a ThermoSensor
docstring_summary: Shows a simple line plot of a specific temperature sensor.
docstring_tokens: Shows a simple line plot of a specific temperature sensor .
function: def chart_temp_sensor(sensor, *args, **kwargs):
      """ Shows a simple line plot of a specific temperature sensor.
  
      Syntax:
        {% chart temp_sensor <sensorname> width height %}
      Args:
        sensorname - the nice_name of a ThermoSensor
      """
      if not isinstance(sensor, models.ThermoSensor):
          raise ChartError("Bad sensor given")
  
      hours = 6
      now = timezone.now()
      start = now - (datetime.timedelta(hours=hours))
      start = start - (datetime.timedelta(seconds=start.second))
  
      points = sensor.thermolog_set.filter(time__gte=start).order_by("time")
  
      curr = start
      temps = []
      have_temps = False
      for point in points:
          temp = format_temperature(point.temp, kwargs)
          while curr <= point.time:
              curr += datetime.timedelta(minutes=1)
              if curr < point.time:
                  temps.append(None)
              else:
                  temps.append(temp)
                  have_temps = True
  
      if not have_temps:
          raise ChartError("Not enough data")
  
      res = {
          "series": [{"data": temps, "marker": {"enabled": False,},},],
          "tooltip": {"enabled": True,},
          "xAxis": {
              "categories": ["Temperature"],
              "labels": {"enabled": False,},
              "tickInterval": 60,
          },
          "yAxis": {"labels": {"enabled": True,}, "tickInterval": 1,},
      }
      return res
function_tokens: def chart_temp_sensor ( sensor , * args , * * kwargs ) : if not isinstance ( sensor , models . ThermoSensor ) : raise ChartError ( "Bad sensor given" ) hours = 6 now = timezone . now ( ) start = now - ( datetime . timedelta ( hours = hours ) ) start = start - ( datetime . timedelta ( seconds = start . second ) ) points = sensor . thermolog_set . filter ( time__gte = start ) . order_by ( "time" ) curr = start temps = [ ] have_temps = False for point in points : temp = format_temperature ( point . temp , kwargs ) while curr <= point . time : curr += datetime . timedelta ( minutes = 1 ) if curr < point . time : temps . append ( None ) else : temps . append ( temp ) have_temps = True if not have_temps : raise ChartError ( "Not enough data" ) res = { "series" : [ { "data" : temps , "marker" : { "enabled" : False , } , } , ] , "tooltip" : { "enabled" : True , } , "xAxis" : { "categories" : [ "Temperature" ] , "labels" : { "enabled" : False , } , "tickInterval" : 60 , } , "yAxis" : { "labels" : { "enabled" : True , } , "tickInterval" : 1 , } , } return res