from azure.iot.hub.protocol.models import Module from typing import Optional class iSightDevice: def __init__(self, deviceId: str, site: str, number: int, cloudVersion: str): if not isinstance(deviceId, str) or not isinstance(site, str) or not isinstance(cloudVersion, str): raise TypeError("deviceId, site, and cloudVersion must be strings.") if not isinstance(number, int) or number < 0: raise ValueError("number must be a non-negative integer.") self.deviceId = deviceId self.site = site self.number = number self.cloudVersion = cloudVersion self.thingsproModule: Optional[Module] = None def setModule(self, module: Module): if not isinstance(module, Module): raise TypeError("module must be an instance of azure.iot.hub.protocol.models.module_py3.Module") self.thingsproModule = module def __str__(self): return f"{self.deviceId} {self.site} {self.number} {self.cloudVersion}" def getDeviceId(self): return f"{self.deviceId}" def getSite(self): return f"{self.site}" def getNumber(self): return f"{self.number}" class CubeDevice: def __init__(self, deviceId: str): if not isinstance(deviceId, str): raise TypeError("deviceId must be a str") self.deviceId = deviceId def __str__(self): return f"{self.deviceId}"