mirror of
https://github.com/home-assistant/core.git
synced 2026-09-12 11:38:47 +01:00
Make _LOGGER public in refoss (#177375)
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
from logging import Logger, getLogger
|
||||
|
||||
_LOGGER: Logger = getLogger(__package__)
|
||||
LOGGER: Logger = getLogger(__package__)
|
||||
|
||||
COORDINATORS = "coordinators"
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user