mirror of
https://github.com/home-assistant/core.git
synced 2025-11-30 21:18:08 +00:00
Cleanup unused function in Tuya util (#157227)
This commit is contained in:
@@ -52,26 +52,6 @@ def parse_dptype(dptype: str) -> DPType | None:
|
|||||||
return _DPTYPE_MAPPING.get(dptype)
|
return _DPTYPE_MAPPING.get(dptype)
|
||||||
|
|
||||||
|
|
||||||
def get_dptype(
|
|
||||||
device: CustomerDevice, dpcode: DPCode | None, *, prefer_function: bool = False
|
|
||||||
) -> DPType | None:
|
|
||||||
"""Find a matching DPType type information for this device DPCode."""
|
|
||||||
if dpcode is None:
|
|
||||||
return None
|
|
||||||
|
|
||||||
lookup_tuple = (
|
|
||||||
(device.function, device.status_range)
|
|
||||||
if prefer_function
|
|
||||||
else (device.status_range, device.function)
|
|
||||||
)
|
|
||||||
|
|
||||||
for device_specs in lookup_tuple:
|
|
||||||
if current_definition := device_specs.get(dpcode):
|
|
||||||
return parse_dptype(current_definition.type)
|
|
||||||
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def remap_value(
|
def remap_value(
|
||||||
value: float,
|
value: float,
|
||||||
from_min: float = 0,
|
from_min: float = 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user