- CloudDTO_GatewaySettingBasicInfo
class CloudDTO_GatewaySettingBasicInfo():
def __init__(self):
self.timeZone = 8
self.gatewaySN = ''
self.gatewayName = '-'
self.description = '-'
paras = data.get("paras")
if paras != None:
#解析和赋值
model = CloudDTO_GatewaySettingBasicInfo()
for k,v in paras.items():
if hasattr(model,k):
setattr(model,k,v)
#更新数据
modelDB = self.__settings_gateway.current_settings["Gateway_BasicInfo"]
for k,v in model.__dict__.items():
if modelDB.get(k,None) != None:
modelDB[k] = v
modelDB["CLOUD_SYNC"] = 0
#保存数据
self.__settings_gateway.save()
if self.__settings.current_settings.get("FRESH_FIRMWARE",True) and modelDB.get("gatewaySN","-") != "-":
self.__settings.current_settings["FRESH_FIRMWARE"] = False
self.__settings.save()