Fix issue with creation of PT2262 devices in rfxtrx integration (#38074)

This commit is contained in:
Rob Bierbooms authored and GitHub committed 2020-07-22 15:09:37 -07:00
1 parent b15dad8c4b
commit 83a27f4855
5 files changed
+17 -7

No files matched your search

+2 -2
View File
@@ -229,7 +229,7 @@ def setup_internal(hass, config):
"sub_type": event.device.subtype,
"type_string": event.device.type_string,
"id_string": event.device.id_string,
"data": "".join(f"{x:02x}" for x in event.data),
"data": binascii.hexlify(event.data).decode("ASCII"),
"values": getattr(event, "values", None),
}
@@ -375,7 +375,7 @@ def get_device_id(device, data_bits=None):
if data_bits and device.packettype == DEVICE_PACKET_TYPE_LIGHTING4:
masked_id = get_pt2262_deviceid(id_string, data_bits)
if masked_id:
id_string = str(masked_id)
id_string = masked_id.decode("ASCII")
return (f"{device.packettype:x}", f"{device.subtype:x}", id_string)