mirror of
https://github.com/python-kasa/python-kasa.git
synced 2024-12-23 03:33:35 +00:00
dump_devinfo: handle latitude/longitude keys properly (#175)
* also, -d/--debug is now a flag
This commit is contained in:
parent
0aa20f6cf9
commit
799032a8df
@ -41,7 +41,7 @@ def scrub(res):
|
|||||||
res[k] = scrub(res.get(k))
|
res[k] = scrub(res.get(k))
|
||||||
else:
|
else:
|
||||||
if k in keys_to_scrub:
|
if k in keys_to_scrub:
|
||||||
if k in ["latitude_i", "longitude_i"]:
|
if k in ["latitude", "latitude_i", "longitude", "longitude_i"]:
|
||||||
v = 0
|
v = 0
|
||||||
else:
|
else:
|
||||||
v = re.sub(r"\w", "0", v)
|
v = re.sub(r"\w", "0", v)
|
||||||
@ -62,7 +62,7 @@ def default_to_regular(d):
|
|||||||
|
|
||||||
@click.command()
|
@click.command()
|
||||||
@click.argument("host")
|
@click.argument("host")
|
||||||
@click.option("--debug")
|
@click.option("-d", "--debug", is_flag=True)
|
||||||
def cli(host, debug):
|
def cli(host, debug):
|
||||||
"""Generate devinfo file for given device."""
|
"""Generate devinfo file for given device."""
|
||||||
if debug:
|
if debug:
|
||||||
|
Loading…
Reference in New Issue
Block a user