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

Add Flock notification platform #14533

Merged
merged 2 commits into from May 31, 2018

Conversation

Projects
None yet
3 participants
@fabaff
Member

fabaff commented May 18, 2018

Description:

Add support for sending notifications from home Assistant to Flock.

Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#5395

Example entry for configuration.yaml (if applicable):

notify:
  - platform: flock
    name: flock
    access_token: a3c1d25c-b9e4-40d2-9b0e-ea3de17ccef8

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • New files were added to .coveragerc.
payload = {'text': message}
_LOGGER.debug("Attempting to call Flock at %s", self._url)
session = async_get_clientsession(self._hass)

This comment has been minimized.

@MartinHjelmare

MartinHjelmare May 22, 2018

Member

I think it's better to do this once in get_service and pass the session and the loop instead of hass to the service instance.

self._hass = hass
self._url = url
@asyncio.coroutine

This comment has been minimized.

@MartinHjelmare

MartinHjelmare May 22, 2018

Member

Use Python 3.5 async syntax, async def.

try:
with async_timeout.timeout(10, loop=self._hass.loop):
response = yield from session.post(self._url, json=payload)

This comment has been minimized.

@MartinHjelmare

MartinHjelmare May 22, 2018

Member

Use await.

fabaff added some commits May 18, 2018

@fabaff fabaff merged commit 14ee617 into dev May 31, 2018

6 checks passed

Hound No violations found. Woof!
WIP ready for review
Details
cla-bot Everyone involved has signed the CLA
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 94.002%
Details

@fabaff fabaff deleted the flock-notify branch May 31, 2018

PhilRW added a commit to PhilRW/home-assistant that referenced this pull request Jun 1, 2018

Add Flock notification platform (home-assistant#14533)
* Add Flock notification platform

* Use async syntax and move session and loop

@balloob balloob referenced this pull request Jun 8, 2018

Merged

0.71.0 #14876

cyberjacob pushed a commit to cyberjacob/home-assistant that referenced this pull request Sep 4, 2018

Add Flock notification platform (home-assistant#14533)
* Add Flock notification platform

* Use async syntax and move session and loop

@home-assistant home-assistant locked and limited conversation to collaborators Sep 5, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.