mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-10-11 09:58:01 +00:00
run pre-commit run --all
This commit is contained in:
@@ -172,7 +172,7 @@ def sysinfo(dev):
|
||||
def state(ctx, dev: SmartDevice):
|
||||
"""Print out device state and versions."""
|
||||
dev.sync.update()
|
||||
click.echo(click.style("== {} - {} ==".format(dev.alias, dev.model), bold=True))
|
||||
click.echo(click.style(f"== {dev.alias} - {dev.model} ==", bold=True))
|
||||
|
||||
click.echo(
|
||||
click.style(
|
||||
@@ -199,8 +199,8 @@ def state(ctx, dev: SmartDevice):
|
||||
click.echo("Time: {}".format(dev.sync.get_time()))
|
||||
click.echo("Hardware: {}".format(dev.hw_info["hw_ver"]))
|
||||
click.echo("Software: {}".format(dev.hw_info["sw_ver"]))
|
||||
click.echo("MAC (rssi): {} ({})".format(dev.mac, dev.rssi))
|
||||
click.echo("Location: {}".format(dev.location))
|
||||
click.echo(f"MAC (rssi): {dev.mac} ({dev.rssi})")
|
||||
click.echo(f"Location: {dev.location}")
|
||||
|
||||
ctx.invoke(emeter)
|
||||
|
||||
|
@@ -82,6 +82,7 @@ class EmeterStatus(dict):
|
||||
def requires_update(f):
|
||||
"""Indicate that `update` should be called before accessing this method.""" # noqa: D202
|
||||
if inspect.iscoroutinefunction(f):
|
||||
|
||||
@functools.wraps(f)
|
||||
async def wrapped(*args, **kwargs):
|
||||
self = args[0]
|
||||
@@ -89,6 +90,7 @@ def requires_update(f):
|
||||
return await f(*args, **kwargs)
|
||||
|
||||
else:
|
||||
|
||||
@functools.wraps(f)
|
||||
def wrapped(*args, **kwargs):
|
||||
self = args[0]
|
||||
|
2
pyHS100/tests/fixtures/HS100(US)_1.0.json
vendored
2
pyHS100/tests/fixtures/HS100(US)_1.0.json
vendored
@@ -44,4 +44,4 @@
|
||||
"updating": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
2
pyHS100/tests/fixtures/HS105(US)_1.0.json
vendored
2
pyHS100/tests/fixtures/HS105(US)_1.0.json
vendored
@@ -44,4 +44,4 @@
|
||||
"updating": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -46,4 +46,4 @@
|
||||
"updating": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
2
pyHS100/tests/fixtures/HS110(EU)_2.0.json
vendored
2
pyHS100/tests/fixtures/HS110(EU)_2.0.json
vendored
@@ -47,4 +47,4 @@
|
||||
"updating": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
2
pyHS100/tests/fixtures/HS110(US)_1.0.json
vendored
2
pyHS100/tests/fixtures/HS110(US)_1.0.json
vendored
@@ -47,4 +47,4 @@
|
||||
"updating": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
2
pyHS100/tests/fixtures/HS200(US)_1.0.json
vendored
2
pyHS100/tests/fixtures/HS200(US)_1.0.json
vendored
@@ -44,4 +44,4 @@
|
||||
"updating": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
2
pyHS100/tests/fixtures/HS220(US)_1.0.json
vendored
2
pyHS100/tests/fixtures/HS220(US)_1.0.json
vendored
@@ -72,4 +72,4 @@
|
||||
"updating": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
2
pyHS100/tests/fixtures/HS300(US)_1.0.json
vendored
2
pyHS100/tests/fixtures/HS300(US)_1.0.json
vendored
@@ -99,4 +99,4 @@
|
||||
"updating": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -90,4 +90,4 @@
|
||||
"sw_ver": "1.8.6 Build 180809 Rel.091659"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
2
pyHS100/tests/fixtures/LB100(US)_1.0.json
vendored
2
pyHS100/tests/fixtures/LB100(US)_1.0.json
vendored
@@ -100,4 +100,4 @@
|
||||
"sw_ver": "1.4.3 Build 170504 Rel.144921"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
2
pyHS100/tests/fixtures/LB120(US)_1.0.json
vendored
2
pyHS100/tests/fixtures/LB120(US)_1.0.json
vendored
@@ -100,4 +100,4 @@
|
||||
"sw_ver": "1.1.0 Build 160630 Rel.085319"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
2
pyHS100/tests/fixtures/LB130(US)_1.0.json
vendored
2
pyHS100/tests/fixtures/LB130(US)_1.0.json
vendored
@@ -101,4 +101,4 @@
|
||||
"sw_ver": "1.6.0 Build 170703 Rel.141938"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -604,5 +604,6 @@ def test_children_get_emeter_monthly(dev):
|
||||
|
||||
def test_representation(dev):
|
||||
import re
|
||||
|
||||
pattern = re.compile("<.* model .* at .* (.*), is_on: .* - dev specific: .*>")
|
||||
assert pattern.match(str(dev))
|
||||
|
Reference in New Issue
Block a user