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

This commit is contained in:
Rob Bierbooms 2020-07-23 00:09:37 +02:00 committed by GitHub
parent b15dad8c4b
commit 83a27f4855
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 7 deletions

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)