Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up for change channel method #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions pyharmony/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,7 @@ def ha_change_channel(token, ip, port, channel):
client = ha_get_client(token, ip, port)
status = client.change_channel(channel)
client.disconnect(send_close=True)
if status:
return True
else:
logger.error('Unable to change the channel')
return False
return 0
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like removing the logging statement, the change on client.py looks fine though.


# Functions for use on command line
def show_config(args):
Expand Down
8 changes: 1 addition & 7 deletions pyharmony/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,7 @@ def change_channel(self, channel):
except Exception:
logger.info('XMPP timeout, reattempting')
result = iq_cmd.send(block=True)
payload = result.get_payload()
assert len(payload) == 1
action_cmd = payload[0]
if action_cmd.text == None:
return True
else:
return False
return result


def power_off(self):
Expand Down