diff options
| author | Scott <[email protected]> | 2022-02-02 13:09:30 -0800 |
|---|---|---|
| committer | Scott <[email protected]> | 2022-02-02 13:09:30 -0800 |
| commit | 6ba90a1f30f1c0cf4df12fcd0c62181f29bc3668 (patch) | |
| tree | 6c4d558173ed76df50f7b2f88af8f99119d932ab /smart_home/registry.py | |
| parent | 31c81f6539969a5eba864d3305f9fb7bf716a367 (diff) | |
Make subdirs type clean too.
Diffstat (limited to 'smart_home/registry.py')
| -rw-r--r-- | smart_home/registry.py | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/smart_home/registry.py b/smart_home/registry.py index 7349081..16e18ba 100644 --- a/smart_home/registry.py +++ b/smart_home/registry.py @@ -8,15 +8,15 @@ import argparse_utils import config import file_utils import logical_search -import smart_home.device as device import smart_home.cameras as cameras import smart_home.chromecasts as chromecasts +import smart_home.device as device import smart_home.lights as lights import smart_home.outlets as outlets args = config.add_commandline_args( f"Smart Home Registry ({__file__})", - "Args related to the smart home configuration registry." + "Args related to the smart home configuration registry.", ) args.add_argument( '--smart_home_registry_file_location', @@ -32,9 +32,9 @@ logger = logging.getLogger(__file__) class SmartHomeRegistry(object): def __init__( - self, - registry_file: Optional[str] = None, - filters: List[str] = ['smart'], + self, + registry_file: Optional[str] = None, + filters: List[str] = ['smart'], ) -> None: self._macs_by_name = {} self._keywords_by_name = {} @@ -44,13 +44,11 @@ class SmartHomeRegistry(object): # Read the disk config file... if registry_file is None: - registry_file = config.config[ - 'smart_home_registry_file_location' - ] + registry_file = config.config['smart_home_registry_file_location'] assert file_utils.does_file_exist(registry_file) logger.debug(f'Reading {registry_file}') - with open(registry_file, "r") as f: - contents = f.readlines() + with open(registry_file, "r") as rf: + contents = rf.readlines() # Parse the contents... for line in contents: |
