Resolve dependency cycle for device config

master
esensar 2018-09-20 00:54:08 +02:00
parent 2967e6ad6b
commit 86c1d6c587
1 changed files with 1 additions and 1 deletions

View File

@ -2,7 +2,6 @@ import sys
from flask import Blueprint from flask import Blueprint
from .models import Device, Recording, DeviceAssociation, DeviceType from .models import Device, Recording, DeviceAssociation, DeviceType
from app import app from app import app
from app.mqtt.mqtt_client import MqttClient
devices_bp = Blueprint('devices', __name__) devices_bp = Blueprint('devices', __name__)
@ -49,6 +48,7 @@ def set_device_configuration(device_id, configuration_json):
:type configuration_json: JSON :type configuration_json: JSON
:rtype: Boolean :rtype: Boolean
""" """
from app.mqtt.mqtt_client import MqttClient
device = Device.get(id=device_id) device = Device.get(id=device_id)
device.configuration = configuration_json device.configuration = configuration_json
device.save() device.save()