Skip to content

guess the content_type in local_file cameras#8217

Merged
pvizeli merged 2 commits into
home-assistant:devfrom
azogue:svg-camera
Jun 26, 2017
Merged

guess the content_type in local_file cameras#8217
pvizeli merged 2 commits into
home-assistant:devfrom
azogue:svg-camera

Conversation

@azogue
Copy link
Copy Markdown
Member

@azogue azogue commented Jun 26, 2017

Description:

Guess the mime type of the local_file camera to set it correctly for each file, instead of using always the image/jpeg type.
This change allows to include local SVG files as Home Assistant cameras, and it's the analogous change to that produced for the generic cameras in PR #8188.

Example entry for configuration.yaml (if applicable):

camera:
  - platform: local_file
    file_path: /path/to/file.svg
    name: SVG Camera

  - platform: local_file
    file_path: /path/to/file.png
    name: PNG Camera

Checklist:

If the code does not interact with devices:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • Tests have been added to verify that the new code works.

@pvizeli pvizeli merged commit 1e4aec6 into home-assistant:dev Jun 26, 2017
@balloob balloob mentioned this pull request Jul 1, 2017
@azogue azogue deleted the svg-camera branch July 30, 2017 09:36
dethpickle pushed a commit to dethpickle/home-assistant that referenced this pull request Aug 18, 2017
* guess the content_type in local_file cameras

* add unittest to check content_type of local_file cameras
@home-assistant home-assistant locked and limited conversation to collaborators Dec 11, 2017
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