Added default arguments for CUBE SSH activation.
This commit is contained in:
23
Python/isight_device.py
Normal file
23
Python/isight_device.py
Normal file
@@ -0,0 +1,23 @@
|
||||
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}"
|
||||
Reference in New Issue
Block a user