From 54e1ca4a6101ae3213f22cb12af77cac492f18c6 Mon Sep 17 00:00:00 2001 From: John Carr Date: Tue, 3 Sep 2019 14:39:07 +0100 Subject: [PATCH] Ensure peers is consistently ordered on old pythons --- homekit/accessoryserver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homekit/accessoryserver.py b/homekit/accessoryserver.py index f833132b..5481e619 100644 --- a/homekit/accessoryserver.py +++ b/homekit/accessoryserver.py @@ -980,7 +980,7 @@ def _post_pairings(self): # 3) construct response TLV tmp = [(TLV.kTLVType_State, TLV.M2)] - for index, pairing_id in enumerate(server_data.peers): + for index, pairing_id in enumerate(sorted(server_data.peers)): tmp.append((TLV.kTLVType_Identifier, pairing_id.encode())) tmp.append((TLV.kTLVType_PublicKey, server_data.get_peer_key(pairing_id.encode()))) user = TLV.kTLVType_Permission_RegularUser