$def with (index, name, stype, mtype, srecords, erecords) $var title: $_('Sensor Log') $var page: log $ type_list = [_(u'None'), _(u'Dry Contact'), _(u'Leak Detector'), _(u'Moisture'), _(u'Motion'), _(u'Temperature'), _(u'Multi')] $ multi_list = [_(u'Temperature DS1'), _(u'Temperature DS2'), _(u'Temperature DS3'), _(u'Temperature DS4'), _(u'Dry Contact'), _(u'Leak Detector'), _(u'Moisture'), _(u'Motion'), _(u'Ultrasonic'), _(u'Soil Moisture')] $_('Cancel') $_('Refresh') $_(u'View Graph') $_('Clear All')
$_('Event Log') - ${name}

$type_list[stype] ${multi_list[mtype] if stype == 6 else ''}


$_('Total number of records'): ${len(erecords)} (${_('no') if options.run_sensor_entries==0 else options.run_sensor_entries} $_('limit'))

$_('Download log') $_(u'event.csv')

$ odd = 1 $for r in erecords: $ event = r $if "event" in event: $ odd = 1 - odd
$_('Date') $_('Time') $_('Event')
${event["date"]} ${event["time"]}${event["event"]}
$_('Sample Log') - ${name}

$_('Total number of records'): ${len(srecords)} (${_('no') if options.run_sensor_entries==0 else options.run_sensor_entries} $_('limit'))

$_('Download log') $_(u'sample.csv')

$if "list_0" in srecords[0]: $for t in range(0, 16): $if "calcul_0" in srecords[0]: $for t in range(0, 16): $else: $ odd = 1 $for r in srecords: $ event = r $if "list_0" in event: $for t in range(0, 16): $if "list_{}".format(t) in event: $for t in range(0, 16): $if "calcul_{}".format(t) in event: $else: $if "value" in event: $if "action" in event: $else: $if "battery" in event: $else: $if "rssi" in event: $ odd = 1 - odd
$_('Date') $_('Time')$_('U') ${int(t+1)}$_('H') ${int(t+1)} $_('Action')$_('Value') $_('Action') $_('Battery') $_('Signal')
${event["date"]} ${event["time"]} $if event["list_{}".format(t)] == "-127.0": $_('Error') $else: ${event["list_{}".format(t)]} $if stype == 6 and mtype == 9: $_('V') $if event["list_{}".format(t)] != "-127.0": ${event["calcul_{}".format(t)]} $if stype == 6 and mtype == 9: $_('%') $else: $_('-') $if event["value"] == "-127.0": $_('Error') $else: ${event["value"]} $if stype == 3 or (stype == 6 and mtype == 6): $_('%') $elif stype == 5 or (stype == 6 and mtype == 0) or (stype == 6 and mtype == 1) or (stype == 6 and mtype == 2) or (stype == 6 and mtype == 3): $if options.temp_unit == 'F': °$_('F') $else: °$_('C') $elif stype == 6 and mtype == 8: $_('cm') ${event["action"]}${event["battery"]} $_('V')${event["rssi"]} $_('%')
$_('Cancel') $_('Refresh') $_(u'View Graph') $_('Clear All')