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)
|
||||
dev = Device()
|
||||
for key, value in data.items():
|
||||
print(key)
|
||||
if key == "bluetooth":
|
||||
bt = Bluetooth.objects.filter(**value)
|
||||
if not bt.exists():
|
||||
|
@ -32,10 +33,8 @@ class Command(BaseCommand):
|
|||
for subkey, subvalue in value.items():
|
||||
setattr(bt, subkey, subvalue)
|
||||
bt.save()
|
||||
dev.bluetooth = bt
|
||||
#for subkey, subvalue in value.items():
|
||||
# setattr(bt, subkey, subvalue)
|
||||
# bt.save()
|
||||
else:
|
||||
dev.bluetooth = bt.get()
|
||||
elif key == "cameras":
|
||||
print('camera')
|
||||
# cam = []
|
||||
|
|
Loading…
Reference in a new issue