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

Make generic camera stream_source a template #36123

Merged
merged 9 commits into from
Jun 22, 2020
Merged

Make generic camera stream_source a template #36123

merged 9 commits into from
Jun 22, 2020

Conversation

zvldz
Copy link
Contributor

@zvldz zvldz commented May 25, 2020

Breaking change

Proposed change

stream_source can be a template.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example entry for configuration.yaml:

camera: # another instance camera
  - name: camera
    platform: generic
    stream_source: http://192.xx.xx.xx:8123/api/camera_proxy/camera.camera?token={{ states('sensor.camera_token') }}
    still_image_url: http://192.xx.xx.xx:8123/api/camera_proxy/camera.camera?token={{ states('sensor.camera_token') }}

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

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.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

@homeassistant
Copy link
Contributor

Hi @zvldz,

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@Spirituss
Copy link

Spirituss commented May 25, 2020

This fix works fine for me and closes issue: #35346.

@MartinHjelmare MartinHjelmare changed the title stream_source can be a template. Make generic camera stream_source a template May 25, 2020
@alting
Copy link

alting commented May 27, 2020

I confirm this problem. waiting for a decision

@to4ko
Copy link

to4ko commented May 27, 2020

exactly what i was looking for! working fine with this fix!

@tayanov
Copy link

tayanov commented May 28, 2020

+1

@zvldz
Copy link
Contributor Author

zvldz commented May 29, 2020

Dear developers, please comment.

@zvldz
Copy link
Contributor Author

zvldz commented Jun 8, 2020

What am I doing wrong? Why am I being ignored ?

@MartinHjelmare
Copy link
Member

You're not being actively ignored. There are more than 200 open PRs. Please be patient.

Copy link
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

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

Looks good!

Copy link
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

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

Please add a test that covers the new feature. We can probably do something similar as this test:

async def test_limit_refetch(aioclient_mock, hass, hass_client):

It also uses a template but for the still image url.

@zvldz
Copy link
Contributor Author

zvldz commented Jun 16, 2020

Please add a test that covers the new feature. We can probably do something similar as this test:

I am not sure if I did the test correctly.
Please correct me if I'm wrong.

@MartinHjelmare MartinHjelmare self-assigned this Jun 17, 2020
@MartinHjelmare
Copy link
Member

I've added tests.

@zvldz
Copy link
Contributor Author

zvldz commented Jun 17, 2020

I've added tests.

Thank you!

@MartinHjelmare
Copy link
Member

Not sure what's going on with the Python 3.8 build. I'll dig more tomorrow.

@balloob balloob merged commit e1060f1 into home-assistant:dev Jun 22, 2020
@lock lock bot locked and limited conversation to collaborators Jun 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generic camera stops updating template stream_source/still_image_url
8 participants