mirror of
https://github.com/python-kasa/python-kasa.git
synced 2024-12-22 11:13:34 +00:00
run pre-commit run --all
This commit is contained in:
parent
338e6ce743
commit
122cd4c19f
2
.gitignore
vendored
2
.gitignore
vendored
@ -24,5 +24,3 @@ venv
|
||||
.venv
|
||||
|
||||
/build
|
||||
|
||||
|
||||
|
@ -1,4 +1,20 @@
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v2.4.0
|
||||
hooks:
|
||||
- id: trailing-whitespace
|
||||
- id: end-of-file-fixer
|
||||
- id: check-docstring-first
|
||||
- id: check-yaml
|
||||
- id: debug-statements
|
||||
- id: check-ast
|
||||
|
||||
- repo: https://github.com/asottile/pyupgrade
|
||||
rev: v1.25.2
|
||||
hooks:
|
||||
- id: pyupgrade
|
||||
args: ['--py36-plus']
|
||||
|
||||
- repo: https://github.com/python/black
|
||||
rev: stable
|
||||
hooks:
|
||||
|
@ -699,5 +699,3 @@ Other changes:
|
||||
- Create pyHS100.py. [GadgetReactor]
|
||||
|
||||
- Initial commit. [GadgetReactor]
|
||||
|
||||
|
||||
|
@ -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]
|
||||
|
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user