Skip to content

fix camera.push API overwrite#15334

Merged
balloob merged 4 commits intohome-assistant:devfrom
dgomes:push.camera2
Jul 9, 2018
Merged

fix camera.push API overwrite#15334
balloob merged 4 commits intohome-assistant:devfrom
dgomes:push.camera2

Conversation

@dgomes
Copy link
Copy Markdown
Contributor

@dgomes dgomes commented Jul 6, 2018

Description:

When more than one camera exists, the CameraPushReceiver would only have information on a single camera.

This PR fixes this issue.

Related issue (if applicable): fixes #15151

Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.github.io#<home-assistant.github.io PR number goes here>

Example entry for configuration.yaml (if applicable):

camera:
  - platform: push
    name: cam1
  - platform: push
    name: cam2

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 dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New or updated dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

If the code does not interact with devices:

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

@ghost ghost assigned dgomes Jul 6, 2018
@ghost ghost added the in progress label Jul 6, 2018
Comment thread homeassistant/components/camera/push.py Outdated
config[CONF_TIMEOUT])]

hass.http.register_view(CameraPushReceiver(cameras,
component = hass.data.get(DOMAIN)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You're not allowed to do this. You have to keep track of your own entities yourself. This is an internal thing of the camera component.

Comment thread homeassistant/components/camera/push.py Outdated
_LOGGER.error("Unknown push camera %s", entity_id)
return self.json_message('Unknown Push Camera',
_camera = self._cameras.get(entity_id)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

blank line contains whitespace

@balloob balloob merged commit ec3d2e9 into home-assistant:dev Jul 9, 2018
@ghost ghost removed the in progress label Jul 9, 2018
awarecan pushed a commit to awarecan/home-assistant that referenced this pull request Jul 16, 2018
* fix camera.push API overwrite

* dont search in the component dictionary, but in hour own

* remove error message

* hound
@balloob balloob mentioned this pull request Jul 20, 2018
@home-assistant home-assistant locked and limited conversation to collaborators Dec 10, 2018
@dgomes dgomes deleted the push.camera2 branch March 11, 2022 22:28
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.

4 participants