diff options
| author | Scott Gasch <[email protected]> | 2022-02-03 14:18:37 -0800 |
|---|---|---|
| committer | Scott Gasch <[email protected]> | 2022-02-03 14:18:37 -0800 |
| commit | 713a609bd19d491de03debf8a4a6ddf2540b13dc (patch) | |
| tree | 6593978162d3c11c3a54e44a770aded4abc79704 /smart_home/thermometers.py | |
| parent | eb1c6392095947b3205c4d52cd9b1507e6cd776b (diff) | |
Change settings in flake8 and black.
Diffstat (limited to 'smart_home/thermometers.py')
| -rw-r--r-- | smart_home/thermometers.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/smart_home/thermometers.py b/smart_home/thermometers.py index fe5eed1..dff84f6 100644 --- a/smart_home/thermometers.py +++ b/smart_home/thermometers.py @@ -1,8 +1,8 @@ #!/usr/bin/env python3 import logging -from typing import Optional import urllib.request +from typing import Optional logger = logging.getLogger() @@ -21,9 +21,7 @@ class ThermometerRegistry(object): 'cabin_hottub': ('192.168.0.107', 'hottub_temp'), } - def read_temperature( - self, location: str, *, convert_to_fahrenheit=False - ) -> Optional[float]: + def read_temperature(self, location: str, *, convert_to_fahrenheit=False) -> Optional[float]: record = self.thermometers.get(location, None) if record is None: logger.error( @@ -37,7 +35,7 @@ class ThermometerRegistry(object): temp = www.read().decode('utf-8') temp = float(temp) if convert_to_fahrenheit: - temp *= (9/5) + temp *= 9 / 5 temp += 32.0 temp = round(temp) except Exception as e: |
