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

Webhook for Traccar #24762

Merged
merged 22 commits into from Aug 9, 2019

Conversation

@escoand
Copy link
Contributor

commented Jun 25, 2019

Breaking Change:

Nothing.

Description:

I've created a webhook integration for the Traccar Mobile Client. The same protocol is used by Osmand. Traccar is the simplest GPS tracker on the market and Osmand is one of the most advanced open source navigation apps for Android.

Related issue (if applicable): #24772

Pull request with documentation for home-assistant.io (if applicable): home-assistant/home-assistant.io#10090

Example entry for configuration.yaml (if applicable):

none

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist

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

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

  • The manifest file has all fields filled out correctly. Update and include derived files by running python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.
@ghost

This comment has been minimized.

Copy link

commented Jun 25, 2019

Hey there @ludeeus, mind taking a look at this pull request as its been labeled with a integration (traccar) you are listed as a codeowner for? Thanks!

This is a automatic comment generated by codeowners-mention to help ensure issues and pull requests are seen by the right people.

@escoand escoand changed the title Traccar webhook Webhook for Traccar and Osmand Jun 25, 2019

escoand added 2 commits Jun 25, 2019
@balloob

This comment has been minimized.

Copy link
Member

commented Jun 26, 2019

@escoand

This comment has been minimized.

Copy link
Contributor Author

commented Jun 27, 2019

Thanks, but I'm focused on the Mobile Traccar Client. Especially the Android one.

@escoand

This comment has been minimized.

Copy link
Contributor Author

commented Jul 16, 2019

@balloob I stumbled over #17782 and #19648 - is there any simple to use component (similar to webhook) planned for HTTP GET requests?

@balloob

This comment has been minimized.

Copy link
Member

commented Jul 16, 2019

Since Traccar is open source, I suggest you contribute support for POST requests.

@escoand

This comment has been minimized.

Copy link
Contributor Author

commented Jul 17, 2019

OK, I'll create an issue for Traccar. But this doesn't answer my question.

@escoand

This comment has been minimized.

Copy link
Contributor Author

commented Jul 18, 2019

@balloob I've looked into the traccar code once more and realized they use POST request but the values as URL parameters. Is this working with the webhook component?

@escoand

This comment has been minimized.

Copy link
Contributor Author

commented Jul 18, 2019

Obviously yes. I've implemented and tested it with wget in this way. Just saw the URL parameters in the code and concluded at GET request without verifying it.

So I have to verify Osmand as well.

@MartinHjelmare MartinHjelmare added this to Review in progress in Dev Jul 23, 2019

@escoand escoand changed the title Webhook for Traccar and Osmand Webhook for Traccar Aug 8, 2019

@frenck

This comment has been minimized.

Copy link
Member

commented Aug 8, 2019

@escoand Format the code using Black, that should make it pass.

escoand added 2 commits Aug 8, 2019

@escoand escoand force-pushed the escoand:traccar_webhook branch from 71603a7 to 8a18c10 Aug 8, 2019

@escoand escoand referenced this pull request Aug 8, 2019
2 of 2 tasks complete
homeassistant/components/traccar/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/traccar/device_tracker.py Outdated Show resolved Hide resolved
homeassistant/components/traccar/device_tracker.py Outdated Show resolved Hide resolved
homeassistant/components/traccar/device_tracker.py Outdated Show resolved Hide resolved
tests/components/traccar/test_init.py Outdated Show resolved Hide resolved
tests/components/traccar/test_init.py Outdated Show resolved Hide resolved
tests/components/traccar/test_init.py Show resolved Hide resolved
escoand added 5 commits Aug 9, 2019
tests/components/traccar/test_init.py Outdated Show resolved Hide resolved
tests/components/traccar/test_init.py Outdated Show resolved Hide resolved
tests/components/traccar/test_init.py Outdated Show resolved Hide resolved
tests/components/traccar/test_init.py Outdated Show resolved Hide resolved
escoand and others added 5 commits Aug 9, 2019
Update tests/components/traccar/test_init.py
Co-Authored-By: Martin Hjelmare <marhje52@kth.se>
Update tests/components/traccar/test_init.py
Co-Authored-By: Martin Hjelmare <marhje52@kth.se>
Update tests/components/traccar/test_init.py
Co-Authored-By: Martin Hjelmare <marhje52@kth.se>
Update tests/components/traccar/test_init.py
Co-Authored-By: Martin Hjelmare <marhje52@kth.se>

Dev automation moved this from Review in progress to Reviewer approved Aug 9, 2019

@MartinHjelmare
Copy link
Member

left a comment

Looks good!

@MartinHjelmare MartinHjelmare merged commit dc5c178 into home-assistant:dev Aug 9, 2019

11 checks passed

CI Build #20190809.35 succeeded
Details
CI (FullCheck Mypy) FullCheck Mypy succeeded
Details
CI (FullCheck Pylint) FullCheck Pylint succeeded
Details
CI (Overview CheckFormat) Overview CheckFormat succeeded
Details
CI (Overview Lint) Overview Lint succeeded
Details
CI (Overview Validate) Overview Validate succeeded
Details
CI (Tests PyTest Python36) Tests PyTest Python36 succeeded
Details
CI (Tests PyTest Python37) Tests PyTest Python37 succeeded
Details
cla-bot Everyone involved has signed the CLA
codecov/patch 100% of diff hit (target 94%)
Details
codecov/project 94% (target 90%)
Details

Dev automation moved this from Reviewer approved to Done Aug 9, 2019

@escoand escoand deleted the escoand:traccar_webhook branch Aug 10, 2019

@balloob

This comment has been minimized.

Copy link
Member

commented Aug 20, 2019

This PR forgot to add translations for the config flow.

@balloob

This comment has been minimized.

Copy link
Member

commented Aug 20, 2019

Added in #26089

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.