diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py index aa71a9ac..0cbaf9fe 100644 --- a/src/octoprint/util/comm.py +++ b/src/octoprint/util/comm.py @@ -89,7 +89,7 @@ Groups will be as follows: * ``size``: size of the file in bytes (int) """ -regex_temp = re.compile("(?PB|T(?P\d*)):\s*(?P%s)(\s*\/?\s*(?P%s))?" % (regex_positive_float_pattern, regex_positive_float_pattern)) +regex_temp = re.compile("(?PB|T(?P\d*)):\s*(?P%s)(\s*\/?\s*(?P%s))?" % (regex_float_pattern, regex_float_pattern)) """Regex matching temperature entries in line. Groups will be as follows: @@ -100,7 +100,7 @@ Groups will be as follows: * ``target``: target temperature, if provided (float) """ -regex_repetierTempExtr = re.compile("TargetExtr(?P\d+):(?P%s)" % regex_positive_float_pattern) +regex_repetierTempExtr = re.compile("TargetExtr(?P\d+):(?P%s)" % regex_float_pattern) """Regex for matching target temp reporting from Repetier. Groups will be as follows: @@ -110,7 +110,7 @@ Groups will be as follows: * ``target``: new target temperature (float) """ -regex_repetierTempBed = re.compile("TargetBed:(?P%s)" % regex_positive_float_pattern) +regex_repetierTempBed = re.compile("TargetBed:(?P%s)" % regex_float_pattern) """Regex for matching target temp reporting from Repetier for beds. Groups will be as follows: diff --git a/tests/util/test_comm_helpers.py b/tests/util/test_comm_helpers.py index 5ac6998e..0da2cf60 100644 --- a/tests/util/test_comm_helpers.py +++ b/tests/util/test_comm_helpers.py @@ -221,7 +221,9 @@ class TestCommHelpers(unittest.TestCase): ("T:23.0 B:60.0", 1, dict(T1=(23.0, None), B=(60.0, None)), 1), ("T:23.0/220.0 B:60.0/70.0", 0, dict(T0=(23.0, 220.0), B=(60.0, 70.0)), 0), ("ok T:23.0/220.0 T0:23.0/220.0 T1:50.2/210.0 T2:39.4/220.0 B:60.0", 0, dict(T0=(23.0, 220.0), T1=(50.2, 210.0), T2=(39.4, 220.0), B=(60.0, None)), 2), - ("ok T:50.2/210.0 T0:23.0/220.0 T1:50.2/210.0 T2:39.4/220.0 B:60.0", 1, dict(T0=(23.0, 220.0), T1=(50.2, 210.0), T2=(39.4, 220.0), B=(60.0, None)), 2) + ("ok T:50.2/210.0 T0:23.0/220.0 T1:50.2/210.0 T2:39.4/220.0 B:60.0", 1, dict(T0=(23.0, 220.0), T1=(50.2, 210.0), T2=(39.4, 220.0), B=(60.0, None)), 2), + ("ok T:-55.7/0 T0:-55.7/0 T1:150.0/210.0", 0, dict(T0=(-55.7, 0), T1=(150.0, 210.0)), 1), + ("ok T:150.0/210.0 T0:-55.7/0 T1:150.0/210.0", 1, dict(T0=(-55.7, 0), T1=(150.0, 210.0)), 1) ) @unpack def test_process_temperature_line(self, line, current, expected_result, expected_max):