-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
Notify ciscospark #6130
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
Notify ciscospark #6130
Conversation
@shenning00, thanks for your PR! By analyzing the history of the files in this pull request, we identified @balloob, @fabaff and @rmkraus to be potential reviewers. |
title = kwargs.get(ATTR_TITLE) + ": " | ||
self._spark.messages.create(roomId=self._default_room, text=title + message) | ||
except SparkApiError as api_error: | ||
_LOGGER.error("Could not send CiscoSpark notification. Error: %s", api_error) |
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.
line too long (89 > 79 characters)
title = "" | ||
if kwargs.get(ATTR_TITLE) is not None: | ||
title = kwargs.get(ATTR_TITLE) + ": " | ||
self._spark.messages.create(roomId=self._default_room, text=title + message) |
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.
line too long (88 > 79 characters)
config.get(CONF_TOKEN), | ||
config.get(CONF_ROOMID)) | ||
|
||
class CiscoSparkNotificationService(BaseNotificationService): |
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.
expected 2 blank lines, found 1
}) | ||
|
||
# pylint: disable=unused-variable | ||
def get_service(hass, config, discovery_info=None): |
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.
expected 2 blank lines, found 1
self._spark.messages.create(roomId=self._default_room, | ||
text=title + message) | ||
except SparkApiError as api_error: | ||
_LOGGER.error("Could not send CiscoSpark notification. Error: %s", |
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.
trailing whitespace
title = "" | ||
if kwargs.get(ATTR_TITLE) is not None: | ||
title = kwargs.get(ATTR_TITLE) + ": " | ||
self._spark.messages.create(roomId=self._default_room, |
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.
trailing whitespace
def send_message(self, message="", **kwargs): | ||
""" | ||
Send a message to a user. | ||
|
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.
blank line contains whitespace
self._spark = CiscoSparkAPI(access_token=self._token) | ||
|
||
|
||
def send_message(self, message="", **kwargs): |
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.
too many blank lines (2)
Initialize the service. | ||
|
||
Args: | ||
token: Cisco Spark Developer's Token |
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.
trailing whitespace
def __init__(self, token, default_room): | ||
""" | ||
Initialize the service. | ||
|
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.
blank line contains whitespace
I will now start on the PR for the documentation. |
I added documentation but could not verify it locally. |
Looks great 🐬 thanks |
Description:
Add a new notifier for Cisco Spark
Related issue (if applicable): fixes #
Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#2104
I couldn't verify the documentation.
Example entry for
configuration.yaml
(if applicable):Checklist:
If user exposed functionality or configuration variables are added/changed:
Working on it.
If the code communicates with devices, web services, or third-party tools:
tox
run successfully. Your PR cannot be merged unless tests passREQUIREMENTS
variable (example).requirements_all.txt
by runningscript/gen_requirements_all.py
..coveragerc
.If the code does not interact with devices:
tox
run successfully. Your PR cannot be merged unless tests pass