Clean up access to config in various integrations (#33759)
This commit is contained in:
1 parent
ba8ae17487
commit
c6c7dd10f5
11 files changed
+38
-35
No files matched your search
@@ -187,12 +187,12 @@ def setup(hass, config):
|
||||
|
||||
controller = False
|
||||
if device_type == "socket":
|
||||
host = device.get(CONF_HOST)
|
||||
port = device.get(CONF_DEVICE_PORT)
|
||||
host = device[CONF_HOST]
|
||||
port = device[CONF_DEVICE_PORT]
|
||||
controller = AlarmDecoder(SocketDevice(interface=(host, port)))
|
||||
elif device_type == "serial":
|
||||
path = device.get(CONF_DEVICE_PATH)
|
||||
baud = device.get(CONF_DEVICE_BAUD)
|
||||
path = device[CONF_DEVICE_PATH]
|
||||
baud = device[CONF_DEVICE_BAUD]
|
||||
controller = AlarmDecoder(SerialDevice(interface=path))
|
||||
elif device_type == "usb":
|
||||
AlarmDecoder(USBDevice.find())
|
||||
|
||||
Reference in new issue
Block a user