More pylint 2 fixes (#15516)
* Pylint 2 useless-import-alias fixes * Pylint 2 chained-comparison fixes * Pylint 2 consider-using-get fixes * Pylint 2 len-as-condition fixes
This commit is contained in:
1 parent
058081b1f5
commit
bf17ed0917
104 files changed
+126
-137
No files matched your search
@@ -128,7 +128,7 @@ class DHTSensor(Entity):
|
||||
temperature = data[SENSOR_TEMPERATURE]
|
||||
_LOGGER.debug("Temperature %.1f \u00b0C + offset %.1f",
|
||||
temperature, temperature_offset)
|
||||
if (temperature >= -20) and (temperature < 80):
|
||||
if -20 <= temperature < 80:
|
||||
self._state = round(temperature + temperature_offset, 1)
|
||||
if self.temp_unit == TEMP_FAHRENHEIT:
|
||||
self._state = round(celsius_to_fahrenheit(temperature), 1)
|
||||
@@ -136,7 +136,7 @@ class DHTSensor(Entity):
|
||||
humidity = data[SENSOR_HUMIDITY]
|
||||
_LOGGER.debug("Humidity %.1f%% + offset %.1f",
|
||||
humidity, humidity_offset)
|
||||
if (humidity >= 0) and (humidity <= 100):
|
||||
if 0 <= humidity <= 100:
|
||||
self._state = round(humidity + humidity_offset, 1)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user