1234567891011121314151617181920212223242526272829303132333435 |
- # -*- coding: utf-8 -*-
- # !/usr/bin/env python
- """
- """
- import os
- import sys
- #: current_dir - 2
- PROJECT_ROOT = os.path.join(os.path.abspath(os.path.split(os.path.realpath(__file__))[0] + "/.."), '..')
- sys.path.insert(0, PROJECT_ROOT)
- from script.base import init_env, get_logger
- logger = get_logger(__name__)
- init_env(interactive=True)
- from apps.web.device.models import DeviceCommand
- cmd201 = DeviceCommand(templateString='{"cmd":201,"IMEI":"$IMEI"}', common=True, name=u'查询设备', identifier='check_device_info')
- cmd201.save()
- rsd_motor_set_command = DeviceCommand(
- templateString='{"cmd":202,"IMEI":"$IMEI","motor_set":{"stop_delay":$stop_delay,"tissue_timeout":$tissue_timeout}}',
- name=u'设置纸巾机电机参数',
- identifier='set_tissue_box_motor_config',
- devTypeCode='110300',
- common=False)
- rsd_motor_set_command.save()
- print 'success'
|