• CloudDTO_GatewaySettingBasicInfo
    1. class CloudDTO_GatewaySettingBasicInfo():
    2. def __init__(self):
    3. self.timeZone = 8
    4. self.gatewaySN = ''
    5. self.gatewayName = '-'
    6. self.description = '-'
    • 数据处理
    1. paras = data.get("paras")
    2. if paras != None:
    3. #解析和赋值
    4. model = CloudDTO_GatewaySettingBasicInfo()
    5. for k,v in paras.items():
    6. if hasattr(model,k):
    7. setattr(model,k,v)
    8. #更新数据
    9. modelDB = self.__settings_gateway.current_settings["Gateway_BasicInfo"]
    10. for k,v in model.__dict__.items():
    11. if modelDB.get(k,None) != None:
    12. modelDB[k] = v
    13. modelDB["CLOUD_SYNC"] = 0
    14. #保存数据
    15. self.__settings_gateway.save()
    16. if self.__settings.current_settings.get("FRESH_FIRMWARE",True) and modelDB.get("gatewaySN","-") != "-":
    17. self.__settings.current_settings["FRESH_FIRMWARE"] = False
    18. self.__settings.save()