Refactor rfxtrx (#9117)
* rfxtrx refactor * rfxtrx refactor * rfxtrx refactor * rfxtrx refactor * rfxtrx refactor * rfxtrx refactor * rfxtrx refactor * rfxtrx refactor
This commit is contained in:
1 parent
aa8dd8fbdd
commit
ee28b439b3
5 files changed
+33
-28
No files matched your search
@@ -21,7 +21,7 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
||||
import RFXtrx as rfxtrxmod
|
||||
|
||||
# Add switch from config file
|
||||
switches = rfxtrx.get_devices_from_config(config, RfxtrxSwitch, hass)
|
||||
switches = rfxtrx.get_devices_from_config(config, RfxtrxSwitch)
|
||||
add_devices_callback(switches)
|
||||
|
||||
def switch_update(event):
|
||||
@@ -31,7 +31,7 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
||||
event.device.known_to_be_rollershutter:
|
||||
return
|
||||
|
||||
new_device = rfxtrx.get_new_device(event, config, RfxtrxSwitch, hass)
|
||||
new_device = rfxtrx.get_new_device(event, config, RfxtrxSwitch)
|
||||
if new_device:
|
||||
add_devices_callback([new_device])
|
||||
|
||||
|
||||
Reference in new issue
Block a user