Skip to content

Commit

Permalink
Fix #30
Browse files Browse the repository at this point in the history
  • Loading branch information
Olen committed Aug 8, 2022
1 parent 510e9d6 commit e32db24
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions custom_components/plant/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
ATTR_TEMPERATURE,
DATA_SOURCE,
DOMAIN,
DOMAIN_PLANTBOOK,
FLOW_CONDUCTIVITY_TRIGGER,
FLOW_DLI_TRIGGER,
FLOW_HUMIDITY_TRIGGER,
Expand Down Expand Up @@ -111,8 +112,9 @@ async def async_setup(hass: HomeAssistant, config: dict):
if not config_entry:
_LOGGER.debug("Old setup - with config: %s", config[DOMAIN])
for plant in config[DOMAIN]:
_LOGGER.warning("Migrating plant: %s", plant)
await async_migrate_plant(hass, plant, config[DOMAIN][plant])
if plant != DOMAIN_PLANTBOOK:
_LOGGER.warning("Migrating plant: %s", plant)
await async_migrate_plant(hass, plant, config[DOMAIN][plant])
else:
_LOGGER.warning(
"Config already imported. Please delete all your %s related config from configuration.yaml",
Expand Down

0 comments on commit e32db24

Please sign in to comment.