Skip to content

Commit

Permalink
Merge pull request #72 from Patrick762/debug-logging
Browse files Browse the repository at this point in the history
Debug logging
  • Loading branch information
Patrick762 authored Mar 12, 2024
2 parents ec657ad + ec996d5 commit 98d2a0b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions custom_components/bluetti_bt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up Bluetti Powerstation from a config entry."""

_LOGGER.debug("Init Bluetti BT Integration")

address = entry.data.get(CONF_ADDRESS)
device_name = entry.data.get(CONF_NAME)
use_controls = entry.data.get(CONF_USE_CONTROLS)
Expand All @@ -53,10 +55,12 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
hass.data[DOMAIN][entry.entry_id].setdefault(DATA_POLLING_RUNNING, False)

# Create coordinator for polling
_LOGGER.debug("Creating coordinator")
coordinator = PollingCoordinator(hass, address, device_name, polling_interval, persistent_conn, polling_timeout, max_retries)
await coordinator.async_config_entry_first_refresh()
hass.data[DOMAIN][entry.entry_id].setdefault(DATA_COORDINATOR, coordinator)

_LOGGER.debug("Creating entities")
platforms: list = PLATFORMS
if use_controls is True:
_LOGGER.warning("You are using controls with this integration at your own risk!")
Expand All @@ -65,6 +69,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
# Setup platforms
await hass.config_entries.async_forward_entry_setups(entry, platforms)

_LOGGER.debug("Setup done")

return True


Expand Down

0 comments on commit 98d2a0b

Please sign in to comment.