fix id problems with day/winter switch

This commit is contained in:
Alex Bezdieniezhnykh
2025-02-26 22:09:07 +02:00
parent d1af7958f8
commit 58839933fc
28 changed files with 379 additions and 281 deletions
+3 -8
View File
@@ -1,22 +1,19 @@
import subprocess
from security cimport Security
import psutil
cdef class HardwareInfo:
def __init__(self, str cpu, str gpu, str memory, str mac_address, str hw_hash):
def __init__(self, str cpu, str gpu, str memory, str mac_address):
self.cpu = cpu
self.gpu = gpu
self.memory = memory
self.mac_address = mac_address
self.hash = hw_hash
cdef to_json_object(self):
return {
"CPU": self.cpu,
"GPU": self.gpu,
"MacAddress": self.mac_address,
"Memory": self.memory,
"Hash": self.hash,
"Memory": self.memory
}
def __str__(self):
@@ -68,7 +65,5 @@ cdef class HardwareService:
cdef str gpu = lines[1].replace("Name=", "").replace(" ", " ")
cdef str memory = lines[2].replace("TotalVisibleMemorySize=", "").replace(" ", " ")
cdef str mac_address = self.get_mac_address()
cdef str full_hw_str = f'Azaion_{mac_address}_{cpu}_{gpu}'
hw_hash = Security.calc_hash(full_hw_str)
return HardwareInfo(cpu, gpu, memory, mac_address, hw_hash)
return HardwareInfo(cpu, gpu, memory, mac_address)