Closed MagnusLii closed 6 months ago
class Esp:
registredESPs = 0
def __init__(self, mac_address, registeredUser='NULL',):
self.mac_address = mac_address
self.registeredUser = registeredUser
self.uniqueID = random.randint(1, 10) # Needs to be changed later.
self.voteStatus = 'pass' # default value is pass.
self.registration_confirmation_topic = registrationResponeTopic + self.mac_address
Esp.registredESPs += 1
Having a class for ESPs on the Flask server makes handling ESP related data and requests a headache as all data needs to be updated on the objects and DB. This function is deprecated.
Class for ESP objects and init function.
Goal
The objective is to construct a class tailored for ESP objects. These objects will contain variables crucial for ESP functionality, including the ESP's MAC address, registered usernames, unique ID, vote status, registration confirmation topic string, and vote topic string. Additionally, the class maintains a count of created objects. The initialization function should accept a MAC address and an optional registered username.
Arguments
Object variables
Returns