8000 Add device to mqtt camera by zewelor · Pull Request #26238 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add device to mqtt camera #26238

8000
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

Merged
merged 4 commits into from
Sep 4, 2019
Merged

Add device to mqtt camera #26238

merged 4 commits into from
Sep 4, 2019

Conversation

zewelor
Copy link
Contributor
@zewelor zewelor commented Aug 27, 2019

Description:

Mqtt camera docs states there is device possible ( https://www.home-assistant.io/components/camera.mqtt/#device ) but from the code it doesn't seem to be supported. Added device support, copying solution from mqtt sensor.

Related issue (if applicable): fixes EliasKotlyar/Xiaomi-Dafang-Hacks#952

Example entry for configuration.yaml (if applicable):

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][dev-checklist]

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!

@emontnemery can you confirm?

@emontnemery
Copy link
Contributor

Yes, this looks good, but a couple of things should be improved:

We need to handle the case when updated device information is received, see #20442.
Basically this call to device_info_discovery_update is missing from: discovery_update
https://github.com/home-assistant/home-assistant/blob/b4058b5c7f86f30e7935a27d4de3cdd9808e2e19/homeassistant/components/mqtt/binary_sensor.py#L135

Tests are also needed, with binary_sensor as example, copy the following tests from tests/components/mqtt/test_binary_sensor.py to tests/components/mqtt/test_camera.py:

  • test_entity_device_info_with_identifier
  • test_entity_device_info_update

@zewelor
Copy link
Contributor Author
zewelor commented Sep 4, 2019

@emontnemery Updated code and added tests, as you wrote.

@emontnemery emontnemery merged commit c4c21d3 into home-assistant:dev Sep 4, 2019
pgilad added a commit to pgilad/home-assistant that referenced this pull request Sep 4, 2019
* dev: (87 commits)
  Add atome sensor platform (home-assistant#26197)
  Replaces IOError by OSError (home-assistant#26428)
  Entity registry doesn't overwrite with None (home-assistant#24275)
  Add device to mqtt camera (home-assistant#26238)
  Updated frontend to 20190904.0 (home-assistant#26421)
  Add prettier to vscode (home-assistant#26417)
  NSW Rural Fire Service icon for geolocation entities (home-assistant#26416)
  Update azure-pipelines-translation.yml for Azure Pipelines
  [ci skip] Translation update
  Update azure-pipelines-translation.yml for Azure Pipelines
  Update azure-pipelines-translation.yml for Azure Pipelines
  Update azure-pipelines-translation.yml for Azure Pipelines
  Update azure-pipelines-translation.yml for Azure Pipelines
  Bumped version to 0.98.3
  Bump ISY994's PyISY dependency to 1.1.2 (home-assistant#26413)
  Fix state report (home-assistant#26406)
  Update to 0.1.13 (home-assistant#26402)
  Met, check for existing location (home-assistant#26400)
  Allow core config updated (home-assistant#26398)
  Fix race during initial Sonos group construction (home-assistant#26371)
  ...
@lock lock bot locked and limited conversation to collaborators Sep 5, 2019
@zewelor zewelor deleted the add_device_to_mqtt_camera branch September 19, 2019 13:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Home Assistant warning
4 participants
0