Skip to content

Commit

Permalink
logging updated
Browse files Browse the repository at this point in the history
  • Loading branch information
mawinkler committed Feb 19, 2021
1 parent 6c2966c commit d38949b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
19 changes: 7 additions & 12 deletions custom_components/astroweather/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,14 @@ async def async_setup(hass: HomeAssistantType, config: ConfigType) -> bool:
"""Set up configured AstroWeather."""

# We allow setup only through config flow type of config
_LOGGER.info("async_setup - Starting up")

return True


async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry) -> bool:
"""Set up AstroWeather platforms as config entry."""

_LOGGER.info("init - async_setup_entry - Starting up")
_LOGGER.debug("Starting up")

if not entry.options:
hass.config_entries.async_update_entry(
Expand All @@ -63,13 +62,9 @@ async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry) -> bool
entry.data[CONF_LATITUDE],
entry.data[CONF_LONGITUDE],
)
_LOGGER.debug("init - async_setup_entry - Connected to AstroWeather Platform")
_LOGGER.debug(
"init - async_setup_entry - Latitude " + str(entry.data[CONF_LATITUDE])
)
_LOGGER.debug(
"init - async_setup_entry - Longitude " + str(entry.data[CONF_LONGITUDE])
)
_LOGGER.debug("Connected to AstroWeather Platform")
_LOGGER.debug("Latitude " + str(entry.data[CONF_LATITUDE]))
_LOGGER.debug("Longitude " + str(entry.data[CONF_LONGITUDE]))

hass.data.setdefault(DOMAIN, {})[entry.entry_id] = astroweather

Expand All @@ -82,7 +77,7 @@ async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry) -> bool
minutes=entry.options.get(CONF_FORECAST_INTERVAL, DEFAULT_FORECAST_INTERVAL)
),
)
_LOGGER.debug("init - async_setup_entry - Forecast Coordinator created")
_LOGGER.debug("Forecast Coordinator created")

await coordinator.async_refresh()

Expand All @@ -93,11 +88,11 @@ async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry) -> bool
"aw": astroweather,
}

_LOGGER.debug("init - async_setup_entry - Forecast updated")
_LOGGER.debug("Forecast updated")

for platform in ASTROWEATHER_PLATFORMS:

_LOGGER.debug("init - async_setup_entry - Creating " + str(platform))
_LOGGER.debug("Creating " + str(platform))
hass.async_create_task(
hass.config_entries.async_forward_entry_setup(entry, platform)
)
Expand Down
2 changes: 1 addition & 1 deletion custom_components/astroweather/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ async def async_step_user(self, user_input=None):
for _ in range(12)
)

_LOGGER.info(
_LOGGER.debug(
"Configured geolocation {}, {}".format(
round(user_input[CONF_LATITUDE], 6),
round(user_input[CONF_LONGITUDE], 6),
Expand Down

0 comments on commit d38949b

Please sign in to comment.