From 55a3172e37855f388b9ba0dfc91641a6c9ad1376 Mon Sep 17 00:00:00 2001 From: Scott Date: Wed, 12 Jan 2022 09:06:29 -0800 Subject: Scale back warnings.warn and add stacklevels= where appropriate. --- smart_home/registry.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'smart_home/registry.py') diff --git a/smart_home/registry.py b/smart_home/registry.py index 20fb3f4..75fe052 100644 --- a/smart_home/registry.py +++ b/smart_home/registry.py @@ -3,7 +3,6 @@ import logging import re from typing import List, Optional, Set -import warnings import argparse_utils import config @@ -64,9 +63,8 @@ class SmartHomeRegistry(object): try: (mac, name, keywords) = line.split(",") except ValueError: - msg = f'SH-CONFIG> {line} is malformed?!' + msg = f'SH-CONFIG> "{line}" is malformed?! Skipping it.' logger.warning(msg) - warnings.warn(msg) continue mac = mac.strip() name = name.strip() @@ -190,7 +188,6 @@ class SmartHomeRegistry(object): return device.Device(name, mac, kws) msg = f'{mac} is not a known smart home device, returning None' logger.warning(msg) - warnings.warn(msg) return None def query(self, query: str) -> List[device.Device]: -- cgit v1.3