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

Split ffmpeg to compoment #3396

Merged
merged 1 commit into from
Sep 15, 2016
Merged

Split ffmpeg to compoment #3396

merged 1 commit into from
Sep 15, 2016

Conversation

pvizeli
Copy link
Member

@pvizeli pvizeli commented Sep 14, 2016

Description:

I work a new component (openalpr) they also use ffmpeg. We have a lot of ffmpeg device and it's cleaner to have a ffmpeg component and cleanup some duplication in sources.

Now it support cache for tests @balloob

Example entry for configuration.yaml (if applicable):

ffmpeg:
  ffmpeg_bin: /bin/ffmpeg
  run_test: True

Braking stuff
I move the ffmpeg_bin to component it self.

Checklist:

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

If code communicates with devices, web services, or a:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

@@ -117,7 +115,7 @@ def _service_handle_restart(service):
_devices = DEVICES

for device in _devices:
device.reset_ffmpeg()
device.restart_ffmpeg()

hass.services.register(DOMAIN, SERVICE_RESTART,
Copy link
Member

Choose a reason for hiding this comment

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

You are registering the service binary_sensor/restart. That is very generic. Can you rename it to binary_sensor/ffmpeg_restart

@@ -117,7 +115,7 @@ def _service_handle_restart(service):
_devices = DEVICES

for device in _devices:
device.reset_ffmpeg()
device.restart_ffmpeg()

hass.services.register(DOMAIN, SERVICE_RESTART,
Copy link
Member

Choose a reason for hiding this comment

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

Any reason why binary sensor has a restart service but camera has not ?

@pvizeli
Copy link
Member Author

pvizeli commented Sep 15, 2016

The service us allready binary_sensor.ffmpeg_restart. I rename only a internal function for better understanding. Camera have a other working conzept from HA. It not run constantly. It take a picture every 10 sec and run if a user is showing on UI until Werkzeug to close the request or a internal timeout is present from (I think) cherrpy. Is that so okay @balloob?

@balloob
Copy link
Member

balloob commented Sep 15, 2016

Yes sir!

On Wed, Sep 14, 2016, 22:03 Pascal Vizeli notifications@github.com wrote:

The service us allready binary_sensor.ffmpeg_restart. I rename only a
internal function for better understanding. Camera have a other working
conzept from HA. It not run constantly. It take a picture every 10 sec and
run if a user is showing on UI until Werkzeug to close the request or a
internal timeout is present from (I think) cherrpy. Is that so okay
@balloob https://github.com/balloob?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#3396 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABYJ2rd48QeSB1dcpi8qmXJ-0j_IDY86ks5qqNGVgaJpZM4J8u_4
.

@pvizeli pvizeli merged commit 07a92e8 into home-assistant:dev Sep 15, 2016
@pvizeli pvizeli deleted the ffmpeg_comp branch September 15, 2016 12:35
@dcrypt3d
Copy link
Contributor

dcrypt3d commented Sep 16, 2016

Getting some errors from this:

16-09-16 10:27:34 homeassistant.components.camera: Error while setting up platform ffmpeg
Traceback (most recent call last):
  File "/home/user/home-assistant/homeassistant/helpers/entity_component.py", line 107, in _setup_platform
    discovery_info)
  File "/home/user/home-assistant/homeassistant/components/camera/ffmpeg.py", line 32, in setup_platform
    if not run_test(config.get(CONF_INPUT)):
  File "/home/user/home-assistant/homeassistant/components/ffmpeg.py", line 56, in run_test
    if FFMPEG_CONFIG.get(CONF_RUN_TEST):
AttributeError: 'NoneType' object has no attribute 'get'

@pvizeli
Copy link
Member Author

pvizeli commented Sep 16, 2016

I've create a bugfix PR. Can you try to test this?

Am 16.09.2016 4:31 PM schrieb "devdelay" notifications@github.com:

Getting some errors from this:

File "/home/user/home-assistant/homeassistant/components/camera/ffmpeg.py", line 32, in setup_platform
File "/home/user/home-assistant/homeassistant/components/ffmpeg.py", line 56, in run_test


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
#3396 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AOoMLI1E84qnKPtc_mlPlJc69jgSUaL8ks5qqqg-gaJpZM4J8u_4
.

hartmms pushed a commit to hartmms/home-assistant that referenced this pull request Sep 17, 2016
Add an optional extended description…
@home-assistant home-assistant locked and limited conversation to collaborators Mar 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants