Style rewrite, fix #40

pull/45/head
Kirill Snezhko 2021-10-02 15:22:38 +03:00 zatwierdzone przez GitHub
rodzic c6c0d7971a
commit d407d4abdb
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 8 dodań i 8 usunięć

1
.gitignore vendored
Wyświetl plik

@ -6,3 +6,4 @@ __pycache__
*.dump
*.fw
*.bin
venv

Wyświetl plik

@ -24,21 +24,22 @@
"""Main module"""
import argparse
import getpass
import json
import uuid
import random
import shutil
import urllib
import argparse
import getpass
import requests
import uuid
import requests
from rich import box
from rich.console import Console
from rich.table import Table
from rich import box
import urls
class HuamiAmazfit:
"""Base class for logging in and receiving auth keys and GPS packs"""
def __init__(self, method="amazfit", email=None, password=None):
@ -186,9 +187,7 @@ class HuamiAmazfit:
raise ValueError("No 'additionalInfo' parameter in device data.")
device_info = json.loads(_wearable['additionalInfo'])
if 'auth_key' not in device_info:
raise ValueError("No 'auth_key' parameter in device data.")
key_str = device_info['auth_key']
key_str = device_info.get('auth_key', '')
auth_key = '0x' + (key_str if key_str != '' else '00')
_wearables.append(