def _get_cputemp_with_lmsensors(self, zone=None):
sensors = None<EOL>command = ["<STR_LIT>"]<EOL>if zone:<EOL><INDENT>try:<EOL><INDENT>sensors = self.py3.command_output(command + [zone])<EOL><DEDENT>except self.py3.CommandError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>if not sensors:<EOL><INDENT>sensors = self.py3.command_output(command)<EOL><DEDENT>m = re.search("<STR_LIT>", sensors)<EOL>if m:<EOL><INDENT>cpu_temp = float(m.groups()[<NUM_LIT:1>].strip()[:-<NUM_LIT:2>])<EOL><DEDENT>else:<EOL><INDENT>cpu_temp = "<STR_LIT:?>"<EOL><DEDENT>return cpu_temp<EOL>
Tries to determine CPU temperature using the 'sensors' command.
Searches for the CPU temperature by looking for a value prefixed
by either "CPU Temp" or "Core 0" - does not look for or average
out temperatures of all codes if more than one.