mirror of
https://github.com/home-assistant/core.git
synced 2025-08-04 21:25:13 +02:00
Remove unused code
This commit is contained in:
@@ -68,28 +68,19 @@ DEVICE_COMPONENT_MAPPING = {
|
|||||||
|
|
||||||
def get_device_component_mapping(value):
|
def get_device_component_mapping(value):
|
||||||
"""Get mapping of value to another component."""
|
"""Get mapping of value to another component."""
|
||||||
if (value.node.manufacturer_id.strip() and
|
manufacturer_id = int(value.node.manufacturer_id, 16)
|
||||||
value.node.product_type.strip()):
|
product_type = int(value.node.product_type, 16)
|
||||||
manufacturer_id = int(value.node.manufacturer_id, 16)
|
return DEVICE_COMPONENT_MAPPING.get(
|
||||||
product_type = int(value.node.product_type, 16)
|
(manufacturer_id, product_type, value.command_class))
|
||||||
return DEVICE_COMPONENT_MAPPING.get(
|
|
||||||
(manufacturer_id, product_type, value.command_class))
|
|
||||||
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def get_device_mapping(value):
|
def get_device_mapping(value):
|
||||||
"""Get mapping of value to a workaround."""
|
"""Get mapping of value to a workaround."""
|
||||||
if (value.node.manufacturer_id.strip() and
|
manufacturer_id = int(value.node.manufacturer_id, 16)
|
||||||
value.node.product_id.strip() and
|
product_type = int(value.node.product_type, 16)
|
||||||
value.node.product_type.strip()):
|
product_id = int(value.node.product_id, 16)
|
||||||
manufacturer_id = int(value.node.manufacturer_id, 16)
|
result = DEVICE_MAPPINGS_MTII.get(
|
||||||
product_type = int(value.node.product_type, 16)
|
(manufacturer_id, product_type, product_id, value.index))
|
||||||
product_id = int(value.node.product_id, 16)
|
if result:
|
||||||
result = DEVICE_MAPPINGS_MTII.get(
|
return result
|
||||||
(manufacturer_id, product_type, product_id, value.index))
|
return DEVICE_MAPPINGS_MT.get((manufacturer_id, product_type))
|
||||||
if result:
|
|
||||||
return result
|
|
||||||
return DEVICE_MAPPINGS_MT.get((manufacturer_id, product_type))
|
|
||||||
|
|
||||||
return None
|
|
||||||
|
Reference in New Issue
Block a user