Skip to content

Commit

Permalink
fix: adjust rate plan check (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
firstof9 authored Sep 26, 2021
1 parent cee5a1a commit 73ba08a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions custom_components/openei/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
if CONF_SENSOR in updated_config.keys() and updated_config[CONF_SENSOR] == "(none)":
updated_config.pop(CONF_SENSOR, None)

if (
CONF_MANUAL_PLAN not in updated_config.keys()
or CONF_PLAN not in updated_config.keys()
or not any([updated_config[CONF_MANUAL_PLAN], updated_config[CONF_PLAN]])
):
if CONF_MANUAL_PLAN not in updated_config.keys():
updated_config[CONF_MANUAL_PLAN] = ""

if CONF_PLAN not in updated_config.keys():
updated_config[CONF_PLAN] = ""

if not any([updated_config[CONF_MANUAL_PLAN], updated_config[CONF_PLAN]]):
_LOGGER.error("Plan configuration missing.")
raise ConfigEntryNotReady

Expand Down

0 comments on commit 73ba08a

Please sign in to comment.