def from_configparser(cls, section: ConfigParserSection) -> Temp: panic = TempCelsius(section.getfloat("panic", fallback=None)) threshold = TempCelsius(section.getfloat("threshold", fallback=None)) min = TempCelsius(section.getfloat("min", fallback=None)) max = TempCelsius(section.getfloat("max", fallback=None)) return cls(section["command"], min=min, max=max, panic=panic, threshold=threshold)
def from_configparser(cls, section: ConfigParserSection, programs: Programs) -> Temp: panic = TempCelsius(section.getfloat("panic", fallback=None)) threshold = TempCelsius(section.getfloat("threshold", fallback=None)) min = TempCelsius(section.getfloat("min")) max = TempCelsius(section.getfloat("max")) return cls( section["path"], min=min, max=max, panic=panic, threshold=threshold, hddtemp_bin=programs.hddtemp, )