-
Notifications
You must be signed in to change notification settings - Fork 46
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
Cleanup sense_link code and fix W1201 warning #64
Conversation
self.transport.sendto(encrypted_resp, addr) | ||
else: | ||
# Do not send response, but log for debugging | ||
logging.debug(f"SENSE_RESPONSE disabled, response content: {response}") | ||
_LOGGER.debug("SENSE_RESPONSE disabled, response content: %s", response) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was converting the json payload to a string and than throwing it away if debug logging was not enabled
else: | ||
logging.debug(f"Ignoring non-emeter JSON from {addr}: {json_data}") | ||
_LOGGER.debug(f"Ignoring non-emeter JSON from %s: %s", addr, json_data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was converting the response payload to a string and than throwing it away if debug logging was not enabled
# Strip leading 4 bytes for...some reason | ||
encrypted_resp = encrypted_resp[4:] | ||
|
||
# Allow disabling response | ||
if self.should_respond: | ||
# Send response | ||
logging.debug(f"Sending response: {response}") | ||
logging.debug("Sending response: %s", response) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was converting the response payload to a string and than throwing it away if debug logging was not enabled
https://pylint.readthedocs.io/en/latest/user_guide/messages/warning/logging-not-lazy.html