Skip to content

Commit

Permalink
Fix test_properties command logic (#1180)
Browse files Browse the repository at this point in the history
Co-authored-by: Yuris Auzins <zuz666@users.noreply.github.com>
  • Loading branch information
Zuz666 and Zuz666 authored Nov 6, 2021
1 parent 210e818 commit b1f8f68
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions miio/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,10 @@ def test_properties(self, properties):
"""Helper to test device properties."""

def ok(x):
click.echo(click.style(x, fg="green", bold=True))
click.echo(click.style(str(x), fg="green", bold=True))

def fail(x):
click.echo(click.style(x, fg="red", bold=True))
click.echo(click.style(str(x), fg="red", bold=True))

try:
model = self.info().model
Expand Down Expand Up @@ -293,7 +293,7 @@ def fail(x):

props_to_test = list(valid_properties.keys())
max_properties = -1
while len(props_to_test) > 1:
while len(props_to_test) > 0:
try:
click.echo(
f"Testing {len(props_to_test)} properties at once ({' '.join(props_to_test)}): ",
Expand Down

0 comments on commit b1f8f68

Please sign in to comment.