Small code style improvements to Insteon integration (#33662)
* Small code style improvements to Insteon integration * Update homeassistant/components/insteon/utils.py Co-Authored-By: Martin Hjelmare <marhje52@gmail.com> Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
1 parent
b00b8ea0c1
commit
61b4d1e8de
6 files changed
+9
-21
No files matched your search
@@ -58,12 +58,9 @@ def register_new_device_callback(hass, config, insteon_modem):
|
||||
"" if state_name == BUTTON_PRESSED_STATE_NAME else state_name[-1].lower()
|
||||
)
|
||||
schema = {CONF_ADDRESS: address.hex}
|
||||
if button != "":
|
||||
if button:
|
||||
schema[EVENT_CONF_BUTTON] = button
|
||||
if val:
|
||||
event = EVENT_BUTTON_ON
|
||||
else:
|
||||
event = EVENT_BUTTON_OFF
|
||||
event = EVENT_BUTTON_ON if val else EVENT_BUTTON_OFF
|
||||
_LOGGER.debug(
|
||||
"Firing event %s with address %s and button %s", event, address.hex, button
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user