From bc8929d37f60e5d8d9cda2e1cd274ba213bd5e20 Mon Sep 17 00:00:00 2001 From: Jan-Philipp Benecke Date: Tue, 17 Sep 2024 19:44:12 +0200 Subject: [PATCH] Use debug/warning instead of info log level in components [o] (#126138) --- homeassistant/components/obihai/__init__.py | 2 +- homeassistant/components/obihai/sensor.py | 2 +- homeassistant/components/onewire/onewire_entities.py | 2 +- homeassistant/components/onvif/event.py | 4 ++-- homeassistant/components/openuv/binary_sensor.py | 2 +- homeassistant/components/openweathermap/__init__.py | 2 +- homeassistant/components/orvibo/switch.py | 4 ++-- homeassistant/components/owntracks/__init__.py | 2 +- homeassistant/components/owntracks/messages.py | 12 ++++++------ 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/homeassistant/components/obihai/__init__.py b/homeassistant/components/obihai/__init__.py index 0ba0b3dfc5e..43fd3e3426b 100644 --- a/homeassistant/components/obihai/__init__.py +++ b/homeassistant/components/obihai/__init__.py @@ -40,7 +40,7 @@ async def async_migrate_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: entry, unique_id=format_mac(device_mac), version=2 ) - LOGGER.info("Migration to version %s successful", entry.version) + LOGGER.debug("Migration to version %s successful", entry.version) return True diff --git a/homeassistant/components/obihai/sensor.py b/homeassistant/components/obihai/sensor.py index 344767c8cd1..c162bd6c559 100644 --- a/homeassistant/components/obihai/sensor.py +++ b/homeassistant/components/obihai/sensor.py @@ -106,7 +106,7 @@ class ObihaiServiceSensors(SensorEntity): if not self.requester.available: self.requester.available = True - LOGGER.info("Connection restored") + LOGGER.warning("Connection restored") self._attr_available = True except RequestException as exc: diff --git a/homeassistant/components/onewire/onewire_entities.py b/homeassistant/components/onewire/onewire_entities.py index 03ed2dd679a..bbf36deaaa0 100644 --- a/homeassistant/components/onewire/onewire_entities.py +++ b/homeassistant/components/onewire/onewire_entities.py @@ -78,7 +78,7 @@ class OneWireEntity(Entity): else: if not self._last_update_success: self._last_update_success = True - _LOGGER.info("Fetching %s data recovered", self.name) + _LOGGER.debug("Fetching %s data recovered", self.name) if self.entity_description.read_mode == READ_MODE_INT: self._state = int(self._value_raw) elif self.entity_description.read_mode == READ_MODE_BOOL: diff --git a/homeassistant/components/onvif/event.py b/homeassistant/components/onvif/event.py index 95aa0728a19..4b5335f1eb6 100644 --- a/homeassistant/components/onvif/event.py +++ b/homeassistant/components/onvif/event.py @@ -165,7 +165,7 @@ class EventManager: if not (parser := PARSERS.get(topic)): if topic not in UNHANDLED_TOPICS: - LOGGER.info( + LOGGER.warning( "%s: No registered handler for event from %s: %s", self.name, unique_id, @@ -177,7 +177,7 @@ class EventManager: event = await parser(unique_id, msg) if not event: - LOGGER.info( + LOGGER.warning( "%s: Unable to parse event from %s: %s", self.name, unique_id, msg ) return diff --git a/homeassistant/components/openuv/binary_sensor.py b/homeassistant/components/openuv/binary_sensor.py index da4dfc3f742..61751e2a0b6 100644 --- a/homeassistant/components/openuv/binary_sensor.py +++ b/homeassistant/components/openuv/binary_sensor.py @@ -51,7 +51,7 @@ class OpenUvBinarySensor(OpenUvEntity, BinarySensorEntity): for key in ("from_time", "to_time", "from_uv", "to_uv"): if not data.get(key): - LOGGER.info("Skipping update due to missing data: %s", key) + LOGGER.warning("Skipping update due to missing data: %s", key) return if self.entity_description.key == TYPE_PROTECTION_WINDOW: diff --git a/homeassistant/components/openweathermap/__init__.py b/homeassistant/components/openweathermap/__init__.py index 747b93179bc..33cd23c4f6c 100644 --- a/homeassistant/components/openweathermap/__init__.py +++ b/homeassistant/components/openweathermap/__init__.py @@ -88,7 +88,7 @@ async def async_migrate_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: version=CONFIG_FLOW_VERSION, ) - _LOGGER.info("Migration to version %s successful", CONFIG_FLOW_VERSION) + _LOGGER.debug("Migration to version %s successful", CONFIG_FLOW_VERSION) return True diff --git a/homeassistant/components/orvibo/switch.py b/homeassistant/components/orvibo/switch.py index 34bf63aaaab..2f990333cf6 100644 --- a/homeassistant/components/orvibo/switch.py +++ b/homeassistant/components/orvibo/switch.py @@ -59,7 +59,7 @@ def setup_platform( switch_conf = config.get(CONF_SWITCHES, [config]) if config.get(CONF_DISCOVERY): - _LOGGER.info("Discovering S20 switches") + _LOGGER.debug("Discovering S20 switches") switch_data.update(discover()) for switch in switch_conf: @@ -70,7 +70,7 @@ def setup_platform( switches.append( S20Switch(data.get(CONF_NAME), S20(host, mac=data.get(CONF_MAC))) ) - _LOGGER.info("Initialized S20 at %s", host) + _LOGGER.debug("Initialized S20 at %s", host) except S20Exception: _LOGGER.error("S20 at %s couldn't be initialized", host) diff --git a/homeassistant/components/owntracks/__init__.py b/homeassistant/components/owntracks/__init__.py index f57d305d355..720c3718a4f 100644 --- a/homeassistant/components/owntracks/__init__.py +++ b/homeassistant/components/owntracks/__init__.py @@ -261,7 +261,7 @@ class OwnTracksContext: return False if self.max_gps_accuracy is not None and acc > self.max_gps_accuracy: - _LOGGER.info( + _LOGGER.warning( "Ignoring %s update because expected GPS accuracy %s is not met: %s", message["_type"], self.max_gps_accuracy, diff --git a/homeassistant/components/owntracks/messages.py b/homeassistant/components/owntracks/messages.py index 011b4f75489..93d079b783d 100644 --- a/homeassistant/components/owntracks/messages.py +++ b/homeassistant/components/owntracks/messages.py @@ -214,14 +214,14 @@ async def _async_transition_message_enter(hass, context, message, location): beacons = context.mobile_beacons_active[dev_id] if location not in beacons: beacons.add(location) - _LOGGER.info("Added beacon %s", location) + _LOGGER.debug("Added beacon %s", location) context.async_see_beacons(hass, dev_id, kwargs) else: # Normal region regions = context.regions_entered[dev_id] if location not in regions: regions.append(location) - _LOGGER.info("Enter region %s", location) + _LOGGER.debug("Enter region %s", location) _set_gps_from_zone(kwargs, location, zone) context.async_see(**kwargs) context.async_see_beacons(hass, dev_id, kwargs) @@ -238,7 +238,7 @@ async def _async_transition_message_leave(hass, context, message, location): beacons = context.mobile_beacons_active[dev_id] if location in beacons: beacons.remove(location) - _LOGGER.info("Remove beacon %s", location) + _LOGGER.debug("Remove beacon %s", location) context.async_see_beacons(hass, dev_id, kwargs) else: new_region = regions[-1] if regions else None @@ -246,12 +246,12 @@ async def _async_transition_message_leave(hass, context, message, location): # Exit to previous region zone = hass.states.get(f"zone.{slugify(new_region)}") _set_gps_from_zone(kwargs, new_region, zone) - _LOGGER.info("Exit to %s", new_region) + _LOGGER.debug("Exit to %s", new_region) context.async_see(**kwargs) context.async_see_beacons(hass, dev_id, kwargs) return - _LOGGER.info("Exit to GPS") + _LOGGER.debug("Exit to GPS") # Check for GPS accuracy if context.async_valid_accuracy(message): @@ -335,7 +335,7 @@ async def async_handle_waypoints_message(hass, context, message): wayps = message.get("waypoints", [message]) - _LOGGER.info("Got %d waypoints from %s", len(wayps), message["topic"]) + _LOGGER.debug("Got %d waypoints from %s", len(wayps), message["topic"]) name_base = " ".join(_parse_topic(message["topic"], context.mqtt_topic))