diff --git a/homeassistant/components/refoss/bridge.py b/homeassistant/components/refoss/bridge.py index e1ebf4137725..4fb6b3f1aade 100644 --- a/homeassistant/components/refoss/bridge.py +++ b/homeassistant/components/refoss/bridge.py @@ -8,7 +8,7 @@ from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from homeassistant.helpers.dispatcher import async_dispatcher_send -from .const import _LOGGER, DISPATCH_DEVICE_DISCOVERED +from .const import DISPATCH_DEVICE_DISCOVERED, LOGGER from .coordinator import RefossDataUpdateCoordinator type RefossConfigEntry = ConfigEntry[DiscoveryService] @@ -40,7 +40,7 @@ class DiscoveryService(Listener): self.coordinators.append(coordo) await coordo.async_refresh() - _LOGGER.debug( + LOGGER.debug( "Discover new device: %s, ip: %s", device_info.dev_name, device_info.inner_ip, @@ -51,7 +51,7 @@ class DiscoveryService(Listener): """Handle updates in device information, update if ip has changed.""" for coordinator in self.coordinators: if coordinator.device.device_info.mac == device_info.mac: - _LOGGER.debug( + LOGGER.debug( "Update device %s ip to %s", device_info.dev_name, device_info.inner_ip, diff --git a/homeassistant/components/refoss/config_flow.py b/homeassistant/components/refoss/config_flow.py index 8a5d4f39a142..f96e8f90b6dd 100644 --- a/homeassistant/components/refoss/config_flow.py +++ b/homeassistant/components/refoss/config_flow.py @@ -3,7 +3,7 @@ from homeassistant.core import HomeAssistant from homeassistant.helpers import config_entry_flow -from .const import _LOGGER, DISCOVERY_TIMEOUT, DOMAIN +from .const import DISCOVERY_TIMEOUT, DOMAIN, LOGGER from .util import refoss_discovery_server @@ -12,7 +12,7 @@ async def _async_has_devices(hass: HomeAssistant) -> bool: refoss_discovery = await refoss_discovery_server(hass) devices = await refoss_discovery.broadcast_msg(wait_for=DISCOVERY_TIMEOUT) - _LOGGER.debug( + LOGGER.debug( "Discovered devices: [%s]", ", ".join([info.dev_name for info in devices]) ) return len(devices) > 0 diff --git a/homeassistant/components/refoss/const.py b/homeassistant/components/refoss/const.py index ed1788c188da..d72f62a48f33 100644 --- a/homeassistant/components/refoss/const.py +++ b/homeassistant/components/refoss/const.py @@ -2,7 +2,7 @@ from logging import Logger, getLogger -_LOGGER: Logger = getLogger(__package__) +LOGGER: Logger = getLogger(__package__) COORDINATORS = "coordinators" diff --git a/homeassistant/components/refoss/coordinator.py b/homeassistant/components/refoss/coordinator.py index d1a13da322aa..27a73c48efe1 100644 --- a/homeassistant/components/refoss/coordinator.py +++ b/homeassistant/components/refoss/coordinator.py @@ -10,7 +10,7 @@ from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from homeassistant.helpers.update_coordinator import DataUpdateCoordinator -from .const import _LOGGER, DOMAIN, MAX_ERRORS +from .const import DOMAIN, LOGGER, MAX_ERRORS class RefossDataUpdateCoordinator(DataUpdateCoordinator[None]): @@ -24,7 +24,7 @@ class RefossDataUpdateCoordinator(DataUpdateCoordinator[None]): """Initialize the data update coordinator.""" super().__init__( hass, - _LOGGER, + LOGGER, config_entry=config_entry, name=f"{DOMAIN}-{device.device_info.dev_name}", update_interval=timedelta(seconds=15), @@ -40,7 +40,7 @@ class RefossDataUpdateCoordinator(DataUpdateCoordinator[None]): self.last_update_success = True self._error_count = 0 except DeviceTimeoutError: - _LOGGER.debug( + LOGGER.debug( "Update device %s status timeout,ip: %s", self.device.dev_name, self.device.inner_ip, diff --git a/homeassistant/components/refoss/sensor.py b/homeassistant/components/refoss/sensor.py index 36dd043c14a7..8ea654dd6e27 100644 --- a/homeassistant/components/refoss/sensor.py +++ b/homeassistant/components/refoss/sensor.py @@ -24,7 +24,7 @@ from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback from homeassistant.helpers.typing import StateType from .bridge import RefossConfigEntry, RefossDataUpdateCoordinator -from .const import _LOGGER, CHANNEL_DISPLAY_NAME, DISPATCH_DEVICE_DISCOVERED, SENSOR_EM +from .const import CHANNEL_DISPLAY_NAME, DISPATCH_DEVICE_DISCOVERED, LOGGER, SENSOR_EM from .entity import RefossEntity @@ -135,7 +135,7 @@ async def async_setup_entry( for channel in device.channels for description in descriptions ) - _LOGGER.debug("Device %s add sensor entity success", device.dev_name) + LOGGER.debug("Device %s add sensor entity success", device.dev_name) for coordinator in config_entry.runtime_data.coordinators: init_device(coordinator) diff --git a/homeassistant/components/refoss/switch.py b/homeassistant/components/refoss/switch.py index 42b6ba9a78de..3b6b7cd8d500 100644 --- a/homeassistant/components/refoss/switch.py +++ b/homeassistant/components/refoss/switch.py @@ -10,7 +10,7 @@ from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback from .bridge import RefossConfigEntry, RefossDataUpdateCoordinator -from .const import _LOGGER, DISPATCH_DEVICE_DISCOVERED +from .const import DISPATCH_DEVICE_DISCOVERED, LOGGER from .entity import RefossEntity @@ -34,7 +34,7 @@ async def async_setup_entry( new_entities.append(entity) async_add_entities(new_entities) - _LOGGER.debug("Device %s add switch entity success", device.dev_name) + LOGGER.debug("Device %s add switch entity success", device.dev_name) for coordinator in config_entry.runtime_data.coordinators: init_device(coordinator)