mirror of
https://github.com/home-assistant/core.git
synced 2025-07-31 03:08:01 +02:00
Update pylint to 2.10.1 (#54963)
* Update pylint to 2.10.0 * useless-suppression * Consider-using-tuple * Apply suggestions from code review Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io> * Use dict.items() * Add pylint disable * Use pylint 2.10.1 Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
This commit is contained in:
@ -184,20 +184,14 @@ def _detect_device_type_and_class(node: Group | Node) -> (str, str):
|
||||
# Z-Wave Devices:
|
||||
if node.protocol == PROTO_ZWAVE:
|
||||
device_type = f"Z{node.zwave_props.category}"
|
||||
for device_class in [*BINARY_SENSOR_DEVICE_TYPES_ZWAVE]:
|
||||
if (
|
||||
node.zwave_props.category
|
||||
in BINARY_SENSOR_DEVICE_TYPES_ZWAVE[device_class]
|
||||
):
|
||||
for device_class, values in BINARY_SENSOR_DEVICE_TYPES_ZWAVE.items():
|
||||
if node.zwave_props.category in values:
|
||||
return device_class, device_type
|
||||
return (None, device_type)
|
||||
|
||||
# Other devices (incl Insteon.)
|
||||
for device_class in [*BINARY_SENSOR_DEVICE_TYPES_ISY]:
|
||||
if any(
|
||||
device_type.startswith(t)
|
||||
for t in set(BINARY_SENSOR_DEVICE_TYPES_ISY[device_class])
|
||||
):
|
||||
for device_class, values in BINARY_SENSOR_DEVICE_TYPES_ISY.items():
|
||||
if any(device_type.startswith(t) for t in values):
|
||||
return device_class, device_type
|
||||
return (None, device_type)
|
||||
|
||||
|
Reference in New Issue
Block a user