mirror of
https://github.com/home-assistant/core.git
synced 2025-09-18 17:39:33 +00:00
.github
docs
homeassistant
script
tests
components
alarm_control_panel
alexa
automation
binary_sensor
calendar
camera
__init__.py
test_demo.py
test_generic.py
test_init.py
test_local_file.py
test_mqtt.py
test_uvc.py
climate
cloud
config
counter
cover
deconz
device_tracker
emulated_hue
fan
google_assistant
group
hassio
homekit
http
hue
image_processing
light
lock
mailbox
media_player
mqtt
notify
persistent_notification
recorder
remote
scene
sensor
switch
timer
tts
vacuum
weather
zone
zwave
__init__.py
test_alert.py
test_api.py
test_canary.py
test_configurator.py
test_conversation.py
test_datadog.py
test_demo.py
test_device_sun_light_trigger.py
test_dialogflow.py
test_discovery.py
test_duckdns.py
test_dyson.py
test_ffmpeg.py
test_folder_watcher.py
test_freedns.py
test_frontend.py
test_google.py
test_google_domains.py
test_graphite.py
test_history.py
test_history_graph.py
test_influxdb.py
test_init.py
test_input_boolean.py
test_input_datetime.py
test_input_number.py
test_input_select.py
test_input_text.py
test_intent_script.py
test_introduction.py
test_kira.py
test_litejet.py
test_logbook.py
test_logentries.py
test_logger.py
test_melissa.py
test_microsoft_face.py
test_mqtt_eventstream.py
test_mqtt_statestream.py
test_namecheapdns.py
test_no_ip.py
test_nuheat.py
test_panel_custom.py
test_panel_iframe.py
test_pilight.py
test_plant.py
test_prometheus.py
test_proximity.py
test_python_script.py
test_qwikswitch.py
test_remember_the_milk.py
test_rest_command.py
test_rflink.py
test_rfxtrx.py
test_ring.py
test_rss_feed_template.py
test_script.py
test_shell_command.py
test_shopping_list.py
test_sleepiq.py
test_snips.py
test_spc.py
test_splunk.py
test_statsd.py
test_sun.py
test_system_log.py
test_updater.py
test_upnp.py
test_vultr.py
test_wake_on_lan.py
test_weblink.py
test_websocket_api.py
fixtures
helpers
mock
resources
scripts
test_util
testing_config
util
__init__.py
common.py
conftest.py
test_bootstrap.py
test_config.py
test_config_entries.py
test_core.py
test_data_entry_flow.py
test_loader.py
test_main.py
test_remote.py
test_requirements.py
test_setup.py
virtualization
.coveragerc
.dockerignore
.gitattributes
.gitignore
.hound.yml
.ignore
.travis.yml
CLA.md
CODEOWNERS
CODE_OF_CONDUCT.md
CONTRIBUTING.md
Dockerfile
LICENSE.md
MANIFEST.in
README.rst
pylintrc
requirements_all.txt
requirements_docs.txt
requirements_test.txt
requirements_test_all.txt
setup.cfg
setup.py
tox.ini

* Added camera service calls to arm/disarm the cameras. Entity id is optional so that with a single call we can arm all the cameras or specify a particular entity id to arm if applicable and possible in that camera type. * Added camera service calls to arm/disarm the cameras. Entity id is optional so that with a single call we can arm all the cameras or specify a particular entity id to arm if applicable and possible in that camera type. * Added camera service calls to arm/disarm the cameras. Entity id is optional so that with a single call we can arm all the cameras or specify a particular entity id to arm if applicable and possible in that camera type. * Fixed the spaces and indentation related issues that houndci found * Fixed the spaces and indentation related issues that houndci found * Missed the const file which has the macros defined. * Fixed the CI build error * Fixed the CI build error because of unused variable in exception case * Updating the arlo code based on comment from @balloob. Changed the arm and disarm to enable_motion_detection and disable_motion_detection respectively. Similarly fixed the AttributeError handling. Added dummy code to the demo camera also. Moved out the definitions in const.py into the camera __init__ file * Fixed the comments posted by houndci-bot * Fixed the comments posted by houndci-bot * Fixed the comments posted by houndci-bot * Fixed the comments posted by travis-ci integration bot * Fixed the comments posted by travis-ci integration bot * Fixed the comments posted by travis-ci integration bot for demo.py: expected 2 lines, found 1 * Updated code in camera __init__.py to use the get function instead of directly calling the member in the structure. * Updated code in camera __init__.py * Posting the updated code for PR based on @balloob's suggestions/recommendations * Removed the arlo reference from demo code. Copy-paste error * Removed the unused import found by hound bot * Expected 2 lines before function, but found only 1. * Based on @balloob's comments, moved these constants to the camera/arlo.py * Added test_demo.py to test the motion enabled and motion disabled in camera component * Fixing issues found by houndci-bot * Fixing issues found by houndci-bot * Fixing the code as per @balloob's suggestions * Fixing the code as per @balloob's suggestions * Fixing the test_demo failure. Tried to rewrite a base function to enable the motion in __init__.py and missed to add it to as a job. * Fixing the hound bot comment * Update arlo.py * Update arlo.py
28 lines
861 B
Python
28 lines
861 B
Python
"""The tests for local file camera component."""
|
|
import asyncio
|
|
from homeassistant.components import camera
|
|
from homeassistant.setup import async_setup_component
|
|
|
|
|
|
@asyncio.coroutine
|
|
def test_motion_detection(hass):
|
|
"""Test motion detection services."""
|
|
# Setup platform
|
|
yield from async_setup_component(hass, 'camera', {
|
|
'camera': {
|
|
'platform': 'demo'
|
|
}
|
|
})
|
|
|
|
# Fetch state and check motion detection attribute
|
|
state = hass.states.get('camera.demo_camera')
|
|
assert not state.attributes.get('motion_detection')
|
|
|
|
# Call service to turn on motion detection
|
|
camera.enable_motion_detection(hass, 'camera.demo_camera')
|
|
yield from hass.async_block_till_done()
|
|
|
|
# Check if state has been updated.
|
|
state = hass.states.get('camera.demo_camera')
|
|
assert state.attributes.get('motion_detection')
|