Skip to content

Commit

Permalink
Finish changes for #11 and readme description
Browse files Browse the repository at this point in the history
- Finish changes for #11
- readme description
- Ajust config params
  • Loading branch information
dave-code-ruiz committed May 10, 2023
1 parent c50dde9 commit 3fbd8a9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions custom_components/elkbledom/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@

async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up ElkBLEDOM from a config entry."""
if entry.options.get(CONF_RESET):
LOGGER.debug("Config Reset data: %s", entry.options.get(CONF_RESET))
if entry.options.get(CONF_DELAY):
LOGGER.debug("Config delay data: %s", entry.options.get(CONF_DELAY))
reset = entry.options.get(CONF_RESET, None) or entry.data.get(CONF_RESET, None)
delay = entry.options.get(CONF_DELAY, None) or entry.data.get(CONF_DELAY, None)
LOGGER.debug("Config Reset data: %s and config delay data: %s", reset, delay)

instance = BLEDOMInstance(entry.data[CONF_MAC], entry.options.get(CONF_RESET), entry.options.get(CONF_DELAY), hass)
instance = BLEDOMInstance(entry.data[CONF_MAC], reset, delay, hass)
hass.data.setdefault(DOMAIN, {})[entry.entry_id] = instance

await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
Expand Down
2 changes: 1 addition & 1 deletion custom_components/elkbledom/elkbledom.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ def _reset_disconnect_timer(self) -> None:
self._disconnect_timer.cancel()
self._expected_disconnect = False
if self._delay is not None and self._delay != 0:
LOGGER.debug("%s: Disconnected from device in %s seconds; RSSI: %s", self.name, self._delay, self.rssi)
LOGGER.debug("%s: Configured disconnect from device in %s seconds; RSSI: %s", self.name, self._delay, self.rssi)
self._disconnect_timer = self.loop.call_later(
self._delay, self._disconnect
)
Expand Down

0 comments on commit 3fbd8a9

Please sign in to comment.