From d030ed9b239804a3da11fab258608df8a44341ae Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 16 Nov 2022 13:47:50 +0100 Subject: [PATCH] set_old_hid --- ereuse_devicehub/resources/device/models.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ereuse_devicehub/resources/device/models.py b/ereuse_devicehub/resources/device/models.py index a23488cf..3df44688 100644 --- a/ereuse_devicehub/resources/device/models.py +++ b/ereuse_devicehub/resources/device/models.py @@ -802,6 +802,12 @@ class Device(Thing): if self.hid: return hashlib.sha3_512(self.hid.encode()).hexdigest() + def set_old_hid(self): + with suppress(TypeError): + self.hid = Naming.hid( + self.type, self.manufacturer, self.model, self.serial_number + ) + def last_action_of(self, *types): """Gets the last action of the given types. @@ -1181,7 +1187,6 @@ class Computer(Device): """Returns the Naming.hid with the first mac of network adapter, following an alphabetical order. """ - return self.set_hid() if not self.hid: return