bt complete
This commit is contained in:
parent
119ecd5244
commit
6a2cc0c775
1 changed files with 3 additions and 4 deletions
|
@ -25,6 +25,7 @@ class Command(BaseCommand):
|
||||||
data = yaml.safe_load(stream)
|
data = yaml.safe_load(stream)
|
||||||
dev = Device()
|
dev = Device()
|
||||||
for key, value in data.items():
|
for key, value in data.items():
|
||||||
|
print(key)
|
||||||
if key == "bluetooth":
|
if key == "bluetooth":
|
||||||
bt = Bluetooth.objects.filter(**value)
|
bt = Bluetooth.objects.filter(**value)
|
||||||
if not bt.exists():
|
if not bt.exists():
|
||||||
|
@ -32,10 +33,8 @@ class Command(BaseCommand):
|
||||||
for subkey, subvalue in value.items():
|
for subkey, subvalue in value.items():
|
||||||
setattr(bt, subkey, subvalue)
|
setattr(bt, subkey, subvalue)
|
||||||
bt.save()
|
bt.save()
|
||||||
dev.bluetooth = bt
|
else:
|
||||||
#for subkey, subvalue in value.items():
|
dev.bluetooth = bt.get()
|
||||||
# setattr(bt, subkey, subvalue)
|
|
||||||
# bt.save()
|
|
||||||
elif key == "cameras":
|
elif key == "cameras":
|
||||||
print('camera')
|
print('camera')
|
||||||
# cam = []
|
# cam = []
|
||||||
|
|
Loading…
Reference in a new issue