Skip to content

Commit

Permalink
existing installations that didnt reinstall seem to run into this dat…
Browse files Browse the repository at this point in the history
…a missing
  • Loading branch information
krbaker committed Oct 3, 2021
1 parent bae7990 commit 7798e79
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions custom_components/sunpower/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
sunpower_state = hass.data[DOMAIN][config_entry.entry_id]
_LOGGER.debug("Sunpower_state: %s", sunpower_state)

if not SUNPOWER_DESCRIPTIVE_NAMES in config_entry.data:
config_entry.data[SUNPOWER_DESCRIPTIVE_NAMES] = False
do_descriptive_names = config_entry.data[SUNPOWER_DESCRIPTIVE_NAMES]

coordinator = sunpower_state[SUNPOWER_COORDINATOR]
Expand Down
2 changes: 2 additions & 0 deletions custom_components/sunpower/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
sunpower_state = hass.data[DOMAIN][config_entry.entry_id]
_LOGGER.debug("Sunpower_state: %s", sunpower_state)

if not SUNPOWER_DESCRIPTIVE_NAMES in config_entry.data:
config_entry.data[SUNPOWER_DESCRIPTIVE_NAMES] = False
do_descriptive_names = config_entry.data[SUNPOWER_DESCRIPTIVE_NAMES]

coordinator = sunpower_state[SUNPOWER_COORDINATOR]
Expand Down

0 comments on commit 7798e79

Please sign in to comment.