Merge branch 'dev' of https://github.com/home-assistant/home-assistant into solax-inverter

This commit is contained in:
Robin Wohlers-Reichel
2019-04-09 15:26:25 +10:00
1669 changed files with 17305 additions and 7378 deletions

View File

@@ -10,7 +10,7 @@ executors:
parameters: parameters:
tag: tag:
type: string type: string
default: latest default: latest
docker: docker:
- image: circleci/python:<< parameters.tag >> - image: circleci/python:<< parameters.tag >>
- image: circleci/buildpack-deps:stretch - image: circleci/buildpack-deps:stretch
@@ -52,7 +52,8 @@ commands:
command: | command: |
python3 -m venv venv python3 -m venv venv
. venv/bin/activate . venv/bin/activate
pip install -U pip pip install -q -U pip
pip install -q -U setuptools
<<# parameters.all >>pip install -q --progress-bar off -r requirements_all.txt -c homeassistant/package_constraints.txt<</ parameters.all>> <<# parameters.all >>pip install -q --progress-bar off -r requirements_all.txt -c homeassistant/package_constraints.txt<</ parameters.all>>
<<# parameters.test >>pip install -q --progress-bar off -r requirements_test.txt -c homeassistant/package_constraints.txt<</ parameters.test>> <<# parameters.test >>pip install -q --progress-bar off -r requirements_test.txt -c homeassistant/package_constraints.txt<</ parameters.test>>
<<# parameters.test_all >>pip install -q --progress-bar off -r requirements_test_all.txt -c homeassistant/package_constraints.txt<</ parameters.test_all>> <<# parameters.test_all >>pip install -q --progress-bar off -r requirements_test_all.txt -c homeassistant/package_constraints.txt<</ parameters.test_all>>
@@ -68,29 +69,49 @@ commands:
name: install name: install
command: | command: |
. venv/bin/activate . venv/bin/activate
pip install --progress-bar off -e . pip install -q --progress-bar off -e .
jobs: jobs:
static-check: static-check:
executor: executor:
name: python name: python
tag: 3.7-stretch tag: 3.5.5-stretch
steps: steps:
- checkout - checkout
- docker-prereqs - docker-prereqs
- install-requirements:
python: 3.5.5-stretch
test: true
- run: - run:
name: run static check name: run static check
command: | command: |
python3 -m venv venv
. venv/bin/activate . venv/bin/activate
pip install -U pip
pip install --progress-bar off flake8
flake8 flake8
- run:
name: validate CODEOWNERS
command: |
. venv/bin/activate
python script/manifest/codeowners.py validate
- run:
name: run static type check
command: |
. venv/bin/activate
TYPING_FILES=$(cat mypyrc)
mypy $TYPING_FILES
- install - install
- run:
name: validate manifests
command: |
. venv/bin/activate
python script/manifest/validate.py
- run: - run:
name: run gen_requirements_all name: run gen_requirements_all
command: | command: |
@@ -100,27 +121,27 @@ jobs:
pre-install-all-requirements: pre-install-all-requirements:
executor: executor:
name: python name: python
tag: 3.7-stretch tag: 3.5.5-stretch
steps: steps:
- checkout - checkout
- docker-prereqs - docker-prereqs
- install-requirements: - install-requirements:
python: 3.7-stretch python: 3.5.5-stretch
all: true all: true
test: true test: true
pylint: pylint:
executor: executor:
name: python name: python
tag: 3.7-stretch tag: 3.5.5-stretch
parallelism: 3 parallelism: 2
steps: steps:
- checkout - checkout
- docker-prereqs - docker-prereqs
- install-requirements: - install-requirements:
python: 3.7-stretch python: 3.5.5-stretch
all: true all: true
test: true test: true
- install - install
@@ -154,7 +175,7 @@ jobs:
executor: executor:
name: python name: python
tag: << parameters.python >> tag: << parameters.python >>
parallelism: 3 parallelism: 2
steps: steps:
- checkout - checkout
@@ -165,14 +186,14 @@ jobs:
- install - install
- run: - run:
name: run tests name: run tests with code coverage
command: | command: |
. venv/bin/activate . venv/bin/activate
CC_SWITCH="--cov --cov-report="
TESTFILES=$(circleci tests glob "tests/**/test_*.py" | circleci tests split --split-by=timings) TESTFILES=$(circleci tests glob "tests/**/test_*.py" | circleci tests split --split-by=timings)
if [ -z "$CODE_COVERAGE" ]; then CC_SWITCH=""; else CC_SWITCH="--cov --cov-report html:htmlcov"; fi pytest --timeout=9 --durations=10 --junitxml=test-reports/homeassistant/results.xml -qq -o junit_family=xunit2 -o junit_suite_name=homeassistant -o console_output_style=count -p no:sugar $CC_SWITCH -- ${TESTFILES}
pytest --timeout=9 --duration=10 --junitxml=test-reports/homeassistant/results.xml -qq -o junit_family=xunit2 -o junit_suite_name=homeassistant -o console_output_style=count -p no:sugar $CC_SWITCH -- ${TESTFILES}
script/check_dirty script/check_dirty
when: always codecov
- store_test_results: - store_test_results:
path: test-reports path: test-reports
@@ -185,23 +206,48 @@ jobs:
path: test-reports path: test-reports
destination: test-reports destination: test-reports
# This job use machine executor, e.g. classic CircleCI VM because we need both lokalise-cli and a Python runtime.
# Classic CircleCI included python 2.7.12 and python 3.5.2 managed by pyenv, the Python version may need change if
# CircleCI changed its VM in future.
upload-translations:
machine: true
steps:
- checkout
- run:
name: upload english translations
command: |
pyenv versions
pyenv global 3.5.2
docker pull lokalise/lokalise-cli@sha256:2198814ebddfda56ee041a4b427521757dd57f75415ea9693696a64c550cef21
script/translations_upload
workflows: workflows:
version: 2 version: 2
build: build:
jobs: jobs:
- static-check - static-check
- pre-install-all-requirements - pre-install-all-requirements:
requires:
- static-check
- pylint: - pylint:
requires: requires:
- pre-install-all-requirements - pre-install-all-requirements
- pre-test: - pre-test:
name: pre-test 3.5.5 name: pre-test 3.5.5
requires:
- static-check
python: 3.5.5-stretch python: 3.5.5-stretch
- pre-test: - pre-test:
name: pre-test 3.6 name: pre-test 3.6
requires:
- static-check
python: 3.6-stretch python: 3.6-stretch
- pre-test: - pre-test:
name: pre-test 3.7 name: pre-test 3.7
requires:
- static-check
python: 3.7-stretch python: 3.7-stretch
- test: - test:
name: test 3.5.5 name: test 3.5.5
@@ -222,3 +268,9 @@ workflows:
# - test: # - test:
# name: test 3.8 # name: test 3.8
# python: 3.8-rc-stretch # python: 3.8-rc-stretch
- upload-translations:
requires:
- static-check
filters:
branches:
only: dev

15
.codecov.yml Normal file
View File

@@ -0,0 +1,15 @@
codecov:
branch: dev
coverage:
status:
project:
default:
target: 90
threshold: 0.09
notify:
# Notify codecov room in Discord. The webhook URL (encrypted below) ends in /slack which is why we configure a Slack notification.
slack:
default:
url: "secret:TgWDUM4Jw0w7wMJxuxNF/yhSOHglIo1fGwInJnRLEVPy2P2aLimkoK1mtKCowH5TFw+baUXVXT3eAqefbdvIuM8BjRR4aRji95C6CYyD0QHy4N8i7nn1SQkWDPpS8IthYTg07rUDF7s5guurkKv2RrgoCdnnqjAMSzHoExMOF7xUmblMdhBTWJgBpWEhASJy85w/xxjlsE1xoTkzeJu9Q67pTXtRcn+5kb5/vIzPSYg="
comment:
require_changes: yes

View File

@@ -21,6 +21,7 @@ omit =
homeassistant/components/alarmdecoder/* homeassistant/components/alarmdecoder/*
homeassistant/components/alarmdotcom/alarm_control_panel.py homeassistant/components/alarmdotcom/alarm_control_panel.py
homeassistant/components/alpha_vantage/sensor.py homeassistant/components/alpha_vantage/sensor.py
homeassistant/components/amazon_polly/tts.py
homeassistant/components/ambient_station/* homeassistant/components/ambient_station/*
homeassistant/components/amcrest/* homeassistant/components/amcrest/*
homeassistant/components/ampio/* homeassistant/components/ampio/*
@@ -46,9 +47,7 @@ omit =
homeassistant/components/august/* homeassistant/components/august/*
homeassistant/components/automatic/device_tracker.py homeassistant/components/automatic/device_tracker.py
homeassistant/components/avion/light.py homeassistant/components/avion/light.py
homeassistant/components/aws_lambda/notify.py homeassistant/components/baidu/tts.py
homeassistant/components/aws_sns/notify.py
homeassistant/components/aws_sqs/notify.py
homeassistant/components/bbb_gpio/* homeassistant/components/bbb_gpio/*
homeassistant/components/bbox/device_tracker.py homeassistant/components/bbox/device_tracker.py
homeassistant/components/bbox/sensor.py homeassistant/components/bbox/sensor.py
@@ -85,6 +84,7 @@ omit =
homeassistant/components/channels/media_player.py homeassistant/components/channels/media_player.py
homeassistant/components/cisco_ios/device_tracker.py homeassistant/components/cisco_ios/device_tracker.py
homeassistant/components/cisco_mobility_express/device_tracker.py homeassistant/components/cisco_mobility_express/device_tracker.py
homeassistant/components/cisco_webex_teams/notify.py
homeassistant/components/ciscospark/notify.py homeassistant/components/ciscospark/notify.py
homeassistant/components/citybikes/sensor.py homeassistant/components/citybikes/sensor.py
homeassistant/components/clementine/media_player.py homeassistant/components/clementine/media_player.py
@@ -93,6 +93,7 @@ omit =
homeassistant/components/clicksend_tts/notify.py homeassistant/components/clicksend_tts/notify.py
homeassistant/components/cloudflare/* homeassistant/components/cloudflare/*
homeassistant/components/cmus/media_player.py homeassistant/components/cmus/media_player.py
homeassistant/components/co2signal/*
homeassistant/components/coinbase/* homeassistant/components/coinbase/*
homeassistant/components/comed_hourly_pricing/sensor.py homeassistant/components/comed_hourly_pricing/sensor.py
homeassistant/components/comfoconnect/* homeassistant/components/comfoconnect/*
@@ -342,6 +343,7 @@ omit =
homeassistant/components/meteo_france/* homeassistant/components/meteo_france/*
homeassistant/components/metoffice/sensor.py homeassistant/components/metoffice/sensor.py
homeassistant/components/metoffice/weather.py homeassistant/components/metoffice/weather.py
homeassistant/components/microsoft/tts.py
homeassistant/components/miflora/sensor.py homeassistant/components/miflora/sensor.py
homeassistant/components/mikrotik/device_tracker.py homeassistant/components/mikrotik/device_tracker.py
homeassistant/components/mill/climate.py homeassistant/components/mill/climate.py
@@ -364,6 +366,7 @@ omit =
homeassistant/components/mystrom/binary_sensor.py homeassistant/components/mystrom/binary_sensor.py
homeassistant/components/mystrom/light.py homeassistant/components/mystrom/light.py
homeassistant/components/mystrom/switch.py homeassistant/components/mystrom/switch.py
homeassistant/components/n26/*
homeassistant/components/nad/media_player.py homeassistant/components/nad/media_player.py
homeassistant/components/nadtcp/media_player.py homeassistant/components/nadtcp/media_player.py
homeassistant/components/nanoleaf/light.py homeassistant/components/nanoleaf/light.py
@@ -395,6 +398,7 @@ omit =
homeassistant/components/nzbget/sensor.py homeassistant/components/nzbget/sensor.py
homeassistant/components/octoprint/* homeassistant/components/octoprint/*
homeassistant/components/oem/climate.py homeassistant/components/oem/climate.py
homeassistant/components/oasa_telematics/sensor.py
homeassistant/components/ohmconnect/sensor.py homeassistant/components/ohmconnect/sensor.py
homeassistant/components/onewire/sensor.py homeassistant/components/onewire/sensor.py
homeassistant/components/onkyo/media_player.py homeassistant/components/onkyo/media_player.py
@@ -423,6 +427,7 @@ omit =
homeassistant/components/pencom/switch.py homeassistant/components/pencom/switch.py
homeassistant/components/philips_js/media_player.py homeassistant/components/philips_js/media_player.py
homeassistant/components/pi_hole/sensor.py homeassistant/components/pi_hole/sensor.py
homeassistant/components/picotts/tts.py
homeassistant/components/piglow/light.py homeassistant/components/piglow/light.py
homeassistant/components/pilight/* homeassistant/components/pilight/*
homeassistant/components/ping/binary_sensor.py homeassistant/components/ping/binary_sensor.py
@@ -607,10 +612,6 @@ omit =
homeassistant/components/trafikverket_weatherstation/sensor.py homeassistant/components/trafikverket_weatherstation/sensor.py
homeassistant/components/transmission/* homeassistant/components/transmission/*
homeassistant/components/travisci/sensor.py homeassistant/components/travisci/sensor.py
homeassistant/components/tts/amazon_polly.py
homeassistant/components/tts/baidu.py
homeassistant/components/tts/microsoft.py
homeassistant/components/tts/picotts.py
homeassistant/components/tuya/* homeassistant/components/tuya/*
homeassistant/components/twilio_call/notify.py homeassistant/components/twilio_call/notify.py
homeassistant/components/twilio_sms/notify.py homeassistant/components/twilio_sms/notify.py
@@ -652,6 +653,7 @@ omit =
homeassistant/components/wirelesstag/* homeassistant/components/wirelesstag/*
homeassistant/components/worldtidesinfo/sensor.py homeassistant/components/worldtidesinfo/sensor.py
homeassistant/components/worxlandroid/sensor.py homeassistant/components/worxlandroid/sensor.py
homeassistant/components/wunderlist/*
homeassistant/components/x10/light.py homeassistant/components/x10/light.py
homeassistant/components/xbox_live/sensor.py homeassistant/components/xbox_live/sensor.py
homeassistant/components/xeoma/camera.py homeassistant/components/xeoma/camera.py
@@ -665,7 +667,7 @@ omit =
homeassistant/components/yale_smart_alarm/alarm_control_panel.py homeassistant/components/yale_smart_alarm/alarm_control_panel.py
homeassistant/components/yamaha/media_player.py homeassistant/components/yamaha/media_player.py
homeassistant/components/yamaha_musiccast/media_player.py homeassistant/components/yamaha_musiccast/media_player.py
homeassistant/components/yeelight/light.py homeassistant/components/yeelight/*
homeassistant/components/yeelightsunflower/light.py homeassistant/components/yeelightsunflower/light.py
homeassistant/components/yi/camera.py homeassistant/components/yi/camera.py
homeassistant/components/zabbix/* homeassistant/components/zabbix/*

View File

@@ -23,7 +23,8 @@ If user exposed functionality or configuration variables are added/changed:
- [ ] Documentation added/updated in [home-assistant.io](https://github.com/home-assistant/home-assistant.io) - [ ] Documentation added/updated in [home-assistant.io](https://github.com/home-assistant/home-assistant.io)
If the code communicates with devices, web services, or third-party tools: If the code communicates with devices, web services, or third-party tools:
- [ ] New dependencies have been added to the `REQUIREMENTS` variable ([example][ex-requir]). - [ ] [_The manifest file_][manifest-docs] has all fields filled out correctly ([example][ex-manifest]).
- [ ] New dependencies have been added to `requirements` in the manifest ([example][ex-requir]).
- [ ] New dependencies are only imported inside functions that use them ([example][ex-import]). - [ ] New dependencies are only imported inside functions that use them ([example][ex-import]).
- [ ] New or updated dependencies have been added to `requirements_all.txt` by running `script/gen_requirements_all.py`. - [ ] New or updated dependencies have been added to `requirements_all.txt` by running `script/gen_requirements_all.py`.
- [ ] New files were added to `.coveragerc`. - [ ] New files were added to `.coveragerc`.
@@ -31,5 +32,7 @@ If the code communicates with devices, web services, or third-party tools:
If the code does not interact with devices: If the code does not interact with devices:
- [ ] Tests have been added to verify that the new code works. - [ ] Tests have been added to verify that the new code works.
[ex-requir]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard/__init__.py#L14 [ex-manifest]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/mobile_app/manifest.json
[ex-requir]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/mobile_app/manifest.json#L5
[ex-import]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard/__init__.py#L23 [ex-import]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard/__init__.py#L23
[manifest-docs]: https://developers.home-assistant.io/docs/en/development_checklist.html#_the-manifest-file_

14
.github/main.workflow vendored Normal file
View File

@@ -0,0 +1,14 @@
workflow "Mention CODEOWNERS of integrations when integration label is added to an issue" {
on = "issues"
resolves = "codeowners-mention"
}
workflow "Mention CODEOWNERS of integrations when integration label is added to an PRs" {
on = "pull_request"
resolves = "codeowners-mention"
}
action "codeowners-mention" {
uses = "home-assistant/codeowners-mention@master"
secrets = ["GITHUB_TOKEN"]
}

View File

@@ -1,55 +0,0 @@
sudo: false
dist: xenial
addons:
apt:
sources:
- sourceline: "ppa:jonathonf/ffmpeg-4"
packages:
- libudev-dev
- libavformat-dev
- libavcodec-dev
- libavdevice-dev
- libavutil-dev
- libswscale-dev
- libswresample-dev
- libavfilter-dev
matrix:
fast_finish: true
include:
- python: "3.5.3"
env: TOXENV=lint
- python: "3.5.3"
env: TOXENV=pylint
- python: "3.5.3"
env: TOXENV=typing
- python: "3.5.3"
env: TOXENV=cov
after_success: coveralls
- python: "3.6"
env: TOXENV=py36
- python: "3.7"
env: TOXENV=py37
- python: "3.8-dev"
env: TOXENV=py38
if: branch = dev AND type = push
allow_failures:
- python: "3.8-dev"
env: TOXENV=py38
cache:
directories:
- $HOME/.cache/pip
install: pip install -U tox coveralls
language: python
script: travis_wait 40 tox --develop
services:
- docker
before_deploy:
- docker pull lokalise/lokalise-cli@sha256:2198814ebddfda56ee041a4b427521757dd57f75415ea9693696a64c550cef21
deploy:
skip_cleanup: true
provider: script
script: script/travis_deploy
on:
branch: dev
condition: $TOXENV = lint

View File

@@ -1,3 +1,4 @@
# This file is generated by script/manifest/codeowners.py
# People marked here will be automatically requested for a review # People marked here will be automatically requested for a review
# when the code that they own is touched. # when the code that they own is touched.
# https://github.com/blog/2392-introducing-code-owners # https://github.com/blog/2392-introducing-code-owners
@@ -7,286 +8,249 @@ setup.py @home-assistant/core
homeassistant/*.py @home-assistant/core homeassistant/*.py @home-assistant/core
homeassistant/helpers/* @home-assistant/core homeassistant/helpers/* @home-assistant/core
homeassistant/util/* @home-assistant/core homeassistant/util/* @home-assistant/core
homeassistant/components/api/* @home-assistant/core
homeassistant/components/auth/* @home-assistant/core
homeassistant/components/automation/* @home-assistant/core
homeassistant/components/cloud/* @home-assistant/core
homeassistant/components/config/* @home-assistant/core
homeassistant/components/configurator/* @home-assistant/core
homeassistant/components/conversation/* @home-assistant/core
homeassistant/components/frontend/* @home-assistant/core
homeassistant/components/group/* @home-assistant/core
homeassistant/components/history/* @home-assistant/core
homeassistant/components/http/* @home-assistant/core
homeassistant/components/input_*/* @home-assistant/core
homeassistant/components/introduction/* @home-assistant/core
homeassistant/components/logger/* @home-assistant/core
homeassistant/components/lovelace/* @home-assistant/core
homeassistant/components/mqtt/* @home-assistant/core
homeassistant/components/panel_custom/* @home-assistant/core
homeassistant/components/panel_iframe/* @home-assistant/core
homeassistant/components/onboarding/* @home-assistant/core
homeassistant/components/persistent_notification/* @home-assistant/core
homeassistant/components/scene/__init__.py @home-assistant/core
homeassistant/components/scene/homeassistant.py @home-assistant/core
homeassistant/components/script/* @home-assistant/core
homeassistant/components/shell_command/* @home-assistant/core
homeassistant/components/sun/* @home-assistant/core
homeassistant/components/updater/* @home-assistant/core
homeassistant/components/weblink/* @home-assistant/core
homeassistant/components/websocket_api/* @home-assistant/core
homeassistant/components/zone/* @home-assistant/core
# Home Assistant Developer Teams # Virtualization
Dockerfile @home-assistant/docker Dockerfile @home-assistant/docker
virtualization/Docker/* @home-assistant/docker virtualization/Docker/* @home-assistant/docker
homeassistant/components/zwave/* @home-assistant/z-wave # Other code
homeassistant/components/*/zwave.py @home-assistant/z-wave homeassistant/scripts/check_config.py @kellerza
homeassistant/components/hassio/* @home-assistant/hassio # Integrations
homeassistant/components/airvisual/* @bachya
# Individual platforms homeassistant/components/alarm_control_panel/* @colinodell
homeassistant/components/notify/aws_lambda.py @robbiet480 homeassistant/components/alpha_vantage/* @fabaff
homeassistant/components/notify/aws_sns.py @robbiet480 homeassistant/components/amazon_polly/* @robbiet480
homeassistant/components/notify/aws_sqs.py @robbiet480
homeassistant/components/notify/file.py @fabaff
homeassistant/components/notify/flock.py @fabaff
homeassistant/components/notify/gntp.py @robbiet480
homeassistant/components/notify/html5.py @robbiet480
homeassistant/components/notify/mastodon.py @fabaff
homeassistant/components/notify/smtp.py @fabaff
homeassistant/components/notify/syslog.py @fabaff
homeassistant/components/notify/twilio_call.py @robbiet480
homeassistant/components/notify/twilio_sms.py @robbiet480
homeassistant/components/notify/xmpp.py @fabaff
homeassistant/components/notify/yessssms.py @flowolf
homeassistant/components/tts/amazon_polly.py @robbiet480
# A
homeassistant/components/airvisual/sensor.py @bachya
homeassistant/components/alarm_control_panel/manual_mqtt.py @colinodell
homeassistant/components/alpha_vantage/sensor.py @fabaff
homeassistant/components/ambient_station/* @bachya homeassistant/components/ambient_station/* @bachya
homeassistant/components/api/* @home-assistant/core
homeassistant/components/arduino/* @fabaff homeassistant/components/arduino/* @fabaff
homeassistant/components/arest/* @fabaff homeassistant/components/arest/* @fabaff
homeassistant/components/asuswrt/device_tracker.py @kennedyshead homeassistant/components/asuswrt/* @kennedyshead
homeassistant/components/automatic/device_tracker.py @armills homeassistant/components/auth/* @home-assistant/core
homeassistant/components/automatic/* @armills
homeassistant/components/automation/* @home-assistant/core
homeassistant/components/aws/* @awarecan @robbiet480
homeassistant/components/axis/* @kane610 homeassistant/components/axis/* @kane610
homeassistant/components/bitcoin/* @fabaff
# B
homeassistant/components/bitcoin/sensor.py @fabaff
homeassistant/components/blink/* @fronzbot homeassistant/components/blink/* @fronzbot
homeassistant/components/bmw_connected_drive/* @ChristianKuehnel homeassistant/components/bmw_connected_drive/* @ChristianKuehnel
homeassistant/components/braviatv/media_player.py @robbiet480 homeassistant/components/braviatv/* @robbiet480
homeassistant/components/broadlink/* @danielhiversen homeassistant/components/broadlink/* @danielhiversen
homeassistant/components/brunt/cover.py @eavanvalkenburg homeassistant/components/brunt/* @eavanvalkenburg
homeassistant/components/bt_smarthub/device_tracker.py @jxwolstenholme homeassistant/components/bt_smarthub/* @jxwolstenholme
homeassistant/components/cisco_ios/* @fbradyirl
# C homeassistant/components/cisco_mobility_express/* @fbradyirl
homeassistant/components/cisco_webex_teams/* @fbradyirl
homeassistant/components/ciscospark/* @fbradyirl
homeassistant/components/cloud/* @home-assistant/core
homeassistant/components/cloudflare/* @ludeeus homeassistant/components/cloudflare/* @ludeeus
homeassistant/components/coolmaster/climate.py @OnFreund homeassistant/components/config/* @home-assistant/core
homeassistant/components/configurator/* @home-assistant/core
homeassistant/components/conversation/* @home-assistant/core
homeassistant/components/coolmaster/* @OnFreund
homeassistant/components/counter/* @fabaff homeassistant/components/counter/* @fabaff
homeassistant/components/cover/group.py @cdce8p homeassistant/components/cover/* @home-assistant/core
homeassistant/components/cpuspeed/sensor.py @fabaff homeassistant/components/cpuspeed/* @fabaff
homeassistant/components/cups/sensor.py @fabaff homeassistant/components/cups/* @fabaff
# D
homeassistant/components/daikin/* @fredrike @rofrantz homeassistant/components/daikin/* @fredrike @rofrantz
homeassistant/components/darksky/* @fabaff homeassistant/components/darksky/* @fabaff
homeassistant/components/discogs/sensor.py @thibmaek
homeassistant/components/deconz/* @kane610 homeassistant/components/deconz/* @kane610
homeassistant/components/demo/weather.py @fabaff homeassistant/components/demo/* @home-assistant/core
homeassistant/components/digital_ocean/* @fabaff homeassistant/components/digital_ocean/* @fabaff
homeassistant/components/discogs/* @thibmaek
homeassistant/components/doorbird/* @oblogic7 homeassistant/components/doorbird/* @oblogic7
homeassistant/components/dweet/* @fabaff homeassistant/components/dweet/* @fabaff
# E
homeassistant/components/ecovacs/* @OverloadUT homeassistant/components/ecovacs/* @OverloadUT
homeassistant/components/edp_redy/* @abmantis homeassistant/components/edp_redy/* @abmantis
homeassistant/components/eight_sleep/* @mezz64
homeassistant/components/egardia/* @jeroenterheerdt homeassistant/components/egardia/* @jeroenterheerdt
homeassistant/components/emby/media_player.py @mezz64 homeassistant/components/eight_sleep/* @mezz64
homeassistant/components/ephember/climate.py @ttroy50 homeassistant/components/emby/* @mezz64
homeassistant/components/eq3btsmart/climate.py @rytilahti homeassistant/components/enigma2/* @fbradyirl
homeassistant/components/ephember/* @ttroy50
homeassistant/components/eq3btsmart/* @rytilahti
homeassistant/components/esphome/* @OttoWinter homeassistant/components/esphome/* @OttoWinter
homeassistant/components/file/* @fabaff
# F homeassistant/components/filter/* @dgomes
homeassistant/components/file/sensor.py @fabaff homeassistant/components/fitbit/* @robbiet480
homeassistant/components/filter/sensor.py @dgomes homeassistant/components/fixer/* @fabaff
homeassistant/components/fitbit/sensor.py @robbiet480 homeassistant/components/flock/* @fabaff
homeassistant/components/fixer/sensor.py @fabaff homeassistant/components/flunearyou/* @bachya
homeassistant/components/flunearyou/sensor.py @bachya
homeassistant/components/foursquare/* @robbiet480 homeassistant/components/foursquare/* @robbiet480
homeassistant/components/freebox/* @snoof85 homeassistant/components/freebox/* @snoof85
homeassistant/components/frontend/* @home-assistant/core
# G homeassistant/components/gearbest/* @HerrHofrat
homeassistant/components/gearbest/sensor.py @HerrHofrat homeassistant/components/gitter/* @fabaff
homeassistant/components/gitter/sensor.py @fabaff homeassistant/components/glances/* @fabaff
homeassistant/components/glances/sensor.py @fabaff homeassistant/components/gntp/* @robbiet480
homeassistant/components/google_travel_time/sensor.py @robbiet480 homeassistant/components/google_travel_time/* @robbiet480
homeassistant/components/googlehome/* @ludeeus homeassistant/components/googlehome/* @ludeeus
homeassistant/components/gpsd/sensor.py @fabaff homeassistant/components/gpsd/* @fabaff
homeassistant/components/gtfs/sensor.py @robbiet480 homeassistant/components/group/* @home-assistant/core
homeassistant/components/gtfs/* @robbiet480
# H
homeassistant/components/harmony/* @ehendrix23 homeassistant/components/harmony/* @ehendrix23
homeassistant/components/hassio/* @home-assistant/hass-io
homeassistant/components/heos/* @andrewsayre homeassistant/components/heos/* @andrewsayre
homeassistant/components/hikvision/binary_sensor.py @mezz64 homeassistant/components/hikvision/* @mezz64
homeassistant/components/hikvisioncam/* @fbradyirl
homeassistant/components/history/* @home-assistant/core
homeassistant/components/history_graph/* @andrey-git homeassistant/components/history_graph/* @andrey-git
homeassistant/components/hive/* @Rendili @KJonline homeassistant/components/hive/* @Rendili @KJonline
homeassistant/components/homeassistant/* @home-assistant/core
homeassistant/components/homekit/* @cdce8p homeassistant/components/homekit/* @cdce8p
homeassistant/components/html5/* @robbiet480
homeassistant/components/http/* @home-assistant/core
homeassistant/components/huawei_lte/* @scop homeassistant/components/huawei_lte/* @scop
homeassistant/components/huawei_router/device_tracker.py @abmantis homeassistant/components/huawei_router/* @abmantis
homeassistant/components/hue/* @balloob
# I
homeassistant/components/influxdb/* @fabaff homeassistant/components/influxdb/* @fabaff
homeassistant/components/integration/sensor.py @dgomes homeassistant/components/input_boolean/* @home-assistant/core
homeassistant/components/input_datetime/* @home-assistant/core
homeassistant/components/input_number/* @home-assistant/core
homeassistant/components/input_select/* @home-assistant/core
homeassistant/components/input_text/* @home-assistant/core
homeassistant/components/integration/* @dgomes
homeassistant/components/introduction/* @home-assistant/core
homeassistant/components/ios/* @robbiet480 homeassistant/components/ios/* @robbiet480
homeassistant/components/ipma/* @dgomes homeassistant/components/ipma/* @dgomes
homeassistant/components/irish_rail_transport/sensor.py @ttroy50 homeassistant/components/irish_rail_transport/* @ttroy50
homeassistant/components/jewish_calendar/* @tsvi
# J
homeassistant/components/jewish_calendar/sensor.py @tsvi
# K
homeassistant/components/knx/* @Julius2342 homeassistant/components/knx/* @Julius2342
homeassistant/components/kodi/media_player.py @armills homeassistant/components/kodi/* @armills
homeassistant/components/konnected/* @heythisisnate homeassistant/components/konnected/* @heythisisnate
homeassistant/components/lametric/* @robbiet480
# L homeassistant/components/launch_library/* @ludeeus
homeassistant/components/lametric/notify.py @robbiet480
homeassistant/components/launch_library/sensor.py @ludeeus
homeassistant/components/lifx/* @amelchio homeassistant/components/lifx/* @amelchio
homeassistant/components/lifx_cloud/scene.py @amelchio homeassistant/components/lifx_cloud/* @amelchio
homeassistant/components/lifx_legacy/light.py @amelchio homeassistant/components/lifx_legacy/* @amelchio
homeassistant/components/linux_battery/sensor.py @fabaff homeassistant/components/linux_battery/* @fabaff
homeassistant/components/liveboxplaytv/media_player.py @pschmitt homeassistant/components/liveboxplaytv/* @pschmitt
homeassistant/components/logger/* @home-assistant/core
homeassistant/components/lovelace/* @home-assistant/core
homeassistant/components/luci/* @fbradyirl
homeassistant/components/luftdaten/* @fabaff homeassistant/components/luftdaten/* @fabaff
homeassistant/components/mastodon/* @fabaff
# M
homeassistant/components/matrix/* @tinloaf homeassistant/components/matrix/* @tinloaf
homeassistant/components/mediaroom/media_player.py @dgomes homeassistant/components/mediaroom/* @dgomes
homeassistant/components/melissa/* @kennedyshead homeassistant/components/melissa/* @kennedyshead
homeassistant/components/met/weather.py @danielhiversen homeassistant/components/met/* @danielhiversen
homeassistant/components/miflora/sensor.py @danielhiversen @ChristianKuehnel homeassistant/components/miflora/* @danielhiversen @ChristianKuehnel
homeassistant/components/mill/climate.py @danielhiversen homeassistant/components/mill/* @danielhiversen
homeassistant/components/min_max/sensor.py @fabaff homeassistant/components/min_max/* @fabaff
homeassistant/components/mobile_app/* @robbiet480 homeassistant/components/mobile_app/* @robbiet480
homeassistant/components/monoprice/media_player.py @etsinko homeassistant/components/monoprice/* @etsinko
homeassistant/components/moon/sensor.py @fabaff homeassistant/components/moon/* @fabaff
homeassistant/components/mpd/media_player.py @fabaff homeassistant/components/mpd/* @fabaff
homeassistant/components/mqtt/* @home-assistant/core
homeassistant/components/mystrom/* @fabaff homeassistant/components/mystrom/* @fabaff
homeassistant/components/nello/* @pschmitt
# N
homeassistant/components/nello/lock.py @pschmitt
homeassistant/components/ness_alarm/* @nickw444 homeassistant/components/ness_alarm/* @nickw444
homeassistant/components/netdata/sensor.py @fabaff homeassistant/components/nest/* @awarecan
homeassistant/components/netdata/* @fabaff
homeassistant/components/nissan_leaf/* @filcole homeassistant/components/nissan_leaf/* @filcole
homeassistant/components/nmbs/sensor.py @thibmaek homeassistant/components/nmbs/* @thibmaek
homeassistant/components/no_ip/* @fabaff homeassistant/components/no_ip/* @fabaff
homeassistant/components/nuki/lock.py @pschmitt homeassistant/components/notify/* @flowolf
homeassistant/components/nsw_fuel_station/sensor.py @nickw444 homeassistant/components/nsw_fuel_station/* @nickw444
homeassistant/components/nuki/* @pschmitt
# O homeassistant/components/ohmconnect/* @robbiet480
homeassistant/components/ohmconnect/sensor.py @robbiet480 homeassistant/components/onboarding/* @home-assistant/core
homeassistant/components/openuv/* @bachya homeassistant/components/openuv/* @bachya
homeassistant/components/openweathermap/weather.py @fabaff homeassistant/components/openweathermap/* @fabaff
homeassistant/components/owlet/* @oblogic7 homeassistant/components/owlet/* @oblogic7
homeassistant/components/panel_custom/* @home-assistant/core
# P homeassistant/components/panel_iframe/* @home-assistant/core
homeassistant/components/pi_hole/sensor.py @fabaff homeassistant/components/persistent_notification/* @home-assistant/core
homeassistant/components/pi_hole/* @fabaff
homeassistant/components/plant/* @ChristianKuehnel homeassistant/components/plant/* @ChristianKuehnel
homeassistant/components/point/* @fredrike homeassistant/components/point/* @fredrike
homeassistant/components/pollen/sensor.py @bachya homeassistant/components/pollen/* @bachya
homeassistant/components/push/camera.py @dgomes homeassistant/components/push/* @dgomes
homeassistant/components/pvoutput/sensor.py @fabaff homeassistant/components/pvoutput/* @fabaff
homeassistant/components/qnap/* @colinodell
# Q homeassistant/components/quantum_gateway/* @cisasteelersfan
homeassistant/components/qnap/sensor.py @colinodell
homeassistant/components/quantum_gateway/device_tracker.py @cisasteelersfan
homeassistant/components/qwikswitch/* @kellerza homeassistant/components/qwikswitch/* @kellerza
homeassistant/components/raincloud/* @vanstinator
# R
homeassistant/components/rainmachine/* @bachya homeassistant/components/rainmachine/* @bachya
homeassistant/components/random/* @fabaff homeassistant/components/random/* @fabaff
homeassistant/components/rfxtrx/* @danielhiversen homeassistant/components/rfxtrx/* @danielhiversen
homeassistant/components/rmvtransport/* @cgtobi homeassistant/components/rmvtransport/* @cgtobi
homeassistant/components/roomba/vacuum.py @pschmitt homeassistant/components/roomba/* @pschmitt
homeassistant/components/ruter/sensor.py @ludeeus homeassistant/components/ruter/* @ludeeus
homeassistant/components/scene/* @home-assistant/core
# S homeassistant/components/scrape/* @fabaff
homeassistant/components/scrape/sensor.py @fabaff homeassistant/components/script/* @home-assistant/core
homeassistant/components/sensibo/climate.py @andrey-git homeassistant/components/sensibo/* @andrey-git
homeassistant/components/serial/sensor.py @fabaff homeassistant/components/serial/* @fabaff
homeassistant/components/seventeentrack/sensor.py @bachya homeassistant/components/seventeentrack/* @bachya
homeassistant/components/shell_command/* @home-assistant/core
homeassistant/components/shiftr/* @fabaff homeassistant/components/shiftr/* @fabaff
homeassistant/components/shodan/sensor.py @fabaff homeassistant/components/shodan/* @fabaff
homeassistant/components/simplisafe/* @bachya homeassistant/components/simplisafe/* @bachya
homeassistant/components/sma/sensor.py @kellerza homeassistant/components/sma/* @kellerza
homeassistant/components/smartthings/* @andrewsayre homeassistant/components/smartthings/* @andrewsayre
homeassistant/components/smtp/* @fabaff
homeassistant/components/sonos/* @amelchio homeassistant/components/sonos/* @amelchio
homeassistant/components/spaceapi/* @fabaff homeassistant/components/spaceapi/* @fabaff
homeassistant/components/spider/* @peternijssen homeassistant/components/spider/* @peternijssen
homeassistant/components/sql/sensor.py @dgomes homeassistant/components/sql/* @dgomes
homeassistant/components/statistics/sensor.py @fabaff homeassistant/components/statistics/* @fabaff
homeassistant/components/swiss_*/* @fabaff homeassistant/components/sun/* @home-assistant/core
homeassistant/components/switchbot/switch.py @danielhiversen homeassistant/components/swiss_hydrological_data/* @fabaff
homeassistant/components/switchmate/switch.py @danielhiversen homeassistant/components/swiss_public_transport/* @fabaff
homeassistant/components/synology_srm/device_tracker.py @aerialls homeassistant/components/switchbot/* @danielhiversen
homeassistant/components/sytadin/sensor.py @gautric homeassistant/components/switchmate/* @danielhiversen
homeassistant/components/synology_srm/* @aerialls
# T homeassistant/components/syslog/* @fabaff
homeassistant/components/sytadin/* @gautric
homeassistant/components/tahoma/* @philklei homeassistant/components/tahoma/* @philklei
homeassistant/components/tautulli/sensor.py @ludeeus homeassistant/components/tautulli/* @ludeeus
homeassistant/components/tellduslive/* @fredrike homeassistant/components/tellduslive/* @fredrike
homeassistant/components/template/cover.py @PhracturedBlue homeassistant/components/template/* @PhracturedBlue
homeassistant/components/tesla/* @zabuldon homeassistant/components/tesla/* @zabuldon
homeassistant/components/tfiac/* @fredrike @mellado homeassistant/components/tfiac/* @fredrike @mellado
homeassistant/components/thethingsnetwork/* @fabaff homeassistant/components/thethingsnetwork/* @fabaff
homeassistant/components/threshold/binary_sensor.py @fabaff homeassistant/components/threshold/* @fabaff
homeassistant/components/tibber/* @danielhiversen homeassistant/components/tibber/* @danielhiversen
homeassistant/components/tile/device_tracker.py @bachya homeassistant/components/tile/* @bachya
homeassistant/components/time_date/sensor.py @fabaff homeassistant/components/time_date/* @fabaff
homeassistant/components/toon/* @frenck homeassistant/components/toon/* @frenck
homeassistant/components/tplink/* @rytilahti homeassistant/components/tplink/* @rytilahti
homeassistant/components/traccar/device_tracker.py @ludeeus homeassistant/components/traccar/* @ludeeus
homeassistant/components/tradfri/* @ggravlingen homeassistant/components/tradfri/* @ggravlingen
homeassistant/components/tts/* @robbiet480
# U homeassistant/components/twilio_call/* @robbiet480
homeassistant/components/uber/sensor.py @robbiet480 homeassistant/components/twilio_sms/* @robbiet480
homeassistant/components/uber/* @robbiet480
homeassistant/components/unifi/* @kane610 homeassistant/components/unifi/* @kane610
homeassistant/components/upcloud/* @scop homeassistant/components/upcloud/* @scop
homeassistant/components/updater/* @home-assistant/core
homeassistant/components/upnp/* @robbiet480 homeassistant/components/upnp/* @robbiet480
homeassistant/components/uptimerobot/binary_sensor.py @ludeeus homeassistant/components/uptimerobot/* @ludeeus
homeassistant/components/utility_meter/* @dgomes homeassistant/components/utility_meter/* @dgomes
# V
homeassistant/components/velux/* @Julius2342 homeassistant/components/velux/* @Julius2342
homeassistant/components/version/sensor.py @fabaff homeassistant/components/version/* @fabaff
homeassistant/components/waqi/* @andrey-git
# W homeassistant/components/weather/* @fabaff
homeassistant/components/waqi/sensor.py @andrey-git homeassistant/components/weblink/* @home-assistant/core
homeassistant/components/weather/__init__.py @fabaff homeassistant/components/websocket_api/* @home-assistant/core
homeassistant/components/wemo/* @sqldiablo homeassistant/components/wemo/* @sqldiablo
homeassistant/components/worldclock/sensor.py @fabaff homeassistant/components/worldclock/* @fabaff
homeassistant/components/xfinity/* @cisasteelersfan
# X
homeassistant/components/xfinity/device_tracker.py @cisasteelersfan
homeassistant/components/xiaomi_aqara/* @danielhiversen @syssi homeassistant/components/xiaomi_aqara/* @danielhiversen @syssi
homeassistant/components/xiaomi_miio/* @rytilahti @syssi homeassistant/components/xiaomi_miio/* @rytilahti @syssi
homeassistant/components/xiaomi_tv/media_player.py @fattdev homeassistant/components/xiaomi_tv/* @fattdev
homeassistant/components/xmpp/* @fabaff
# Y
homeassistant/components/yamaha_musiccast/* @jalmeroth homeassistant/components/yamaha_musiccast/* @jalmeroth
homeassistant/components/yeelight/* @rytilahti @zewelor homeassistant/components/yeelight/* @rytilahti @zewelor
homeassistant/components/yeelightsunflower/light.py @lindsaymarkward homeassistant/components/yeelightsunflower/* @lindsaymarkward
homeassistant/components/yi/camera.py @bachya homeassistant/components/yessssms/* @flowolf
homeassistant/components/yi/* @bachya
# Z
homeassistant/components/zeroconf/* @robbiet480 homeassistant/components/zeroconf/* @robbiet480
homeassistant/components/zha/* @dmulcahey @adminiuga homeassistant/components/zha/* @dmulcahey @adminiuga
homeassistant/components/zone/* @home-assistant/core
homeassistant/components/zoneminder/* @rohankapoorcom homeassistant/components/zoneminder/* @rohankapoorcom
homeassistant/components/zwave/* @home-assistant/z-wave
# Other code # Individual files
homeassistant/scripts/check_config.py @kellerza homeassistant/components/group/cover @cdce8p
homeassistant/components/demo/weather @fabaff

View File

@@ -1,4 +1,4 @@
Home Assistant |Build Status| |Coverage Status| |Chat Status| Home Assistant |Build Status| |CI Status| |Coverage Status| |Chat Status|
================================================================================= =================================================================================
Home Assistant is a home automation platform running on Python 3. It is able to track and control all devices at home and offer a platform for automating control. Home Assistant is a home automation platform running on Python 3. It is able to track and control all devices at home and offer a platform for automating control.
@@ -27,8 +27,10 @@ components <https://developers.home-assistant.io/docs/en/creating_component_inde
If you run into issues while using Home Assistant or during development If you run into issues while using Home Assistant or during development
of a component, check the `Home Assistant help section <https://home-assistant.io/help/>`__ of our website for further help and information. of a component, check the `Home Assistant help section <https://home-assistant.io/help/>`__ of our website for further help and information.
.. |Build Status| image:: https://travis-ci.org/home-assistant/home-assistant.svg?branch=master .. |Build Status| image:: https://travis-ci.org/home-assistant/home-assistant.svg?branch=dev
:target: https://travis-ci.org/home-assistant/home-assistant :target: https://travis-ci.org/home-assistant/home-assistant
.. |CI Status| image:: https://circleci.com/gh/home-assistant/home-assistant.svg?style=shield
:target: https://circleci.com/gh/home-assistant/home-assistant
.. |Coverage Status| image:: https://img.shields.io/coveralls/home-assistant/home-assistant.svg .. |Coverage Status| image:: https://img.shields.io/coveralls/home-assistant/home-assistant.svg
:target: https://coveralls.io/r/home-assistant/home-assistant?branch=master :target: https://coveralls.io/r/home-assistant/home-assistant?branch=master
.. |Chat Status| image:: https://img.shields.io/discord/330944238910963714.svg .. |Chat Status| image:: https://img.shields.io/discord/330944238910963714.svg

View File

@@ -0,0 +1,10 @@
{
"domain": "abode",
"name": "Abode",
"documentation": "https://www.home-assistant.io/components/abode",
"requirements": [
"abodepy==0.15.0"
],
"dependencies": [],
"codeowners": []
}

View File

@@ -0,0 +1,10 @@
{
"domain": "acer_projector",
"name": "Acer projector",
"documentation": "https://www.home-assistant.io/components/acer_projector",
"requirements": [
"pyserial==3.1.1"
],
"dependencies": [],
"codeowners": []
}

View File

@@ -1,9 +1,4 @@
""" """Use serial protocol of Acer projector to obtain state of the projector."""
Use serial protocol of Acer projector to obtain state of the projector.
For more details about this component, please refer to the documentation
at https://home-assistant.io/components/switch.acer_projector/
"""
import logging import logging
import re import re

View File

@@ -1,9 +1,4 @@
""" """Support for Actiontec MI424WR (Verizon FIOS) routers."""
Support for Actiontec MI424WR (Verizon FIOS) routers.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.actiontec/
"""
import logging import logging
import re import re
import telnetlib import telnetlib

View File

@@ -0,0 +1,8 @@
{
"domain": "actiontec",
"name": "Actiontec",
"documentation": "https://www.home-assistant.io/components/actiontec",
"requirements": [],
"dependencies": [],
"codeowners": []
}

View File

@@ -4,12 +4,15 @@ import struct
import logging import logging
import ctypes import ctypes
from collections import namedtuple from collections import namedtuple
import asyncio
import async_timeout
import voluptuous as vol import voluptuous as vol
from homeassistant.const import ( from homeassistant.const import (
CONF_DEVICE, CONF_IP_ADDRESS, CONF_PORT, EVENT_HOMEASSISTANT_STOP) CONF_DEVICE, CONF_IP_ADDRESS, CONF_PORT, EVENT_HOMEASSISTANT_STOP)
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
REQUIREMENTS = ['pyads==3.0.7'] REQUIREMENTS = ['pyads==3.0.7']
@@ -31,6 +34,9 @@ CONF_ADS_VALUE = 'value'
CONF_ADS_VAR = 'adsvar' CONF_ADS_VAR = 'adsvar'
CONF_ADS_VAR_BRIGHTNESS = 'adsvar_brightness' CONF_ADS_VAR_BRIGHTNESS = 'adsvar_brightness'
STATE_KEY_STATE = 'state'
STATE_KEY_BRIGHTNESS = 'brightness'
DOMAIN = 'ads' DOMAIN = 'ads'
SERVICE_WRITE_DATA_BY_NAME = 'write_data_by_name' SERVICE_WRITE_DATA_BY_NAME = 'write_data_by_name'
@@ -154,28 +160,41 @@ class AdsHub:
def write_by_name(self, name, value, plc_datatype): def write_by_name(self, name, value, plc_datatype):
"""Write a value to the device.""" """Write a value to the device."""
import pyads
with self._lock: with self._lock:
return self._client.write_by_name(name, value, plc_datatype) try:
return self._client.write_by_name(name, value, plc_datatype)
except pyads.ADSError as err:
_LOGGER.error("Error writing %s: %s", name, err)
def read_by_name(self, name, plc_datatype): def read_by_name(self, name, plc_datatype):
"""Read a value from the device.""" """Read a value from the device."""
import pyads
with self._lock: with self._lock:
return self._client.read_by_name(name, plc_datatype) try:
return self._client.read_by_name(name, plc_datatype)
except pyads.ADSError as err:
_LOGGER.error("Error reading %s: %s", name, err)
def add_device_notification(self, name, plc_datatype, callback): def add_device_notification(self, name, plc_datatype, callback):
"""Add a notification to the ADS devices.""" """Add a notification to the ADS devices."""
from pyads import NotificationAttrib import pyads
attr = NotificationAttrib(ctypes.sizeof(plc_datatype)) attr = pyads.NotificationAttrib(ctypes.sizeof(plc_datatype))
with self._lock: with self._lock:
hnotify, huser = self._client.add_device_notification( try:
name, attr, self._device_notification_callback) hnotify, huser = self._client.add_device_notification(
hnotify = int(hnotify) name, attr, self._device_notification_callback)
self._notification_items[hnotify] = NotificationItem( except pyads.ADSError as err:
hnotify, huser, name, plc_datatype, callback) _LOGGER.error("Error subscribing to %s: %s", name, err)
else:
hnotify = int(hnotify)
self._notification_items[hnotify] = NotificationItem(
hnotify, huser, name, plc_datatype, callback)
_LOGGER.debug( _LOGGER.debug(
"Added device notification %d for variable %s", hnotify, name) "Added device notification %d for variable %s",
hnotify, name)
def _device_notification_callback(self, notification, name): def _device_notification_callback(self, notification, name):
"""Handle device notifications.""" """Handle device notifications."""
@@ -210,3 +229,68 @@ class AdsHub:
_LOGGER.warning("No callback available for this datatype") _LOGGER.warning("No callback available for this datatype")
notification_item.callback(notification_item.name, value) notification_item.callback(notification_item.name, value)
class AdsEntity(Entity):
"""Representation of ADS entity."""
def __init__(self, ads_hub, name, ads_var):
"""Initialize ADS binary sensor."""
self._name = name
self._unique_id = ads_var
self._state_dict = {}
self._state_dict[STATE_KEY_STATE] = None
self._ads_hub = ads_hub
self._ads_var = ads_var
self._event = None
async def async_initialize_device(
self, ads_var, plctype, state_key=STATE_KEY_STATE, factor=None):
"""Register device notification."""
def update(name, value):
"""Handle device notifications."""
_LOGGER.debug('Variable %s changed its value to %d', name, value)
if factor is None:
self._state_dict[state_key] = value
else:
self._state_dict[state_key] = value / factor
asyncio.run_coroutine_threadsafe(async_event_set(), self.hass.loop)
self.schedule_update_ha_state()
async def async_event_set():
"""Set event in async context."""
self._event.set()
self._event = asyncio.Event()
await self.hass.async_add_executor_job(
self._ads_hub.add_device_notification,
ads_var, plctype, update)
try:
with async_timeout.timeout(10):
await self._event.wait()
except asyncio.TimeoutError:
_LOGGER.debug('Variable %s: Timeout during first update',
ads_var)
@property
def name(self):
"""Return the default name of the binary sensor."""
return self._name
@property
def unique_id(self):
"""Return an unique identifier for this entity."""
return self._unique_id
@property
def should_poll(self):
"""Return False because entity pushes its state to HA."""
return False
@property
def available(self):
"""Return False if state has not been updated yet."""
return self._state_dict[STATE_KEY_STATE] is not None

View File

@@ -1,7 +1,5 @@
"""Support for ADS binary sensors.""" """Support for ADS binary sensors."""
import logging import logging
import asyncio
import async_timeout
import voluptuous as vol import voluptuous as vol
@@ -10,7 +8,7 @@ from homeassistant.components.binary_sensor import (
from homeassistant.const import CONF_DEVICE_CLASS, CONF_NAME from homeassistant.const import CONF_DEVICE_CLASS, CONF_NAME
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from . import CONF_ADS_VAR, DATA_ADS from . import CONF_ADS_VAR, DATA_ADS, AdsEntity, STATE_KEY_STATE
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
@@ -36,70 +34,25 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities([ads_sensor]) add_entities([ads_sensor])
class AdsBinarySensor(BinarySensorDevice): class AdsBinarySensor(AdsEntity, BinarySensorDevice):
"""Representation of ADS binary sensors.""" """Representation of ADS binary sensors."""
def __init__(self, ads_hub, name, ads_var, device_class): def __init__(self, ads_hub, name, ads_var, device_class):
"""Initialize ADS binary sensor.""" """Initialize ADS binary sensor."""
self._name = name super().__init__(ads_hub, name, ads_var)
self._unique_id = ads_var
self._state = None
self._device_class = device_class or 'moving' self._device_class = device_class or 'moving'
self._ads_hub = ads_hub
self.ads_var = ads_var
self._event = None
async def async_added_to_hass(self): async def async_added_to_hass(self):
"""Register device notification.""" """Register device notification."""
def update(name, value): await self.async_initialize_device(self._ads_var,
"""Handle device notifications.""" self._ads_hub.PLCTYPE_BOOL)
_LOGGER.debug('Variable %s changed its value to %d', name, value)
self._state = value
asyncio.run_coroutine_threadsafe(async_event_set(), self.hass.loop)
self.schedule_update_ha_state()
async def async_event_set():
"""Set event in async context."""
self._event.set()
self._event = asyncio.Event()
await self.hass.async_add_executor_job(
self._ads_hub.add_device_notification,
self.ads_var, self._ads_hub.PLCTYPE_BOOL, update)
try:
with async_timeout.timeout(10):
await self._event.wait()
except asyncio.TimeoutError:
_LOGGER.debug('Variable %s: Timeout during first update',
self.ads_var)
@property @property
def name(self): def is_on(self):
"""Return the default name of the binary sensor.""" """Return True if the entity is on."""
return self._name return self._state_dict[STATE_KEY_STATE]
@property
def unique_id(self):
"""Return an unique identifier for this entity."""
return self._unique_id
@property @property
def device_class(self): def device_class(self):
"""Return the device class.""" """Return the device class."""
return self._device_class return self._device_class
@property
def is_on(self):
"""Return if the binary sensor is on."""
return self._state
@property
def should_poll(self):
"""Return False because entity pushes its state to HA."""
return False
@property
def available(self):
"""Return False if state has not been updated yet."""
return self._state is not None

View File

@@ -1,7 +1,5 @@
"""Support for ADS light sources.""" """Support for ADS light sources."""
import logging import logging
import asyncio
import async_timeout
import voluptuous as vol import voluptuous as vol
@@ -10,12 +8,12 @@ from homeassistant.components.light import (
from homeassistant.const import CONF_NAME from homeassistant.const import CONF_NAME
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from . import CONF_ADS_VAR, CONF_ADS_VAR_BRIGHTNESS, DATA_ADS from . import CONF_ADS_VAR, CONF_ADS_VAR_BRIGHTNESS, DATA_ADS, \
AdsEntity, STATE_KEY_BRIGHTNESS, STATE_KEY_STATE
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
DEPENDENCIES = ['ads'] DEPENDENCIES = ['ads']
DEFAULT_NAME = 'ADS Light' DEFAULT_NAME = 'ADS Light'
CONF_ADSVAR_BRIGHTNESS = 'adsvar_brightness'
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required(CONF_ADS_VAR): cv.string, vol.Required(CONF_ADS_VAR): cv.string,
vol.Optional(CONF_ADS_VAR_BRIGHTNESS): cv.string, vol.Optional(CONF_ADS_VAR_BRIGHTNESS): cv.string,
@@ -35,107 +33,54 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
name)]) name)])
class AdsLight(Light): class AdsLight(AdsEntity, Light):
"""Representation of ADS light.""" """Representation of ADS light."""
def __init__(self, ads_hub, ads_var_enable, ads_var_brightness, name): def __init__(self, ads_hub, ads_var_enable, ads_var_brightness, name):
"""Initialize AdsLight entity.""" """Initialize AdsLight entity."""
self._ads_hub = ads_hub super().__init__(ads_hub, name, ads_var_enable)
self._on_state = None self._state_dict[STATE_KEY_BRIGHTNESS] = None
self._brightness = None self._ads_var_brightness = ads_var_brightness
self._name = name
self._unique_id = ads_var_enable
self.ads_var_enable = ads_var_enable
self.ads_var_brightness = ads_var_brightness
self._event = None
async def async_added_to_hass(self): async def async_added_to_hass(self):
"""Register device notification.""" """Register device notification."""
def update_on_state(name, value): await self.async_initialize_device(self._ads_var,
"""Handle device notifications for state.""" self._ads_hub.PLCTYPE_BOOL)
_LOGGER.debug('Variable %s changed its value to %d', name, value)
self._on_state = value
asyncio.run_coroutine_threadsafe(async_event_set(), self.hass.loop)
self.schedule_update_ha_state()
async def async_event_set(): if self._ads_var_brightness is not None:
"""Set event in async context.""" await self.async_initialize_device(self._ads_var_brightness,
self._event.set() self._ads_hub.PLCTYPE_UINT,
STATE_KEY_BRIGHTNESS)
def update_brightness(name, value):
"""Handle device notification for brightness."""
_LOGGER.debug('Variable %s changed its value to %d', name, value)
self._brightness = value
self.schedule_update_ha_state()
self._event = asyncio.Event()
await self.hass.async_add_executor_job(
self._ads_hub.add_device_notification,
self.ads_var_enable, self._ads_hub.PLCTYPE_BOOL, update_on_state
)
if self.ads_var_brightness is not None:
await self.hass.async_add_executor_job(
self._ads_hub.add_device_notification,
self.ads_var_brightness, self._ads_hub.PLCTYPE_INT,
update_brightness
)
try:
with async_timeout.timeout(10):
await self._event.wait()
except asyncio.TimeoutError:
_LOGGER.debug('Variable %s: Timeout during first update',
self.ads_var_enable)
@property
def name(self):
"""Return the name of the device if any."""
return self._name
@property
def unique_id(self):
"""Return an unique identifier for this entity."""
return self._unique_id
@property @property
def brightness(self): def brightness(self):
"""Return the brightness of the light (0..255).""" """Return the brightness of the light (0..255)."""
return self._brightness return self._state_dict[STATE_KEY_BRIGHTNESS]
@property
def is_on(self):
"""Return if light is on."""
return self._on_state
@property
def should_poll(self):
"""Return False because entity pushes its state to HA."""
return False
@property @property
def supported_features(self): def supported_features(self):
"""Flag supported features.""" """Flag supported features."""
support = 0 support = 0
if self.ads_var_brightness is not None: if self._ads_var_brightness is not None:
support = SUPPORT_BRIGHTNESS support = SUPPORT_BRIGHTNESS
return support return support
@property @property
def available(self): def is_on(self):
"""Return False if state has not been updated yet.""" """Return True if the entity is on."""
return self._on_state is not None return self._state_dict[STATE_KEY_STATE]
def turn_on(self, **kwargs): def turn_on(self, **kwargs):
"""Turn the light on or set a specific dimmer value.""" """Turn the light on or set a specific dimmer value."""
brightness = kwargs.get(ATTR_BRIGHTNESS) brightness = kwargs.get(ATTR_BRIGHTNESS)
self._ads_hub.write_by_name(self.ads_var_enable, True, self._ads_hub.write_by_name(self._ads_var, True,
self._ads_hub.PLCTYPE_BOOL) self._ads_hub.PLCTYPE_BOOL)
if self.ads_var_brightness is not None and brightness is not None: if self._ads_var_brightness is not None and brightness is not None:
self._ads_hub.write_by_name(self.ads_var_brightness, brightness, self._ads_hub.write_by_name(self._ads_var_brightness, brightness,
self._ads_hub.PLCTYPE_UINT) self._ads_hub.PLCTYPE_UINT)
def turn_off(self, **kwargs): def turn_off(self, **kwargs):
"""Turn the light off.""" """Turn the light off."""
self._ads_hub.write_by_name(self.ads_var_enable, False, self._ads_hub.write_by_name(self._ads_var, False,
self._ads_hub.PLCTYPE_BOOL) self._ads_hub.PLCTYPE_BOOL)

View File

@@ -0,0 +1,10 @@
{
"domain": "ads",
"name": "Ads",
"documentation": "https://www.home-assistant.io/components/ads",
"requirements": [
"pyads==3.0.7"
],
"dependencies": [],
"codeowners": []
}

View File

@@ -7,9 +7,9 @@ from homeassistant.components import ads
from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_NAME, CONF_UNIT_OF_MEASUREMENT from homeassistant.const import CONF_NAME, CONF_UNIT_OF_MEASUREMENT
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
from . import CONF_ADS_FACTOR, CONF_ADS_TYPE, CONF_ADS_VAR from . import CONF_ADS_FACTOR, CONF_ADS_TYPE, CONF_ADS_VAR, \
AdsEntity, STATE_KEY_STATE
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
@@ -43,60 +43,31 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities([entity]) add_entities([entity])
class AdsSensor(Entity): class AdsSensor(AdsEntity):
"""Representation of an ADS sensor entity.""" """Representation of an ADS sensor entity."""
def __init__(self, ads_hub, ads_var, ads_type, name, unit_of_measurement, def __init__(self, ads_hub, ads_var, ads_type, name, unit_of_measurement,
factor): factor):
"""Initialize AdsSensor entity.""" """Initialize AdsSensor entity."""
self._ads_hub = ads_hub super().__init__(ads_hub, name, ads_var)
self._name = name
self._unique_id = ads_var
self._value = None
self._unit_of_measurement = unit_of_measurement self._unit_of_measurement = unit_of_measurement
self.ads_var = ads_var self._ads_type = ads_type
self.ads_type = ads_type self._factor = factor
self.factor = factor
async def async_added_to_hass(self): async def async_added_to_hass(self):
"""Register device notification.""" """Register device notification."""
def update(name, value): await self.async_initialize_device(
"""Handle device notifications.""" self._ads_var,
_LOGGER.debug("Variable %s changed its value to %d", name, value) self._ads_hub.ADS_TYPEMAP[self._ads_type],
STATE_KEY_STATE,
# If factor is set use it otherwise not self._factor)
if self.factor is None:
self._value = value
else:
self._value = value / self.factor
self.schedule_update_ha_state()
self.hass.async_add_job(
self._ads_hub.add_device_notification,
self.ads_var, self._ads_hub.ADS_TYPEMAP[self.ads_type], update
)
@property
def name(self):
"""Return the name of the entity."""
return self._name
@property
def unique_id(self):
"""Return an unique identifier for this entity."""
return self._unique_id
@property @property
def state(self): def state(self):
"""Return the state of the device.""" """Return the state of the device."""
return self._value return self._state_dict[STATE_KEY_STATE]
@property @property
def unit_of_measurement(self): def unit_of_measurement(self):
"""Return the unit of measurement.""" """Return the unit of measurement."""
return self._unit_of_measurement return self._unit_of_measurement
@property
def should_poll(self):
"""Return False because entity pushes its state."""
return False

View File

@@ -1,16 +1,13 @@
"""Support for ADS switch platform.""" """Support for ADS switch platform."""
import logging import logging
import asyncio
import async_timeout
import voluptuous as vol import voluptuous as vol
from homeassistant.components.switch import PLATFORM_SCHEMA from homeassistant.components.switch import SwitchDevice, PLATFORM_SCHEMA
from homeassistant.const import CONF_NAME from homeassistant.const import CONF_NAME
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import ToggleEntity
from . import CONF_ADS_VAR, DATA_ADS from . import CONF_ADS_VAR, DATA_ADS, AdsEntity, STATE_KEY_STATE
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
@@ -34,74 +31,25 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities([AdsSwitch(ads_hub, name, ads_var)]) add_entities([AdsSwitch(ads_hub, name, ads_var)])
class AdsSwitch(ToggleEntity): class AdsSwitch(AdsEntity, SwitchDevice):
"""Representation of an ADS switch device.""" """Representation of an ADS switch device."""
def __init__(self, ads_hub, name, ads_var):
"""Initialize the AdsSwitch entity."""
self._ads_hub = ads_hub
self._on_state = None
self._name = name
self._unique_id = ads_var
self.ads_var = ads_var
self._event = None
async def async_added_to_hass(self): async def async_added_to_hass(self):
"""Register device notification.""" """Register device notification."""
def update(name, value): await self.async_initialize_device(self._ads_var,
"""Handle device notification.""" self._ads_hub.PLCTYPE_BOOL)
_LOGGER.debug("Variable %s changed its value to %d", name, value)
self._on_state = value
asyncio.run_coroutine_threadsafe(async_event_set(), self.hass.loop)
self.schedule_update_ha_state()
async def async_event_set():
"""Set event in async context."""
self._event.set()
self._event = asyncio.Event()
await self.hass.async_add_executor_job(
self._ads_hub.add_device_notification,
self.ads_var, self._ads_hub.PLCTYPE_BOOL, update)
try:
with async_timeout.timeout(10):
await self._event.wait()
except asyncio.TimeoutError:
_LOGGER.debug('Variable %s: Timeout during first update',
self.ads_var)
@property @property
def is_on(self): def is_on(self):
"""Return if the switch is turned on.""" """Return True if the entity is on."""
return self._on_state return self._state_dict[STATE_KEY_STATE]
@property
def name(self):
"""Return the name of the entity."""
return self._name
@property
def unique_id(self):
"""Return an unique identifier for this entity."""
return self._unique_id
@property
def should_poll(self):
"""Return False because entity pushes its state to HA."""
return False
@property
def available(self):
"""Return False if state has not been updated yet."""
return self._on_state is not None
def turn_on(self, **kwargs): def turn_on(self, **kwargs):
"""Turn the switch on.""" """Turn the switch on."""
self._ads_hub.write_by_name( self._ads_hub.write_by_name(
self.ads_var, True, self._ads_hub.PLCTYPE_BOOL) self._ads_var, True, self._ads_hub.PLCTYPE_BOOL)
def turn_off(self, **kwargs): def turn_off(self, **kwargs):
"""Turn the switch off.""" """Turn the switch off."""
self._ads_hub.write_by_name( self._ads_hub.write_by_name(
self.ads_var, False, self._ads_hub.PLCTYPE_BOOL) self._ads_var, False, self._ads_hub.PLCTYPE_BOOL)

View File

@@ -0,0 +1,10 @@
{
"domain": "aftership",
"name": "Aftership",
"documentation": "https://www.home-assistant.io/components/aftership",
"requirements": [
"pyaftership==0.1.2"
],
"dependencies": [],
"codeowners": []
}

View File

@@ -1,9 +1,4 @@
""" """Support for non-delivered packages recorded in AfterShip."""
Support for non-delivered packages recorded in AfterShip.
For more details about this platform, please refer to the documentation at
https://www.home-assistant.io/components/sensor.aftership/
"""
from datetime import timedelta from datetime import timedelta
import logging import logging

View File

@@ -1,9 +1,4 @@
""" """Component for handling Air Quality data for your location."""
Component for handling Air Quality data for your location.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/air_quality/
"""
from datetime import timedelta from datetime import timedelta
import logging import logging

View File

@@ -0,0 +1,8 @@
{
"domain": "air_quality",
"name": "Air quality",
"documentation": "https://www.home-assistant.io/components/air_quality",
"requirements": [],
"dependencies": [],
"codeowners": []
}

View File

@@ -0,0 +1,12 @@
{
"domain": "airvisual",
"name": "Airvisual",
"documentation": "https://www.home-assistant.io/components/airvisual",
"requirements": [
"pyairvisual==3.0.1"
],
"dependencies": [],
"codeowners": [
"@bachya"
]
}

View File

@@ -1,9 +1,4 @@
""" """Support for AirVisual air quality sensors."""
Support for AirVisual air quality sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.airvisual/
"""
from logging import getLogger from logging import getLogger
from datetime import timedelta from datetime import timedelta

View File

@@ -1,9 +1,4 @@
""" """Platform for the Aladdin Connect cover component."""
Platform for the Aladdin Connect cover component.
For more details about this platform, please refer to the documentation
https://home-assistant.io/components/cover.aladdin_connect/
"""
import logging import logging
import voluptuous as vol import voluptuous as vol

View File

@@ -0,0 +1,10 @@
{
"domain": "aladdin_connect",
"name": "Aladdin connect",
"documentation": "https://www.home-assistant.io/components/aladdin_connect",
"requirements": [
"aladdin_connect==0.3"
],
"dependencies": [],
"codeowners": []
}

View File

@@ -1,9 +1,4 @@
""" """Component to interface with an alarm control panel."""
Component to interface with an alarm control panel.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel/
"""
from datetime import timedelta from datetime import timedelta
import logging import logging

View File

@@ -0,0 +1,10 @@
{
"domain": "alarm_control_panel",
"name": "Alarm control panel",
"documentation": "https://www.home-assistant.io/components/alarm_control_panel",
"requirements": [],
"dependencies": [],
"codeowners": [
"@colinodell"
]
}

View File

@@ -0,0 +1,10 @@
{
"domain": "alarmdecoder",
"name": "Alarmdecoder",
"documentation": "https://www.home-assistant.io/components/alarmdecoder",
"requirements": [
"alarmdecoder==1.13.2"
],
"dependencies": [],
"codeowners": []
}

View File

@@ -1,9 +1,4 @@
""" """Interfaces with Alarm.com alarm control panels."""
Interfaces with Alarm.com alarm control panels.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.alarmdotcom/
"""
import logging import logging
import re import re

View File

@@ -0,0 +1,10 @@
{
"domain": "alarmdotcom",
"name": "Alarmdotcom",
"documentation": "https://www.home-assistant.io/components/alarmdotcom",
"requirements": [
"pyalarmdotcom==0.3.2"
],
"dependencies": [],
"codeowners": []
}

View File

@@ -0,0 +1,8 @@
{
"domain": "alert",
"name": "Alert",
"documentation": "https://www.home-assistant.io/components/alert",
"requirements": [],
"dependencies": [],
"codeowners": []
}

View File

@@ -0,0 +1,10 @@
{
"domain": "alexa",
"name": "Alexa",
"documentation": "https://www.home-assistant.io/components/alexa",
"requirements": [],
"dependencies": [
"http"
],
"codeowners": []
}

View File

@@ -0,0 +1,12 @@
{
"domain": "alpha_vantage",
"name": "Alpha vantage",
"documentation": "https://www.home-assistant.io/components/alpha_vantage",
"requirements": [
"alpha_vantage==2.1.0"
],
"dependencies": [],
"codeowners": [
"@fabaff"
]
}

View File

@@ -1,9 +1,4 @@
""" """Stock market information from Alpha Vantage."""
Stock market information from Alpha Vantage.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.alpha_vantage/
"""
from datetime import timedelta from datetime import timedelta
import logging import logging

View File

@@ -0,0 +1,12 @@
{
"domain": "amazon_polly",
"name": "Amazon polly",
"documentation": "https://www.home-assistant.io/components/amazon_polly",
"requirements": [
"boto3==1.9.16"
],
"dependencies": [],
"codeowners": [
"@robbiet480"
]
}

View File

@@ -1,9 +1,4 @@
""" """Support for the Amazon Polly text to speech service."""
Support for the Amazon Polly text to speech service.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/tts.amazon_polly/
"""
import logging import logging
import voluptuous as vol import voluptuous as vol

View File

@@ -20,7 +20,7 @@ from .const import (
ATTR_LAST_DATA, CONF_APP_KEY, DATA_CLIENT, DOMAIN, TOPIC_UPDATE, ATTR_LAST_DATA, CONF_APP_KEY, DATA_CLIENT, DOMAIN, TOPIC_UPDATE,
TYPE_BINARY_SENSOR, TYPE_SENSOR) TYPE_BINARY_SENSOR, TYPE_SENSOR)
REQUIREMENTS = ['aioambient==0.1.3'] REQUIREMENTS = ['aioambient==0.3.0']
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
@@ -417,9 +417,8 @@ class AmbientWeatherEntity(Entity):
@property @property
def available(self): def available(self):
"""Return True if entity is available.""" """Return True if entity is available."""
return bool( return self._ambient.stations[self._mac_address][ATTR_LAST_DATA].get(
self._ambient.stations[self._mac_address][ATTR_LAST_DATA].get( self._sensor_type) is not None
self._sensor_type))
@property @property
def device_info(self): def device_info(self):

View File

@@ -0,0 +1,12 @@
{
"domain": "ambient_station",
"name": "Ambient station",
"documentation": "https://www.home-assistant.io/components/ambient_station",
"requirements": [
"aioambient==0.3.0"
],
"dependencies": [],
"codeowners": [
"@bachya"
]
}

View File

@@ -12,7 +12,7 @@ from homeassistant.helpers import discovery
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
REQUIREMENTS = ['amcrest==1.2.7'] REQUIREMENTS = ['amcrest==1.3.0']
DEPENDENCIES = ['ffmpeg'] DEPENDENCIES = ['ffmpeg']
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
@@ -26,6 +26,7 @@ DEFAULT_NAME = 'Amcrest Camera'
DEFAULT_PORT = 80 DEFAULT_PORT = 80
DEFAULT_RESOLUTION = 'high' DEFAULT_RESOLUTION = 'high'
DEFAULT_STREAM_SOURCE = 'snapshot' DEFAULT_STREAM_SOURCE = 'snapshot'
DEFAULT_ARGUMENTS = '-pred 1'
TIMEOUT = 10 TIMEOUT = 10
DATA_AMCREST = 'amcrest' DATA_AMCREST = 'amcrest'
@@ -77,7 +78,8 @@ CONFIG_SCHEMA = vol.Schema({
vol.All(vol.In(RESOLUTION_LIST)), vol.All(vol.In(RESOLUTION_LIST)),
vol.Optional(CONF_STREAM_SOURCE, default=DEFAULT_STREAM_SOURCE): vol.Optional(CONF_STREAM_SOURCE, default=DEFAULT_STREAM_SOURCE):
vol.All(vol.In(STREAM_SOURCE_LIST)), vol.All(vol.In(STREAM_SOURCE_LIST)),
vol.Optional(CONF_FFMPEG_ARGUMENTS): cv.string, vol.Optional(CONF_FFMPEG_ARGUMENTS, default=DEFAULT_ARGUMENTS):
cv.string,
vol.Optional(CONF_SCAN_INTERVAL, default=SCAN_INTERVAL): vol.Optional(CONF_SCAN_INTERVAL, default=SCAN_INTERVAL):
cv.time_period, cv.time_period,
vol.Optional(CONF_SENSORS): vol.Optional(CONF_SENSORS):

View File

@@ -3,7 +3,7 @@ import asyncio
import logging import logging
from homeassistant.components.camera import ( from homeassistant.components.camera import (
Camera, SUPPORT_STREAM) Camera, SUPPORT_ON_OFF, SUPPORT_STREAM)
from homeassistant.components.ffmpeg import DATA_FFMPEG from homeassistant.components.ffmpeg import DATA_FFMPEG
from homeassistant.const import CONF_NAME from homeassistant.const import CONF_NAME
from homeassistant.helpers.aiohttp_client import ( from homeassistant.helpers.aiohttp_client import (
@@ -39,18 +39,23 @@ class AmcrestCam(Camera):
super(AmcrestCam, self).__init__() super(AmcrestCam, self).__init__()
self._name = amcrest.name self._name = amcrest.name
self._camera = amcrest.device self._camera = amcrest.device
self._base_url = self._camera.get_base_url()
self._ffmpeg = hass.data[DATA_FFMPEG] self._ffmpeg = hass.data[DATA_FFMPEG]
self._ffmpeg_arguments = amcrest.ffmpeg_arguments self._ffmpeg_arguments = amcrest.ffmpeg_arguments
self._stream_source = amcrest.stream_source self._stream_source = amcrest.stream_source
self._resolution = amcrest.resolution self._resolution = amcrest.resolution
self._token = self._auth = amcrest.authentication self._token = self._auth = amcrest.authentication
self._is_recording = False
self._model = None
self._snapshot_lock = asyncio.Lock() self._snapshot_lock = asyncio.Lock()
async def async_camera_image(self): async def async_camera_image(self):
"""Return a still image response from the camera.""" """Return a still image response from the camera."""
from amcrest import AmcrestError from amcrest import AmcrestError
if not self.is_on:
_LOGGER.error(
'Attempt to take snaphot when %s camera is off', self.name)
return None
async with self._snapshot_lock: async with self._snapshot_lock:
try: try:
# Send the request to snap a picture and return raw jpg data # Send the request to snap a picture and return raw jpg data
@@ -59,7 +64,8 @@ class AmcrestCam(Camera):
return response.data return response.data
except AmcrestError as error: except AmcrestError as error:
_LOGGER.error( _LOGGER.error(
'Could not get camera image due to error %s', error) 'Could not get image from %s camera due to error: %s',
self.name, error)
return None return None
async def handle_async_mjpeg_stream(self, request): async def handle_async_mjpeg_stream(self, request):
@@ -94,6 +100,8 @@ class AmcrestCam(Camera):
finally: finally:
await stream.close() await stream.close()
# Entity property overrides
@property @property
def name(self): def name(self):
"""Return the name of this camera.""" """Return the name of this camera."""
@@ -102,9 +110,80 @@ class AmcrestCam(Camera):
@property @property
def supported_features(self): def supported_features(self):
"""Return supported features.""" """Return supported features."""
return SUPPORT_STREAM return SUPPORT_ON_OFF | SUPPORT_STREAM
# Camera property overrides
@property
def is_recording(self):
"""Return true if the device is recording."""
return self._is_recording
@property
def brand(self):
"""Return the camera brand."""
return 'Amcrest'
@property
def model(self):
"""Return the camera model."""
return self._model
@property @property
def stream_source(self): def stream_source(self):
"""Return the source of the stream.""" """Return the source of the stream."""
return self._camera.rtsp_url(typeno=self._resolution) return self._camera.rtsp_url(typeno=self._resolution)
@property
def is_on(self):
"""Return true if on."""
return self.is_streaming
# Other Entity method overrides
def update(self):
"""Update entity status."""
from amcrest import AmcrestError
_LOGGER.debug('Pulling data from %s camera', self.name)
if self._model is None:
try:
self._model = self._camera.device_type.split('=')[-1].strip()
except AmcrestError as error:
_LOGGER.error(
'Could not get %s camera model due to error: %s',
self.name, error)
self._model = ''
try:
self.is_streaming = self._camera.video_enabled
self._is_recording = self._camera.record_mode == 'Manual'
except AmcrestError as error:
_LOGGER.error(
'Could not get %s camera attributes due to error: %s',
self.name, error)
# Other Camera method overrides
def turn_off(self):
"""Turn off camera."""
self._enable_video_stream(False)
def turn_on(self):
"""Turn on camera."""
self._enable_video_stream(True)
# Utility methods
def _enable_video_stream(self, enable):
"""Enable or disable camera video stream."""
from amcrest import AmcrestError
try:
self._camera.video_enabled = enable
except AmcrestError as error:
_LOGGER.error(
'Could not %s %s camera video stream due to error: %s',
'enable' if enable else 'disable', self.name, error)
else:
self.is_streaming = enable
self.schedule_update_ha_state()

View File

@@ -0,0 +1,12 @@
{
"domain": "amcrest",
"name": "Amcrest",
"documentation": "https://www.home-assistant.io/components/amcrest",
"requirements": [
"amcrest==1.3.0"
],
"dependencies": [
"ffmpeg"
],
"codeowners": []
}

View File

@@ -75,19 +75,6 @@ class AmcrestSensor(Entity):
"""Get the latest data and updates the state.""" """Get the latest data and updates the state."""
_LOGGER.debug("Pulling data from %s sensor.", self._name) _LOGGER.debug("Pulling data from %s sensor.", self._name)
try:
version, build_date = self._camera.software_information
self._attrs['Build Date'] = build_date.split('=')[-1]
self._attrs['Version'] = version.split('=')[-1]
except ValueError:
self._attrs['Build Date'] = 'Not Available'
self._attrs['Version'] = 'Not Available'
try:
self._attrs['Serial Number'] = self._camera.serial_number
except ValueError:
self._attrs['Serial Number'] = 'Not Available'
if self._sensor_type == 'motion_detector': if self._sensor_type == 'motion_detector':
self._state = self._camera.is_motion_detected self._state = self._camera.is_motion_detected
self._attrs['Record Mode'] = self._camera.record_mode self._attrs['Record Mode'] = self._camera.record_mode

View File

@@ -0,0 +1,10 @@
{
"domain": "ampio",
"name": "Ampio",
"documentation": "https://www.home-assistant.io/components/ampio",
"requirements": [
"asmog==0.0.6"
],
"dependencies": [],
"codeowners": []
}

View File

@@ -0,0 +1,10 @@
{
"domain": "android_ip_webcam",
"name": "Android ip webcam",
"documentation": "https://www.home-assistant.io/components/android_ip_webcam",
"requirements": [
"pydroid-ipcam==0.8"
],
"dependencies": [],
"codeowners": []
}

View File

@@ -1,6 +1 @@
""" """Support for functionality to interact with Android TV/Fire TV devices."""
Support for functionality to interact with Android TV and Fire TV devices.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.androidtv/
"""

View File

@@ -0,0 +1,10 @@
{
"domain": "androidtv",
"name": "Androidtv",
"documentation": "https://www.home-assistant.io/components/androidtv",
"requirements": [
"androidtv==0.0.15"
],
"dependencies": [],
"codeowners": []
}

View File

@@ -1,9 +1,4 @@
""" """Support for functionality to interact with Android TV / Fire TV devices."""
Support for functionality to interact with Android TV and Fire TV devices.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.androidtv/
"""
import functools import functools
import logging import logging
import voluptuous as vol import voluptuous as vol
@@ -23,7 +18,7 @@ import homeassistant.helpers.config_validation as cv
ANDROIDTV_DOMAIN = 'androidtv' ANDROIDTV_DOMAIN = 'androidtv'
REQUIREMENTS = ['androidtv==0.0.14'] REQUIREMENTS = ['androidtv==0.0.15']
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
@@ -299,12 +294,12 @@ class ADBDevice(MediaPlayerDevice):
@adb_decorator() @adb_decorator()
def media_previous_track(self): def media_previous_track(self):
"""Send previous track command (results in rewind).""" """Send previous track command (results in rewind)."""
self.aftv.media_previous() self.aftv.media_previous_track()
@adb_decorator() @adb_decorator()
def media_next_track(self): def media_next_track(self):
"""Send next track command (results in fast-forward).""" """Send next track command (results in fast-forward)."""
self.aftv.media_next() self.aftv.media_next_track()
@adb_decorator() @adb_decorator()
def adb_command(self, cmd): def adb_command(self, cmd):
@@ -329,11 +324,11 @@ class AndroidTVDevice(ADBDevice):
turn_off_command) turn_off_command)
self._device = None self._device = None
self._muted = None
self._device_properties = self.aftv.device_properties self._device_properties = self.aftv.device_properties
self._is_volume_muted = None
self._unique_id = 'androidtv-{}-{}'.format( self._unique_id = 'androidtv-{}-{}'.format(
name, self._device_properties['serialno']) name, self._device_properties['serialno'])
self._volume = None self._volume_level = None
@adb_decorator(override_available=True) @adb_decorator(override_available=True)
def update(self): def update(self):
@@ -350,16 +345,16 @@ class AndroidTVDevice(ADBDevice):
if not self._available: if not self._available:
return return
# Get the `state`, `current_app`, and `running_apps`. # Get the updated state and attributes.
state, self._current_app, self._device, self._muted, self._volume = \ state, self._current_app, self._device, self._is_volume_muted, \
self.aftv.update() self._volume_level = self.aftv.update()
self._state = ANDROIDTV_STATES[state] self._state = ANDROIDTV_STATES[state]
@property @property
def is_volume_muted(self): def is_volume_muted(self):
"""Boolean if volume is currently muted.""" """Boolean if volume is currently muted."""
return self._muted return self._is_volume_muted
@property @property
def source(self): def source(self):
@@ -379,7 +374,7 @@ class AndroidTVDevice(ADBDevice):
@property @property
def volume_level(self): def volume_level(self):
"""Return the volume level.""" """Return the volume level."""
return self._volume return self._volume_level
@adb_decorator() @adb_decorator()
def media_stop(self): def media_stop(self):
@@ -394,12 +389,12 @@ class AndroidTVDevice(ADBDevice):
@adb_decorator() @adb_decorator()
def volume_down(self): def volume_down(self):
"""Send volume down command.""" """Send volume down command."""
self.aftv.volume_down() self._volume_level = self.aftv.volume_down(self._volume_level)
@adb_decorator() @adb_decorator()
def volume_up(self): def volume_up(self):
"""Send volume up command.""" """Send volume up command."""
self.aftv.volume_up() self._volume_level = self.aftv.volume_up(self._volume_level)
class FireTVDevice(ADBDevice): class FireTVDevice(ADBDevice):

View File

@@ -0,0 +1,10 @@
{
"domain": "anel_pwrctrl",
"name": "Anel pwrctrl",
"documentation": "https://www.home-assistant.io/components/anel_pwrctrl",
"requirements": [
"anel_pwrctrl-homeassistant==0.0.1.dev2"
],
"dependencies": [],
"codeowners": []
}

View File

@@ -1,9 +1,4 @@
""" """Support for ANEL PwrCtrl switches."""
Support for ANEL PwrCtrl switches.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.pwrctrl/
"""
import logging import logging
import socket import socket
from datetime import timedelta from datetime import timedelta

View File

@@ -0,0 +1,10 @@
{
"domain": "anthemav",
"name": "Anthemav",
"documentation": "https://www.home-assistant.io/components/anthemav",
"requirements": [
"anthemav==1.1.10"
],
"dependencies": [],
"codeowners": []
}

View File

@@ -1,9 +1,4 @@
""" """Support for Anthem Network Receivers and Processors."""
Support for Anthem Network Receivers and Processors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.anthemav/
"""
import logging import logging
import voluptuous as vol import voluptuous as vol

View File

@@ -0,0 +1,10 @@
{
"domain": "apcupsd",
"name": "Apcupsd",
"documentation": "https://www.home-assistant.io/components/apcupsd",
"requirements": [
"apcaccess==0.0.13"
],
"dependencies": [],
"codeowners": []
}

View File

@@ -0,0 +1,12 @@
{
"domain": "api",
"name": "Home Assistant API",
"documentation": "https://www.home-assistant.io/components/api",
"requirements": [],
"dependencies": [
"http"
],
"codeowners": [
"@home-assistant/core"
]
}

View File

@@ -1 +0,0 @@
"""The api_streams component."""

View File

@@ -0,0 +1,10 @@
{
"domain": "apns",
"name": "Apns",
"documentation": "https://www.home-assistant.io/components/apns",
"requirements": [
"apns2==0.3.0"
],
"dependencies": [],
"codeowners": []
}

View File

@@ -1,9 +1,4 @@
""" """APNS Notification platform."""
APNS Notification platform.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/notify.apns/
"""
import logging import logging
import os import os

View File

@@ -0,0 +1,10 @@
{
"domain": "apple_tv",
"name": "Apple tv",
"documentation": "https://www.home-assistant.io/components/apple_tv",
"requirements": [
"pyatv==0.3.12"
],
"dependencies": [],
"codeowners": []
}

View File

@@ -0,0 +1,10 @@
{
"domain": "aqualogic",
"name": "Aqualogic",
"documentation": "https://www.home-assistant.io/components/aqualogic",
"requirements": [
"aqualogic==1.0"
],
"dependencies": [],
"codeowners": []
}

View File

@@ -0,0 +1,10 @@
{
"domain": "aquostv",
"name": "Aquostv",
"documentation": "https://www.home-assistant.io/components/aquostv",
"requirements": [
"sharp_aquos_rc==0.3.2"
],
"dependencies": [],
"codeowners": []
}

View File

@@ -1,9 +1,4 @@
""" """Support for interface with an Aquos TV."""
Support for interface with an Aquos TV.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.aquostv/
"""
import logging import logging
import voluptuous as vol import voluptuous as vol

View File

@@ -0,0 +1,12 @@
{
"domain": "arduino",
"name": "Arduino",
"documentation": "https://www.home-assistant.io/components/arduino",
"requirements": [
"PyMata==2.14"
],
"dependencies": [],
"codeowners": [
"@fabaff"
]
}

View File

@@ -1,9 +1,4 @@
""" """Support for an exposed aREST RESTful API of a device."""
Support for an exposed aREST RESTful API of a device.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.arest/
"""
import logging import logging
from datetime import timedelta from datetime import timedelta

View File

@@ -0,0 +1,10 @@
{
"domain": "arest",
"name": "Arest",
"documentation": "https://www.home-assistant.io/components/arest",
"requirements": [],
"dependencies": [],
"codeowners": [
"@fabaff"
]
}

View File

@@ -1,9 +1,4 @@
""" """Support for an exposed aREST RESTful API of a device."""
Support for an exposed aREST RESTful API of a device.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.arest/
"""
import logging import logging
from datetime import timedelta from datetime import timedelta

View File

@@ -1,9 +1,4 @@
""" """Support for an exposed aREST RESTful API of a device."""
Support for an exposed aREST RESTful API of a device.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.arest/
"""
import logging import logging

View File

@@ -13,6 +13,8 @@ from homeassistant.helpers.dispatcher import async_dispatcher_connect
from . import DATA_ARLO, DEFAULT_BRAND, SIGNAL_UPDATE_ARLO from . import DATA_ARLO, DEFAULT_BRAND, SIGNAL_UPDATE_ARLO
DEPENDENCIES = ['arlo', 'ffmpeg']
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
ARLO_MODE_ARMED = 'armed' ARLO_MODE_ARMED = 'armed'
@@ -28,8 +30,7 @@ ATTR_UNSEEN_VIDEOS = 'unseen_videos'
ATTR_LAST_REFRESH = 'last_refresh' ATTR_LAST_REFRESH = 'last_refresh'
CONF_FFMPEG_ARGUMENTS = 'ffmpeg_arguments' CONF_FFMPEG_ARGUMENTS = 'ffmpeg_arguments'
DEFAULT_ARGUMENTS = '-pred 1'
DEPENDENCIES = ['arlo', 'ffmpeg']
POWERSAVE_MODE_MAPPING = { POWERSAVE_MODE_MAPPING = {
1: 'best_battery_life', 1: 'best_battery_life',
@@ -38,7 +39,7 @@ POWERSAVE_MODE_MAPPING = {
} }
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Optional(CONF_FFMPEG_ARGUMENTS): cv.string, vol.Optional(CONF_FFMPEG_ARGUMENTS, default=DEFAULT_ARGUMENTS): cv.string,
}) })

View File

@@ -0,0 +1,10 @@
{
"domain": "arlo",
"name": "Arlo",
"documentation": "https://www.home-assistant.io/components/arlo",
"requirements": [
"pyarlo==0.2.3"
],
"dependencies": [],
"codeowners": []
}

View File

@@ -1,9 +1,4 @@
""" """Support for Aruba Access Points."""
Support for Aruba Access Points.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.aruba/
"""
import logging import logging
import re import re

View File

@@ -0,0 +1,10 @@
{
"domain": "aruba",
"name": "Aruba",
"documentation": "https://www.home-assistant.io/components/aruba",
"requirements": [
"pexpect==4.6.0"
],
"dependencies": [],
"codeowners": []
}

View File

@@ -0,0 +1,8 @@
{
"domain": "arwn",
"name": "Arwn",
"documentation": "https://www.home-assistant.io/components/arwn",
"requirements": [],
"dependencies": [],
"codeowners": []
}

View File

@@ -1,9 +1,4 @@
""" """Support for collecting data from the ARWN project."""
Support for collecting data from the ARWN project.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.arwn/
"""
import json import json
import logging import logging

View File

@@ -0,0 +1,8 @@
{
"domain": "asterisk_cdr",
"name": "Asterisk cdr",
"documentation": "https://www.home-assistant.io/components/asterisk_cdr",
"requirements": [],
"dependencies": [],
"codeowners": []
}

View File

@@ -0,0 +1,10 @@
{
"domain": "asterisk_mbox",
"name": "Asterisk mbox",
"documentation": "https://www.home-assistant.io/components/asterisk_mbox",
"requirements": [
"asterisk_mbox==0.5.0"
],
"dependencies": [],
"codeowners": []
}

View File

@@ -1,9 +1,4 @@
""" """Support for ASUSWRT routers."""
Support for ASUSWRT routers.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.asuswrt/
"""
import logging import logging
from homeassistant.components.device_tracker import DeviceScanner from homeassistant.components.device_tracker import DeviceScanner

View File

@@ -0,0 +1,12 @@
{
"domain": "asuswrt",
"name": "Asuswrt",
"documentation": "https://www.home-assistant.io/components/asuswrt",
"requirements": [
"aioasuswrt==1.1.21"
],
"dependencies": [],
"codeowners": [
"@kennedyshead"
]
}

View File

@@ -1,9 +1,4 @@
""" """Asuswrt status sensors."""
Asuswrt status sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.asuswrt/
"""
import logging import logging
from homeassistant.helpers.entity import Entity from homeassistant.helpers.entity import Entity

View File

@@ -0,0 +1,10 @@
{
"domain": "august",
"name": "August",
"documentation": "https://www.home-assistant.io/components/august",
"requirements": [
"py-august==0.7.0"
],
"dependencies": [],
"codeowners": []
}

View File

@@ -1,9 +1,4 @@
""" """Support for aurora forecast data sensor."""
Support for aurora forecast data sensor.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.aurora/
"""
from datetime import timedelta from datetime import timedelta
import logging import logging

View File

@@ -0,0 +1,8 @@
{
"domain": "aurora",
"name": "Aurora",
"documentation": "https://www.home-assistant.io/components/aurora",
"requirements": [],
"dependencies": [],
"codeowners": []
}

View File

@@ -0,0 +1,12 @@
{
"domain": "auth",
"name": "Auth",
"documentation": "https://www.home-assistant.io/components/auth",
"requirements": [],
"dependencies": [
"http"
],
"codeowners": [
"@home-assistant/core"
]
}

View File

@@ -1,9 +1,4 @@
""" """Support for the Automatic platform."""
Support for the Automatic platform.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.automatic/
"""
import asyncio import asyncio
from datetime import timedelta from datetime import timedelta
import json import json

View File

@@ -0,0 +1,12 @@
{
"domain": "automatic",
"name": "Automatic",
"documentation": "https://www.home-assistant.io/components/automatic",
"requirements": [
"aioautomatic==0.6.5"
],
"dependencies": [],
"codeowners": [
"@armills"
]
}

View File

@@ -0,0 +1,12 @@
{
"domain": "automation",
"name": "Automation",
"documentation": "https://www.home-assistant.io/components/automation",
"requirements": [],
"dependencies": [
"group"
],
"codeowners": [
"@home-assistant/core"
]
}

View File

@@ -1,9 +1,4 @@
""" """Support for Avion dimmers."""
Support for Avion dimmers.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.avion/
"""
import importlib import importlib
import logging import logging
import time import time

View File

@@ -0,0 +1,10 @@
{
"domain": "avion",
"name": "Avion",
"documentation": "https://www.home-assistant.io/components/avion",
"requirements": [
"avion==0.10"
],
"dependencies": [],
"codeowners": []
}

View File

@@ -0,0 +1,10 @@
{
"domain": "awair",
"name": "Awair",
"documentation": "https://www.home-assistant.io/components/awair",
"requirements": [
"python_awair==0.0.4"
],
"dependencies": [],
"codeowners": []
}

View File

@@ -1,9 +1,4 @@
""" """Support for the Awair indoor air quality monitor."""
Support for the Awair indoor air quality monitor.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.awair/
"""
from datetime import timedelta from datetime import timedelta
import logging import logging
@@ -20,7 +15,7 @@ import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle, dt from homeassistant.util import Throttle, dt
REQUIREMENTS = ['python_awair==0.0.3'] REQUIREMENTS = ['python_awair==0.0.4']
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View File

@@ -0,0 +1,13 @@
{
"domain": "aws",
"name": "Aws",
"documentation": "https://www.home-assistant.io/components/aws",
"requirements": [
"aiobotocore==0.10.2"
],
"dependencies": [],
"codeowners": [
"@awarecan",
"@robbiet480"
]
}

View File

@@ -1 +0,0 @@
"""The aws_lambda component."""

View File

@@ -0,0 +1,10 @@
{
"domain": "aws_lambda",
"name": "Aws lambda",
"documentation": "https://www.home-assistant.io/components/aws_lambda",
"requirements": [
"boto3==1.9.16"
],
"dependencies": [],
"codeowners": []
}

View File

@@ -1,94 +0,0 @@
"""
AWS Lambda platform for notify component.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/notify.aws_lambda/
"""
import base64
import json
import logging
import voluptuous as vol
from homeassistant.const import CONF_NAME, CONF_PLATFORM
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.json import JSONEncoder
from homeassistant.components.notify import (ATTR_TARGET, PLATFORM_SCHEMA,
BaseNotificationService)
REQUIREMENTS = ['boto3==1.9.16']
_LOGGER = logging.getLogger(__name__)
CONF_REGION = 'region_name'
CONF_ACCESS_KEY_ID = 'aws_access_key_id'
CONF_SECRET_ACCESS_KEY = 'aws_secret_access_key'
CONF_PROFILE_NAME = 'profile_name'
CONF_CONTEXT = 'context'
ATTR_CREDENTIALS = 'credentials'
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Optional(CONF_REGION, default='us-east-1'): cv.string,
vol.Inclusive(CONF_ACCESS_KEY_ID, ATTR_CREDENTIALS): cv.string,
vol.Inclusive(CONF_SECRET_ACCESS_KEY, ATTR_CREDENTIALS): cv.string,
vol.Exclusive(CONF_PROFILE_NAME, ATTR_CREDENTIALS): cv.string,
vol.Optional(CONF_CONTEXT, default=dict()): vol.Coerce(dict)
})
def get_service(hass, config, discovery_info=None):
"""Get the AWS Lambda notification service."""
_LOGGER.warning(
"aws_lambda notify platform is deprecated, please replace it"
" with aws component. This config will become invalid in version 0.92."
" See https://www.home-assistant.io/components/aws/ for details."
)
context_str = json.dumps({'custom': config[CONF_CONTEXT]}, cls=JSONEncoder)
context_b64 = base64.b64encode(context_str.encode('utf-8'))
context = context_b64.decode('utf-8')
import boto3
aws_config = config.copy()
del aws_config[CONF_PLATFORM]
del aws_config[CONF_NAME]
del aws_config[CONF_CONTEXT]
profile = aws_config.get(CONF_PROFILE_NAME)
if profile is not None:
boto3.setup_default_session(profile_name=profile)
del aws_config[CONF_PROFILE_NAME]
lambda_client = boto3.client("lambda", **aws_config)
return AWSLambda(lambda_client, context)
class AWSLambda(BaseNotificationService):
"""Implement the notification service for the AWS Lambda service."""
def __init__(self, lambda_client, context):
"""Initialize the service."""
self.client = lambda_client
self.context = context
def send_message(self, message="", **kwargs):
"""Send notification to specified LAMBDA ARN."""
targets = kwargs.get(ATTR_TARGET)
if not targets:
_LOGGER.info("At least 1 target is required")
return
for target in targets:
cleaned_kwargs = dict((k, v) for k, v in kwargs.items() if v)
payload = {"message": message}
payload.update(cleaned_kwargs)
self.client.invoke(FunctionName=target,
Payload=json.dumps(payload),
ClientContext=self.context)

View File

@@ -1 +0,0 @@
"""The aws_sns component."""

View File

@@ -0,0 +1,10 @@
{
"domain": "aws_sns",
"name": "Aws sns",
"documentation": "https://www.home-assistant.io/components/aws_sns",
"requirements": [
"boto3==1.9.16"
],
"dependencies": [],
"codeowners": []
}

View File

@@ -1,84 +0,0 @@
"""
AWS SNS platform for notify component.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/notify.aws_sns/
"""
import json
import logging
import voluptuous as vol
from homeassistant.const import CONF_NAME, CONF_PLATFORM
import homeassistant.helpers.config_validation as cv
from homeassistant.components.notify import (
ATTR_TARGET, ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA,
BaseNotificationService)
_LOGGER = logging.getLogger(__name__)
REQUIREMENTS = ["boto3==1.9.16"]
CONF_REGION = 'region_name'
CONF_ACCESS_KEY_ID = 'aws_access_key_id'
CONF_SECRET_ACCESS_KEY = 'aws_secret_access_key'
CONF_PROFILE_NAME = 'profile_name'
ATTR_CREDENTIALS = 'credentials'
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Optional(CONF_REGION, default='us-east-1'): cv.string,
vol.Inclusive(CONF_ACCESS_KEY_ID, ATTR_CREDENTIALS): cv.string,
vol.Inclusive(CONF_SECRET_ACCESS_KEY, ATTR_CREDENTIALS): cv.string,
vol.Exclusive(CONF_PROFILE_NAME, ATTR_CREDENTIALS): cv.string,
})
def get_service(hass, config, discovery_info=None):
"""Get the AWS SNS notification service."""
_LOGGER.warning(
"aws_sns notify platform is deprecated, please replace it"
" with aws component. This config will become invalid in version 0.92."
" See https://www.home-assistant.io/components/aws/ for details."
)
import boto3
aws_config = config.copy()
del aws_config[CONF_PLATFORM]
del aws_config[CONF_NAME]
profile = aws_config.get(CONF_PROFILE_NAME)
if profile is not None:
boto3.setup_default_session(profile_name=profile)
del aws_config[CONF_PROFILE_NAME]
sns_client = boto3.client("sns", **aws_config)
return AWSSNS(sns_client)
class AWSSNS(BaseNotificationService):
"""Implement the notification service for the AWS SNS service."""
def __init__(self, sns_client):
"""Initialize the service."""
self.client = sns_client
def send_message(self, message="", **kwargs):
"""Send notification to specified SNS ARN."""
targets = kwargs.get(ATTR_TARGET)
if not targets:
_LOGGER.info("At least 1 target is required")
return
message_attributes = {k: {"StringValue": json.dumps(v),
"DataType": "String"}
for k, v in kwargs.items() if v}
for target in targets:
self.client.publish(TargetArn=target, Message=message,
Subject=kwargs.get(ATTR_TITLE,
ATTR_TITLE_DEFAULT),
MessageAttributes=message_attributes)

View File

@@ -1 +0,0 @@
"""The aws_sqs component."""

View File

@@ -0,0 +1,10 @@
{
"domain": "aws_sqs",
"name": "Aws sqs",
"documentation": "https://www.home-assistant.io/components/aws_sqs",
"requirements": [
"boto3==1.9.16"
],
"dependencies": [],
"codeowners": []
}

View File

@@ -1,86 +0,0 @@
"""
AWS SQS platform for notify component.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/notify.aws_sqs/
"""
import json
import logging
import voluptuous as vol
from homeassistant.const import CONF_NAME, CONF_PLATFORM
import homeassistant.helpers.config_validation as cv
from homeassistant.components.notify import (ATTR_TARGET, PLATFORM_SCHEMA,
BaseNotificationService)
_LOGGER = logging.getLogger(__name__)
REQUIREMENTS = ["boto3==1.9.16"]
CONF_REGION = 'region_name'
CONF_ACCESS_KEY_ID = 'aws_access_key_id'
CONF_SECRET_ACCESS_KEY = 'aws_secret_access_key'
CONF_PROFILE_NAME = 'profile_name'
ATTR_CREDENTIALS = 'credentials'
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Optional(CONF_REGION, default='us-east-1'): cv.string,
vol.Inclusive(CONF_ACCESS_KEY_ID, ATTR_CREDENTIALS): cv.string,
vol.Inclusive(CONF_SECRET_ACCESS_KEY, ATTR_CREDENTIALS): cv.string,
vol.Exclusive(CONF_PROFILE_NAME, ATTR_CREDENTIALS): cv.string,
})
def get_service(hass, config, discovery_info=None):
"""Get the AWS SQS notification service."""
_LOGGER.warning(
"aws_sqs notify platform is deprecated, please replace it"
" with aws component. This config will become invalid in version 0.92."
" See https://www.home-assistant.io/components/aws/ for details."
)
import boto3
aws_config = config.copy()
del aws_config[CONF_PLATFORM]
del aws_config[CONF_NAME]
profile = aws_config.get(CONF_PROFILE_NAME)
if profile is not None:
boto3.setup_default_session(profile_name=profile)
del aws_config[CONF_PROFILE_NAME]
sqs_client = boto3.client("sqs", **aws_config)
return AWSSQS(sqs_client)
class AWSSQS(BaseNotificationService):
"""Implement the notification service for the AWS SQS service."""
def __init__(self, sqs_client):
"""Initialize the service."""
self.client = sqs_client
def send_message(self, message="", **kwargs):
"""Send notification to specified SQS ARN."""
targets = kwargs.get(ATTR_TARGET)
if not targets:
_LOGGER.info("At least 1 target is required")
return
for target in targets:
cleaned_kwargs = dict((k, v) for k, v in kwargs.items() if v)
message_body = {"message": message}
message_body.update(cleaned_kwargs)
message_attributes = {}
for key, val in cleaned_kwargs.items():
message_attributes[key] = {"StringValue": json.dumps(val),
"DataType": "String"}
self.client.send_message(QueueUrl=target,
MessageBody=json.dumps(message_body),
MessageAttributes=message_attributes)

View File

@@ -0,0 +1,26 @@
{
"config": {
"abort": {
"already_configured": "Enheten er allerede konfigurert",
"bad_config_file": "D\u00e5rlig data fra konfigurasjonsfilen",
"link_local_address": "Linking av lokale adresser st\u00f8ttes ikke"
},
"error": {
"already_configured": "Enheten er allerede konfigurert",
"device_unavailable": "Enheten er ikke tilgjengelig",
"faulty_credentials": "Ugyldig brukerlegitimasjon"
},
"step": {
"user": {
"data": {
"host": "Vert",
"password": "Passord",
"port": "Port",
"username": "Brukernavn"
},
"title": "Sett opp Axis enhet"
}
},
"title": "Axis enhet"
}
}

Some files were not shown because too many files have changed in this diff Show More