1
mirror of https://github.com/home-assistant/core synced 2024-07-27 18:58:57 +02:00
Commit Graph

536 Commits

Author SHA1 Message Date
David Straub
86d410d863
Add Home Connect integration (#29214) 2020-05-05 11:26:14 +02:00
shbatm
4be1006b71
ISY994 migration to PyISY v2 (Structure Changes to enable upgrade, Part 1) (#35212)
* ISY994 Structure updates in prep for PyISYv2 (Part 1)

- Correct node categorization.
- Move constants to separate file.
- Consolidate Logging to Constants file.
- Use Home Assistant Constants where possible.
- Use string literals where possible.
- Rename "domain" to "platform" in most places.
- Add additional device support (NODE_FILTER updates).

* Update categorize_programs per review

* add @shbatm as codeowner for ISY994 integration
2020-05-04 19:21:40 -05:00
On Freund
a44724fdcc
Add codeowner to Monoprice integration (#35111) 2020-05-03 13:45:39 +02:00
Martin Hjelmare
aeb891649e
Add zwave mqtt (#34987) 2020-05-03 02:54:16 +02:00
Jason Hunter
850b5cb02b
Config flow for ONVIF (#34520) 2020-04-30 23:15:40 -07:00
J. Nick Koston
e7157f2164
Fix restoring isy994 brightness with no previous state (#34972) 2020-04-30 22:36:01 -07:00
clssn
15b1a9ecea
Add numato integration (#33816)
* Add support for Numato 32 port USB GPIO boards

Included are a binary_sensor, sensor and switch component
implementations. The binary_sensor interface pushes updates via
registered callback functions, so no need to poll here.

Unit tests are included to test against a Numato device mockup.

* Refactor numato configuration due to PR finding

* Resolve minor review findings

* Bump numato-gpio requirement

* Load numato platforms during domain setup

According to review finding

* Guard from platform setup without discovery_info

According to review finding

* Move numato API state into hass.data

According to review finding.

* Avoid side effects in numato entity constructors

According to review finding

* Keep only first line of numato module docstrings

Removed reference to the documentation. Requested by reviewer.

* Minor improvements inspired by review findings

* Fix async tests

Pytest fixture was returning from the yield too early executing teardown
code during test execution.

* Improve test coverage

* Configure GPIO ports early

Review finding

* Move read_gpio callback to outside the loop

Also continue on failed switch setup, resolve other minor review
findings and correct some error messages

* Bump numato-gpio requirement

This fixes a crash during cleanup. When any device had a communication
problem, its cleanup would raise an exception which was not handled,
fell through to the caller and prevented the remaining devices from
being cleaned up.

* Call services directly

Define local helper functions for better readability.
Resolves a review finding.

* Assert something in every test

So not only coverage is satisfied but things are actually tested
to be in the expected state.
Resolves a review finding.

* Clarify scope of notification tests

Make unit test for hass NumatoAPI independent of Home Assistant (very basic test of notifications).
Improve the regular operations test for notifications.

* Test for hass.states after operating switches

Resolves a review finding.

* Check for wrong port directions

* WIP: Split numato tests to multiple files

test_hass_binary_sensor_notification still fails.

* Remove pytest asyncio decorator

Apears to be redundant. Resolves a review finding.

* Call switch services directly.

Resolves a review finding.

* Remove obsolete inline pylint config

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Improve the numato_gpio module mockup

Resolves a review finding.

* Remove needless explicit conversions to str

Resolves review findings.

* Test setup of binary_sensor callbacks

* Fix test_hass_binary_sensor_notification

* Add forgotten await

Review finding.

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-04-30 14:23:30 +02:00
J. Nick Koston
6c18a2cae2
Config flow for hunterdouglas_powerview (#34795)
Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>
2020-04-29 14:24:57 -07:00
rajlaud
5e249aac5f
Refactor squeezebox (#34731)
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
2020-04-27 12:15:00 +02:00
MatsNl
ccc3ce81f9
Add Atag One thermostat integration (#32361)
* add atag integration

* ignore

* generated

* Update .gitignore

* requirements update

* update coveragerc

* Revert "update coveragerc"

* make entity_types more readable

* add DOMAIN to listener

* entity name

* Use DataUpdateCoordinator

* fix translations

* enable preset_modes

* fix water_heater

* update coveragerc

* remove scan_interval

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Apply suggestions from code review

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* fixes review remarks

* fix flake8 errors

* ensure correct HVACmode

* add away mode

* use write_ha_state instead of refresh

* remove OFF support, add Fahrenheit

* rename test_config_flow.py

Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-04-22 18:09:51 +02:00
Rami Mosleh
2a6948e696
Add Islamic Prayer Times config flow (#31590)
* Add Islamic Prayer Times config_flow

* Add Islamic Prayer Times config_flow

* handle options update and fix tests

* fix sensor update handling

* fix pylint

* fix scheduled update and add test

* update test_init

* update flow options to show drop list

* clean up code

* async scheduling and revert state to timestamp

* fix update retry method

* update strings

* keep title as root key
2020-04-20 14:22:48 +02:00
Xiaonan Shen
61a5793073
Add Braava support to iRobot Roomba component (#33616)
* Add Braava support to iRobot Roomba component

* Replace async_add_job with async_add_executor_job in roomba

* Improve readability in roomba

* Improve error handling in roomba

* Cleanup async_update in roomba

* Split into multiple files in roomba

* Hide protocal details in braava

* Switch to push in braava

* Bump roombapy version to 1.5.1

* Add roomba files to .coveragerc

* Fix typo

* Remove side effects from init in roomba

* Implement StateVacuumDevice in Roomba

* Add IRobotEntity base class to braava

* Fix state in roomba

* Add @shenxn as a codeowner of braava
2020-04-18 17:32:41 -05:00
João Gabriel
42b6ec2fb5
Add config flow to panasonic_viera component (#33829)
* Updating the panasonic_viera component

* Updating .coveragerc

* Removing testplatform

* Updating strings.json

* Commit before rebase

* Commit before rebase

* Commit before rebase

* Commit before rebase

* Commit before rebase

* Adding tests and stuff

* Fixing permission issues

* Ignoring Pylint warnings

* Fixing one more Pylint warning

* Refactoring

* Commiting changes - part 1

* Commiting changes: part 2

* Turning unknown error logs into exception logs

* Update strings.json

* Rebasing

* Updating the panasonic_viera component

* Removing testplatform

* Updating strings.json

* Commit before rebase

* Commit before rebase

* Commit before rebase

* Commit before rebase

* Commit before rebase

* Adding tests and stuff

* Fixing permission issues

* Ignoring Pylint warnings

* Fixing one more Pylint warning

* Refactoring

* Commiting changes - part 1

* Commiting changes: part 2

* Turning unknown error logs into exception logs

* Adding pt-BR translation

* Removing Brazilian Portugues translations

* Modifying error handling

* Adding SOAPError to except handling

* Updating translation

* Refactoring async_step_import

* Fixing indentation

* Fixing requirements after rebase

* Fixing translations

* Fixing issues after rebase

* Routing import step to user step

* Adding myself as a codeowner
2020-04-18 05:19:01 +02:00
Chris Talkington
ede432ba71
Improve Sonarr Upcoming Time Handling (#34224) 2020-04-16 14:11:00 -07:00
Arjan van Balken
3d9ae1b8bd
Add device tracking support for the Arris TG2492LG router (#30972)
* Add device tracker based on arris-tg2492lg

* Return name of device and update version of arris_tg2492lg

* Update CODEOWNERS, requirements_all.txt and .coveragerc

* Change default url to host

* Use f-strings

Co-Authored-By: Franck Nijhof <frenck@frenck.nl>

* Clean up

* Fix formatting

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-04-16 17:10:32 +02:00
Fredrik Erlandsson
337cc6e79f
Fix various Daikin issues (#34249)
* various Daikin fixes

* make timeout a constant
2020-04-15 15:12:10 +02:00
Maciej Bieniek
6dc6f2d099
Add config flow for braviatv integration (#33774)
* Run scripts

* Improvement strings

* Fix FlowOptions update listener

* Update .ceveragerc

* Add tests

* Better strings

* Add test for OptionsFlow

* Run gen_requirements_all.py once again

* Fix pylint errors

* Log error when there is no bravia.conf file during import

* Improvement strings

* Use braviarc object from hass.data in options flow

* Use async_add_executor_job for IO

* Fix options flow test

* Fix tests

* Remove host_reachable method

* Remove dependencies

* Change setup_platform method to async

* Remove calling system_info

* Save mac in the config entry

* Fix get ignore sources

* Fix read config from file

* Remove the side effect from init

* Fix user_input for user step

* Switch OrderedDict to dict

* New config_entry instance for each test

* Revert change

* Patch async_setup_entry in test_import

* Change a way to create source list

* Consolidate repeated block of code

* Update tests

* Suggested change

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Suggested channge

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Suggested change

* Patch async_setup_entry

* Remove unnecesary if

* suggested change

* Suggested change

* Fix tests

* Fix pylint error

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-04-15 01:04:06 +02:00
jrester
6924192523
Use updated powerwall client API library (#34139)
* Use updated powerwall client API library

* Increase instant_power precision to 3

* Add @jrester as code owner for powerwall
2020-04-13 21:59:50 +02:00
J. Nick Koston
5d649b2541
Convert homekit thermostats to use service callbacks (#34073)
* Convert homekit thermostats to use service callbacks

Service callbacks allow us to get all the temperature
changes in one request so we can avoid all the
need to store state and debounce.

* remove excess debug

* Fix lock and light tests

* Ensure all code for Thermostats has coverage

* I am answering all the homekit cases anyways so might as well be aware of regressions

* Make lock notifications reliable

* Update homeassistant/components/homekit/type_lights.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-04-12 17:38:33 -05:00
Save me
8c4a139aeb
Add config_flow for Roomba (#33302)
* Add config_flow for roomba

* Get options to connect

* Fix options in config flow

* Fix syntax in config_flow

* Remove name (not necessary)

* Add bin sensor

* Add Battery sensor

* Add async_connect

* Fix typo

* Add Model and Software version

* Update Roombapy 1.5.0

* Add validate_input

* Add connect and disconnect functions

* Remove test config flow

* Add variables after loop

* Fix translate

* Fix typo

* Fix state of bin

* Update homeassistant/components/roomba/__init__.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/config_flow.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/config_flow.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/config_flow.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/config_flow.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/config_flow.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/__init__.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/__init__.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/__init__.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/config_flow.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Remove invalid auth

* Add call function reported_state

* Add options reload

* Fix tracelog

* Set entry_id for config_entry

* Fix DOMAIN unsed-import

* Update homeassistant/components/roomba/config_flow.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/config_flow.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Add unique_id for entry

* Fix device info

* Add config_flow for roomba

* Get options to connect

* Fix options in config flow

* Fix syntax in config_flow

* Remove name (not necessary)

* Add bin sensor

* Add Battery sensor

* Add async_connect

* Fix typo

* Add Model and Software version

* Update Roombapy 1.5.0

* Add validate_input

* Add connect and disconnect functions

* Remove test config flow

* Add variables after loop

* Fix translate

* Fix typo

* Fix state of bin

* Update homeassistant/components/roomba/__init__.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/config_flow.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/config_flow.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/config_flow.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/config_flow.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/config_flow.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/__init__.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/__init__.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/__init__.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/config_flow.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Remove invalid auth

* Add call function reported_state

* Add options reload

* Fix tracelog

* Set entry_id for config_entry

* Fix DOMAIN unsed-import

* Update homeassistant/components/roomba/config_flow.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/config_flow.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Add unique_id for entry

* Fix device info

* syntax for mac (pyupgrade)

* Change single key to BLID

* Resolve dict conflict

* Update homeassistant/components/roomba/binary_sensor.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/sensor.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/.translations/en.json

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/strings.json

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Add description

* Revert "Remove test config flow"

This reverts commit 26a89422e8.

* Add tests

* Remove check if user none

* Replace CONF_USERNAME to CONF_BLID (breaking change)

* Update test_config_flow.py

* Add code owners

* Remove CONF_USERNAME (unused)

* Add multiple vacuum

* Add multiple vacuum

* Update homeassistant/components/roomba/__init__.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/__init__.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/__init__.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/__init__.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/__init__.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Fix syntax name

* Update homeassistant/components/roomba/__init__.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/__init__.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/__init__.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/__init__.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Remove CONF_PREFIX (unused)

* Update homeassistant/components/roomba/sensor.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Add import UNIT_PERCENTAGE

* Update homeassistant/components/roomba/__init__.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/roomba/__init__.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-04-11 10:55:00 -05:00
Fabian Affolter
9aa0e76d65
Update codeowners for seven_segments (#34027) 2020-04-11 15:27:28 +02:00
J. Nick Koston
ac9429988b
Add a config flow for flume (#33419)
* Add a config flow for flume

* Sensors no longer block Home Assistant startup
since the flume api can take > 60s to respond on
the first poll

* Update to 0.4.0 to resolve the blocking startup issue

* Missed conversion to FlumeAuth

* FlumeAuth can do i/o if the token is expired, wrap it

* workaround async_add_entities updating disabled entities

* Fix conflict
2020-04-08 16:29:59 -05:00
Erik Montnemery
5cfae3f177
Add emontnemery as codeowner for cast, mqtt (#33784) 2020-04-07 09:13:02 -07:00
Anton Verburg
93f7f78263
Support for pi4ioe5v9xxxx I2C IO expanders (#28847)
* Added support for the Pi4ioe5v9xxxx binary IO expanders.

* Correction for black failure

* Correction for black failure

* Fix for manifest.json

* Fix for flake8 fault missing a period

* Some modifications I made during tests seem to be disapeared, fixed flake8 and black test now

* WIP virtual thermostat

* WIP virtual thermostat

* WIP

* 100% tests coverage

* Manifest, codeowners, typo fix

* Lint problem

* Test file blacked

* Add a test case for b4dpxl's question

* Update CODEOWNERS

* Replacement of generic thermostat

* Cleaning

* Lint

* More lint

* Using external PyPI package, removed get()

* Fix flake8 checks

* removed virtual thermostat

* Re-fix black & isort

* Re-fix isort 2

* Update homeassistant/components/pi4ioe5v9xxxx/binary_sensor.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/pi4ioe5v9xxxx/binary_sensor.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/pi4ioe5v9xxxx/switch.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/pi4ioe5v9xxxx/switch.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/pi4ioe5v9xxxx/switch.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/pi4ioe5v9xxxx/switch.py

Co-Authored-By: J. Nick Koston <nick@koston.org>

* black for switch

* update to latest version manual merge

* Delete test_generic_thermostat.py

* Delete .gitignore

* Delete climate.py

* Delete manifest.json

* Delete test_climate.py

* Delete test_climate.py

* fix thermostat interference

* fix thermostat interference 2

* Fix pylint

* Update .pre-commit-config.yaml

Co-authored-by: Cyril <cyril.dubus@effipilot.com>
Co-authored-by: Niflou <dubuscyr@gmail.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-04-07 08:43:12 -05:00
Quentame
d99e228983
Add config flow to Synology DSM (#32704)
* Add config flow to Synology DSM

* Use proper sensor unique ID from flow + sensor name

* Add description to api_version

* Add authentication flow check

* Add device_info

* Add test_login_failed test

* Bump python-synology to 0.5.0

* 0.5.0 test updates

* Use NAS S/N as config_flow unique_id

* Add missed conf disks + volumes

* Review: async_unload the async_track_time_interval

* Fix NoneType for disks or volumes

* Keep all disks and volumes forever

* Update homeassistant/components/synology_dsm/.translations/en.json

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/synology_dsm/strings.json

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Fix "Keep all disks and volumes forever" for empty import

* Fix prettier

* Remove useless LOGGER in config flow

* Fix Synology DSM tests doing I/O

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-04-05 17:50:52 -05:00
Michal Ziemski
8d3a415d07
Add OpenERZ API integration (#30441)
* Adding OpenERZ integration

* Added unit tests

* Linter fixes, better friendly_name handling

* Increase coverage

* Review fixes

* fixup! Review fixes

* Refactor to use external openerz-api library

* fixup! Refactor to use external openerz-api library

* fixup! Refactor to use external openerz-api library

* fixup! Refactor to use external openerz-api library

* fixup! Refactor to use external openerz-api library
2020-04-05 05:04:41 +02:00
Robert Van Gorkom
ae22b5187a
Add vera config entries support (#29880)
* Adding vera config entries support.

* Fixing lint error.

* Applying minimal changes necessary to get config entries working.

* Addressing PR feedback by further reducing the scope of the change.

* Addressing PR feedback.

* Fixing pyvera import to make it easier to patch.
Addressing PR feedback regarding creation of controller and scheduling of async config flow actions.

* Updating code owners file.

* Small fixes.

* Adding a user config flow step.

* Adding optional configs for user config flow.

* Updating strings to be more clear to the user.

* Adding options flow.
Fixing some PR feedback.

* Better handling of options.
PR feedback changes.

* Using config registry to update config options.

* Better managing config from file or config from UI
Disabling config through UI if config is provided from a file.
More tests to account for these adjustments.

* Address PR feedback.

* Fixing test, merging with master.

* Disabling all Vera UI for configs managed by configuration.yml.
Adding more tests.

* Updating config based on unique_id.
Addressing additional PR feedback.

* Rebasing off dev.
Addressing feedback.

* Addressing PR feedback.
2020-04-03 09:49:50 +02:00
J. Nick Koston
cc443ff37a
Add config flow for nut (#33457)
* Convert nut to config flow

* Add a test for importing

* lint

* Address review items (part 1)

* Address review items (part 1)

* Cleanup unique id handling

* Update tests for new naming scheme

* No unique id, no device_info

* Remove sensor types

* Update tests to use resources that still exist
2020-03-31 19:08:27 -07:00
Chris Talkington
98f68f4798
Add Internet Printing Protocol (IPP) integration (#32859)
* Create __init__.py

* Create manifest.json

* Update zeroconf.py

* more work on integration

* more work on integration.

* add more sensor tests.

* Update const.py

* Update sensor.py

* more work on ipp.

* Update test_config_flow.py

* more work on ipp.

* Update config_flow.py

* Update config_flow.py
2020-03-30 16:13:47 -07:00
J. Nick Koston
f42804805c
Move Tado zone state handling into upstream python-tado library (#33195)
* Tado climate state moved to python-tado

* Resolve various incorrect states and add tests for known tado zone states

* Write state instead of calling for an update

This is a redux of pr #32564 with all of the zone state now moved into
python-tado and tests added for the various states.

* stale string

* add missing undos to dispachers

* remove unneeded hass

* naming

* rearrange

* fix water heater, add test

* fix water heater, add test

* switch hvac mode when changing temp if in auto/off/smart
2020-03-30 09:06:26 -05:00
jan iversen
dd3cd95954
Modbus patch, to allow communication with "slow" equipment using tcp (#32557)
* modbus: bumb pymodbus version to 2.3.0

pymodbus version 1.5.2 did not support asyncio, and in general
the async handling have been improved a lot in version 2.3.0.

updated core/requirement*txt

* updated core/CODEOWNERS

committing result of 'python3 -m script.hassfest'.

* modbus: change core connection to async

change setup() --> async_setup and update() --> async_update()

Use async_setup_platform() to complete the async connection to core.

listen for EVENT_HOMEASSISTANT_START happens in async_setup()
so it needs to be async_listen.

But listen for EVENT_HOMEASSISTANT_STOP happens in start_modbus()
which is a sync. function so it continues to be listen().

* modbus: move setup of pymodbus into modbushub

setup of pymodbus is logically connected to the class modbushub,
therefore move it into the class.

Delay construction of pymodbus client until event
EVENT_HOMEASSISTANT_START arrives.

* modbus: use pymodbus async library

convert pymodbus calls to refer to the async library.

Remark: connect() is no longer needed, it is done when constructing
the client. There are also automatic reconnect.

* modbus: use async update for read/write

Use async functions for read/write from pymodbus.

change thread.Lock() to asyncio.Lock()

* Modbus: patch for slow tcp equipment

When connecting, via Modbus-TCP, so some equipment (like the
huawei sun2000 inverter), they need time to prepare the protocol.

Solution is to add a asyncio.sleep(x) after the connect() and before
sending the first message.

Add optional parameter "delay" to Modbus configuration.
Default is 0, which means do not execute asyncio.sleep().

* Modbus: silence pylint false positive

pylint does not accept that a class construction __new__
can return a tuple.

* Modbus: move constants to const.py

Create const.py with constants only used in
the modbus integration.

Duplicate entries are removed, but NOT any entry that would
lead to a configuration change.

Some entries were the same but with different names, in this
case renaming is done.

Also correct the tests.

* Modbus: move connection error handling to ModbusHub

Connection error handling depends on the hub, not the
entity, therefore it is logical to have the handling in
ModbusHub.

All pymodbus call are added to 2 generic functions (read/write)
in order not to duplicate the error handling code.

Added property "available" to signal if the hub is connected.

* Modbus: CI cleanup

Solve CI problems.

* Modbus: remove close of client

close() no longer exist in the pymodbus library, use
del client instead.

* Modbus: correct review comments

Adjust code based on review comments.

* Modbus: remove twister dependency

Pymodbus in asyncio mode do not use twister but still throws a
warning if twister is not installed, this warning goes into
homeassistant.log and can thus cause confusion among users.

However installing twister just to avoid the warning is not
the best solution, therefore removing dependency on twister.

* Modbus: review, remove comments.

remove commented out code.
2020-03-29 12:39:30 -05:00
Colin Harrington
42cb5a5239
Calculate Plum Lightpad brightness and glowIntensity correctly (#33352)
* Plum Lightpad - glowIntensity is represented as a float/percentage
Calculate brightness from the glowIntensity instead of the glowIntensity from brightness.

* Renamed `_glowIntensity` to `_glow_intensity`

* Added Rounding, converting to an int, min and max boxing

* Added codeowners to the Plum Lightpad manifest.json
2020-03-28 21:01:22 -07:00
J. Nick Koston
18a4829314
Config flow for elkm1 (#33297)
* Config flow for elkm1

* As entity ids can now be changed, the “alarm_control_panel”
attribute “changed_by_entity_id” is now “changed_by_keypad”
and will show the name of the Elk keypad instead of the entity id.

* An auto configure mode has been introduced which avoids the
need to setup the complex include and exclude filters.  This
functionality still exists when configuring from yaml for power
users who want more control over which entities elkm1 generates.

* restore _has_all_unique_prefixes

* preserve legacy behavior of creating alarm_control_panels that have no linked keypads when auto_configure is False

* unroll loop
2020-03-27 15:38:35 -05:00
Adam Michaleski
c629e7dc0e
Add integration for Schluter (#31088)
* Add integration for Schluter
New integration for Schluter DITRA-HEAT thermostats. Interacts with Schluter API via py-schluter to implement climate platform.

* Fix for manifest issue on build
Removed unnecessary configurator logic

* Flake8 & ISort issues fixed

* Code review modifications for Schluter integration
- Removed unnecessary strings.json file
- Removed unnecessary DEFAULT_SCAN_INTERVAL from __init__.py
- Removed persistent notification for authentication error in __init__.py
- Removed string casts from log statements in __init__.py
- Removed unnecessary logging of entity creations in climate.py
- Removed unnecessary lookup for hvac_mode in climate.py

* Work started on Update Coordinator

* Further Coordinator work

* Update to DataUpdateCoordinator complete

* Flake8 fix

* Removal of unnecessary SchluterPlatformData
Coordinator also now using SCAN_INTERVAL

* Disable polling, use coordinator listeners

* Isort on climate.py

* Code review modifications
- Hass data stored under domain
- Since platform only likely to be climate, removed array, load explicitly
- Remove unnecessary fan mode implementation

* Switch to HVAC action for showing current heating status

* Isort fix

* HVAC Mode return list, set_hvac_mode function added

* __init__.py modifications from code review

* Climate.py code review modifications
- Device info property removed
- Write state function on set temp failure
- Add "available" property
- Delegate sync function in coordinator update to the executor

* Serial number as unique identifier
- Now using serial number & thermostat dictionary to protect against scenarios where a device is removed and enumerable index is no longer accurate
- Removed async_write_ha_state() from set temp exception, not needed
- Removed unnecessary SCAN_INTERVAL definition

* Linting

* Update homeassistant/components/schluter/climate.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* Update homeassistant/components/schluter/climate.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* Changed timeout from config, load platform discover to None

* Proposed change for discover info issue

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-03-27 10:53:36 -07:00
Oliver
9226589bcd
Bump to version 0.8.1 of denonavr (#33169)
* Bump to version 0.8.1 of denonavr

* Update CODEWONERS file
2020-03-24 13:03:22 +01:00
MeIchthys
3c59791b2e
Add Nextcloud Integration (#30871)
* some sensors working in homeassistant

* bring up to date

* add codeowner

* update requirements

* overhaul data imports from api & sensor discovery

* remove print statement

* delete requirements_test_all

* add requrements_test_all.txt

* Update homeassistant/components/nextcloud/sensor.py

Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com>

* Update homeassistant/components/nextcloud/sensor.py

Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com>

* describe recursive function

* clarify that dict is returned

* remove requirements from requirements_test_all

* improve and simplify sensor naming

* add basic tests

* restore pre-commit config

* update requirements_test_all

* remove codespell requirement

* update pre-commit-config

* add-back codespell

* rename class variables as suggested by @springstan

* add dev branch to no-commit-to-branch git hook

Because my fork had the same 'dev' branch i wasn't able to push. Going forward I should probably name my branches differently.

* move config logic to __init__.py

* restore .pre-commit-config.yaml

* remove tests

* remove nextcloud test requirement

* remove debugging code

* implement binary sensors

* restore .pre-commit-config.yaml

* bump dependency version

* bump requirements files

* bump nextcloud reqirement to latest

* update possible exceptions, use fstrings

* add list of sensors & fix inconsistency in get_data_points

* use domain for config

* fix guard clause

* repair pre-commit-config

* Remove period from logging

* include url in unique_id

* update requirements_all.txt

Co-authored-by: springstan <46536646+springstan@users.noreply.github.com>
2020-03-24 11:11:35 +01:00
Balazs Keresztury
df67ab995f
Add support for Bosch BMP280 Sensor (#30837)
* Implement support for Bosch BMP280 Sensor

* Fixed linting errors

* Fixed case of the requirement RPi.GPIO so it is ignored in requirements

* Update homeassistant/components/bmp280/manifest.json

Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com>

* Update homeassistant/components/bmp280/sensor.py

Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com>

* Fix linting errors

* Implemented changes suggested by code review

* Fixed incomplete refactoring

Co-authored-by: springstan <46536646+springstan@users.noreply.github.com>
2020-03-23 09:12:59 -05:00
J. Nick Koston
f9a7c64106
Config flow for doorbird (#33165)
* Config flow for doorbird

* Discoverable via zeroconf

* Fix zeroconf test

* add missing return

* Add a test for legacy over ride url (will go away when refactored to cloud hooks)

* Update homeassistant/components/doorbird/__init__.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* without getting the hooks its not so useful

* Update homeassistant/components/doorbird/config_flow.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* fix copy pasta

* remove identifiers since its in connections

* self review fixes

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-03-23 10:14:21 +01:00
Jason Swails
49ebea2be3
Add support for occupancy/vacancy groups in Lutron Caseta component (#33032)
* Add support for Lutron Caseta occupancy/vacancy sensors

This follows updates to pylutron-caseta to add support for these
devices. This code works for me as a custom component in Home Assistant
Core with pylutron-caseta 0.6.0 (currently unreleased).

* black formatting

* Update requirements_all.txt

* Apply black formatting

* Resolve some review comments

* serial -> unique_id

* Black formatting

* Resolve linting errors

* Add code owner...

* Fix isort complaint

* Fix remaining isort complaints

* Update codeowners

* Resolve outstanding review comments

* Remove caseta_
2020-03-23 07:51:24 +01:00
J. Nick Koston
b09a9fc81a
Add config flow for Nuheat (#32885)
* Modernize nuheat for new climate platform

* Home Assistant state now mirrors the
  state displayed at mynewheat.com

* Remove off mode as the device does not implement
  and setting was not implemented anyways

* Implement missing set_hvac_mode for nuheat

* Now shows as unavailable when offline

* Add a unique id (serial number)

* Fix hvac_mode as it was really implementing hvac_action

* Presets now map to the open api spec
  published at https://api.mynuheat.com/swagger/

* ThermostatModel: scheduleMode

* Revert test cleanup as it leaves files behind.

Its going to be more invasive to modernize the tests so
it will have to come in a new pr

* Config flow for nuheat

* codeowners

* Add an import test as well

* remove debug
2020-03-23 00:29:45 -05:00
Eugenio Panadero
8d2e72cdf6
Add pvpc electricity prices integration (#32092)
* Add new integration: pvpc_hourly_pricing

to add a sensor with the current hourly price of electricity in Spain.
Configuration is done by selecting one of the 3 reference tariffs, with
1, 2, or 3 billing periods.

* Features config flow, entity registry, RestoreEntity, options flow
  to change tariff, manual yaml config as integration or sensor platform
* Cloud polling sensor with minimal API calls (3/hour at random times)
  and smart retry; fully async
* Only 1 state change / hour (only when the price changes)
* At evening, try to download published tomorrow prices, to always store
  prices info for a window of [3, 27] hours in the future.
* Include useful state attributes to program automations to be run
  at best electric prices.
* Add spanish and english translations.

* Requires `xmltodict` to parse official xml file with hourly prices
for each day.

* Update requirements and add to codeowners

* Avoid passing in hass as a parameter to the entity

Instead, create time change listeners in async_added_to_hass and
call async_generate_entity_id before async_add_entities

* Fix lint issues

* Add tests for config & options flow

* Add tests for manual yaml config

with entity definition as integration and also as a sensor platform

* Fix placement of PLATFORM_SCHEMA and update generated config_flows

* Store prices internally linked to UTC timestamps

- to deal with days with DST changes
- and work with different local timezones

* Add availability to sensor

to 'expire' the sensor if there is no connection available
 and current hour is not in the stored prices.

Also, turn off logging and retrying if prices can't be downloaded
repeatedly, by flagging `data_source_available` as False, so there is no
log-flood mess.

* Add more tests

- to cover behavior in DST changes and complete coverage of sensor logic
- to cover abort config flow

* fix linter

* Better handling of sensor availability and minor enhancements

- Emmit 1 error if data source is marked as unavailable
  (after some retries), and be silent until cloud access is recovered,
  then emmit 1 warning.
- Follow standard of camel_case keys in attributes

* Mock aiosession to not access real API, store fixture data

- Store a set of daily xml files to test sensor logic for all situations
- Mock time and session to run tests with stored API responses
- Add availability test to simulate a lost + recovery of cloud access,
  checking that logging is reasonable: 1 error to flag the continued
  disconnection + 1 warning in recovery.

* Change API endpoint to retrieve JSON data

and remove xmltodict from reqs.

It seems that this endpoint is more reliable than the XML.

* Adapt tests to new API endpoint

* Translate tariff labels to plain English

and sync the default timeout value for all ways of configuration.

* Relax logging levels to meet silver requirements

- 1 warning when becoming unavailable, another warning when recovered.
- Warnings for unexpected TimeoutError or ClientError
- Move the rest to debug level, leaving info for HA internals

Also reduce number of API calls from 3 to 2 calls/hour.

* Fix requirements

* Mod tests to work with timezone Atlantic/Canary

and fix state attributes for timezones != reference, by using 3 price
prefixes: 'price_last_day_XXh', 'price_next_day_XXh' and 'price_XXh',
all generated with local time (backend timezone)

* Try to fix CI tests

* Externalize pvpc data and simplify sensor.py

* add new `aiopvpc` to requirements
* Remove data parsing and price logic from here
* Replace some constant properties with class variables

* Simplify tests for pvpc_hourly_pricing

* Fix updater for options flow

* Updater always reloads
* `tariff` value comes 1st from entry.options, 2nd from entry.data

* Fix lint

* Bump aiopvpc

* Remove options flow and platform setup

- Remove PLATFORM_SCHEMA and async_setup_platform
- Generate config_entry.unique_id with tariff instead of entity_id, in flow step.
- Remove TariffSelectorConfigFlow
- Adapt tests to maintain full coverage

* Fix docstring on test

and rename SENSOR_SCHEMA to SINGLE_SENSOR_SCHEMA to avoid confusion

* Remove timeout manual config, fix entry.options usage, simplify unique_id

* Simplify tests

- No need for a test_setup now, as platform setup is removed and integration
  setup is already used in `test_availability`
- Simplified `_process_time_step`: only one async_fire(EVENT_TIME_CHANGED)/hour

* Fix possible duplicated update

when source is not available.

* Do not access State last_changed for log messages

* Do not update until entity is added to hass

and call to async_update after 1st download or when recovering access, so
async_write_ha_state is not called twice on those.

* minor changes

* Rename method to select current price and make it a callback
2020-03-22 14:25:31 -05:00
Anders Melchiorsen
699ca44260
Clean up Sonos attributes for radio streams (#33063) 2020-03-21 12:17:00 -07:00
J. Nick Koston
37687561c0
Add config flow for myq (#32890)
* Add a config flow for myq

* Discovered by homekit

* Fix gates being treated as garage doors

* Offline devices now show as unavailable

* Homekit flow

* strip out icon

* return -> raise
2020-03-20 15:28:14 -05:00
J. Nick Koston
f275b7e5ed
Add Nexia thermostat support (Trane / American Standard) (#32826)
* Merge nexia

* Restore original work

* Merge cleanups

* config flow

* Add config flow

* Add missing files

* Fix import of old yaml config

* More cleanups from self review

* Additional self review

* Update homeassistant/components/nexia/services.yaml

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* fix io in event loop

* Update homeassistant/components/nexia/climate.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* avoid using ternary statements if they span multiple

* Cleanup strings and remove unneeded attributes

* more cleanup

* more cleanup of yaml

* remove coordinator boiler plate

* nuke services for now for the inital pr, add back later

* remove copy pasta

* this can be reduced more

* Update homeassistant/components/nexia/config_flow.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/nexia/config_flow.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/nexia/__init__.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/nexia/__init__.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/nexia/__init__.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/nexia/__init__.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* review

* comments

* Update homeassistant/components/nexia/climate.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/nexia/climate.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/nexia/climate.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* more review adjustments

* nuke unused constants

* Update homeassistant/components/nexia/config_flow.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* map states

* add update

* zone id is unique

* Fix humidfy check

* target_humidity should be a property instead of in attributes

* remove aux heat as its already there

Co-authored-by: Ryan Nazaretian <ryannazaretian@gmail.com>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-03-19 21:03:51 -05:00
J. Nick Koston
d33a3ca90f
Config flow for harmony (#32919)
* Config flow for harmony

* Fixes unique ids when using XMPP

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

* Find the unique id for the config flow

* move shutdown to init

* Add test for ssdp (still failing)

* Fix ssdp test

* Add harmony to MIGRATED_SERVICE_HANDLERS (this is a breaking change)

* more cleanups

* use unique id for the config file

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-03-19 11:29:51 -05:00
J. Nick Koston
5b4d2aed64
Add Powerwalls integration (#32851)
* Create an integration for Powerwalls

* Self review :: remove unused code

* Remove debug

* Update homeassistant/components/powerwall/__init__.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* _call_site_info to module level

* Update homeassistant/components/powerwall/binary_sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/powerwall/sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/powerwall/binary_sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/powerwall/binary_sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update tests/components/powerwall/test_binary_sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/powerwall/binary_sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/powerwall/binary_sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* remove sensors that I added tests for from the comment

* Update homeassistant/components/powerwall/config_flow.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/powerwall/sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/powerwall/sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/powerwall/sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Switch to UNIT_PERCENTAGE

* reduce code

* Add test for import

* Adjust tests

* Add missing file

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-03-19 10:50:17 -05:00
AJ Schmidt
40356b4fc5
Enable AlarmDecoder arming without security code (#32390)
* set alarmdecoder code_arm_required to False

* rm unnecessary f strings

* add code_arm_required config option

* add self as codeowner :-)

* add self as codeowner the right way
2020-03-16 14:11:08 +01:00
Steven Looman
b6e69cd370
Add log message on timeout and update less often for upnp devices (#32740)
* Catch asyncio.TimeoutError, show a proper message instead

* Throttle updates to max once per 30s

* Change code owner

* Fix CODEOWNERS + linting

* Warn on connection timeout
2020-03-15 18:18:15 +01:00
J. Nick Koston
7737387efe
Add config flow for rachio (#32757)
* Do not fail when a user has a controller with shared access on their account

* Add config flow for rachio

Also discoverable via homekit

* Update homeassistant/components/rachio/switch.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* Split setting the default run time to an options flow

Ensue the run time coming from yaml gets imported into the option flow

Only get the schedule once at setup instead of each zone (was hitting rate limits)

Add the config entry id to the end of the webhook so there is a unique hook per config entry

Breakout the slew of exceptions rachiopy can throw into RachioAPIExceptions

Remove the base url override as an option for the config flow

Switch identifer for device_info to serial number

Add connections to device_info (mac address)

* rename to make pylint happy

* Fix import of custom_url

* claim rachio

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-03-13 22:46:17 -07:00
Quentame
19be4a5d6d
Refactor Freebox : add config flow + temperature sensor + signal dispatch (#30334)
* Add config flow to Freebox

* Add manufacturer in device_tracker info

* Add device_info to sensor + switch

* Add device_info: connections

* Add config_flow test + update .coveragerc

* Typing

* Add device_type icon

* Remove one error log

* Fix pylint

* Add myself as CODEOWNER

* Handle sync in one place

* Separate the Freebox[Router/Device/Sensor] from __init__.py

* Add link step to config flow

* Make temperature sensors auto-discovered

* Use device activity instead of reachablility for device_tracker

* Store token file in .storage

Depending on host if list of Freebox integration on the future without breaking change

* Remove IP sensors + add Freebox router as a device with attrs : IPs, conection type, uptime, version & serial

* Add sensor should_poll=False

* Test typing

* Handle devices with no name

* None is the default for data

* Fix comment

* Use config_entry.unique_id

* Add async_unload_entry with asyncio

* Add and use bunch of data size and rate related constants (#31781)

* Review

* Remove useless "already_configured" error string

* Review : merge 2 device & 2 sensor classes

* Entities from platforms

* Fix unload + add device after setup + clean loggers

* async_add_entities True

* Review

* Use pathlib + refactor get_api

* device_tracker set + tests with CoroutineMock()

* Removing active & reachable from tracker attrs

* Review

* Fix pipeline

* typing

* typing

* typing

* Raise ConfigEntryNotReady when HttpRequestError at setup

* Review

* Multiple Freebox s

* Review: store sensors in router

* Freebox: a sensor story
2020-03-11 22:15:59 +01:00
Chris Talkington
180bcad477
Add codeowner for roku. (#32695) 2020-03-11 12:52:27 -07:00
Chris Talkington
69b19d54e8
Add codeowner for directv. (#32661) 2020-03-11 07:43:44 +01:00
Paul Madden
61acf944c0
Use bomradarloop v0.1.4 (#32660) 2020-03-11 07:27:07 +01:00
J. Nick Koston
908ae23738
Add griddy integration (#32591)
* Add griddy integration

* Griddy is a wholesale power provider in Texas

* Supports all four load zones in Texas

* Provides real time power price which is useful for automations to handle demand response

* Update homeassistant/components/griddy/sensor.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* Update homeassistant/components/griddy/config_flow.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* Add ability request updated via entity update service.

* Improve error message about already configured

* Remove DEVICE_CLASS_POWER since we do not have a device class for cost

* remove setdefault that was left from previous refactor

* More detail on data naming

* Bump translation for testing

* git add the config flow tests

* s/PlatformNotReady/ConfigEntryNotReady/

* Review items

* git add the other missing file

* Patch griddypower

* reduce

* adjust target

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-03-10 23:00:30 +01:00
Michaël Arnauts
8c52e2c923
Revert "Breakout tado zone code into a single place (#32564)" (#32639)
This reverts commit c2b03332a0.
2020-03-10 09:32:56 +01:00
J. Nick Koston
c2b03332a0
Breakout tado zone code into a single place (#32564)
* Breakout tado zone code into a single place

* Resolve various incorrect states and add tests for known tado zone states

* Fix home and away presets

* Upgrade to PyTado 0.4.0 which improves http performance and fixes setting fan speed.

* Write state instead of calling for an update

* adjust codeowners

* Add tests for michael's tado and fix heatingPower.value

* Guards are much cleaner

* Adjust per review

* Remove hass passing
2020-03-09 17:44:34 -07:00
lewei50
e1d6964589
Add IamMeter integration (#30465)
* Update .coveragerc

* Update requirements_all.txt

* Create manifest.json

* Add files via upload

* add codeowner

* add codeowner.

* Update sensor.py

* Update sensor.py

* remove unused import.

* Update manifest.json

* Update sensor.py

* modify requirements_all.txt.

* order imports.

* Update sensor.py

* Use DataUpdateCoordinator rewrite code

* set should_poll to False

* remove unused code 'serial'.

* add available prop

* Update homeassistant/components/iammeter/sensor.py

Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com>

* Update homeassistant/components/iammeter/sensor.py

Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com>

* Update homeassistant/components/iammeter/sensor.py

Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com>

* Update homeassistant/components/iammeter/sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/iammeter/sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/iammeter/sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update sensor.py

* Update sensor.py

Co-authored-by: springstan <46536646+springstan@users.noreply.github.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-03-09 08:39:39 -07:00
Paulus Schoutsen
daff87fe5d
Emoncms API now provides a Unit of Measurement (#32042)
* Emoncms API provides a Unit

The EmonCMS API has been amended to include a 'unit' as part of it's payload.  By using this information, all the sensors can be created without the need for individual sensors to be setup by type.

The change is backward compatible so if a unit type has been specified in the configuration, this will be used by default.

If no unit is pecified either by the Home Assistant configuration, or the Emoncms API, then the default of W will be used as before.

* Update sensor.py

Check the 'unit' key is in the API call. Older systems may not have that key in the payload.

* Modified approach with new configuration item

* Removed new config item

Removed the configuration item. The integration attempts to get the unit from the API.

If this fails *or* the unit key of the API is blank, either the specified unit, or the default will be used.

If approved, documentation will be updated.

* Update homeassistant/components/emoncms/sensor.py

Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com>

* Update homeassistant/components/emoncms/sensor.py

Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com>

* Apply suggestions from code review

* Apply suggestions from code review v2

* Update homeassistant/components/emoncms/sensor.py

Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com>

* Update sensor.py

Update `config_unit`

Co-authored-by: springstan <46536646+springstan@users.noreply.github.com>
2020-03-04 18:03:51 -08:00
Paulus Schoutsen
2316f7ace4
Add edl21 component for SML-based smart meters (#27962)
* Add edl21 component for SML-based smart meters

* edl21: Remove unused variable

* [edl21] Add 1 minute throttle to the sensor

* Update homeassistant/components/edl21/manifest.json

Fix documentation URL

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* edl21: Move imports to top

* edl21: Remove special case for STATE_UNKNOWN, which replicated default behavior

* edl21: Implement blacklist for and warn about unhandled OBIS values

* edl21: Make blacklist global

* edl21: Add filter to issues URL

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* edl21: Rename device to entity

* edl21: Don't schedule async_add_entities

* edl21: Use dispatcher, implement own throttling mechanism

* edl21: Simplify keeping track of known obis

* edl21: Use whitelist for state attributes

* edl21: Remove dispatcher on shutdown

* edl21: Convert state attributes to snakecase

* edl21: Annotate handle_telegram with @callback

* edl21: Call async_write_ha_state instead of schedule_update_ha_state

Co-authored-by: David Straub <straub@protonmail.com>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-03-04 17:43:12 -08:00
Matt Snyder
ee7ce47860
Add QVR Pro integration (#31173)
* Initial working commit

* Create const file.  Load camera from component.

* Handle failed authentication.  Bump library version.

* Remove line break

* Camera attributes and recording services

* Add services, manifest, constant update, and exclude_channels.  Prefix channel name.  Update service argument.

* Update codeowners

* Update coveragerc

* Remove codeowners line

* Update codeowners again from python3 -m script.hassfest

* Update homeassistant/components/qvrpro/__init__.py

Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com>

* Requested changes

* Fix typo

* Update to use exception. Bump library version.

* Support stream component

* Update module header

* Missing property wrapper

* Partial requested changes

* Update coveragerc and codeowners

* Move constants to const file.  Add SHORT_NAME

* Add conf variable

* Use camera domain

* More requested changes

* Requested changes

* Requested changes

* Update prefix

* Handle error condition when camera is not configured to support live streaming

* Move method to camera setup.  Disable stream component support.

* Move auth string to library to prevent private member access

Co-authored-by: springstan <46536646+springstan@users.noreply.github.com>
2020-03-03 01:10:02 +01:00
Paulus Schoutsen
1603f7ac21
Add coronavirus integration (#32413)
* Add coronavirus integration

* Update homeassistant/components/coronavirus/manifest.json

Co-Authored-By: Franck Nijhof <git@frenck.dev>

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2020-03-02 13:40:11 -08:00
guillempages
f53c94ed2a
Add Tankerkoenig integration (#28661)
* Initial version

Parse configuration, but return a fixed value

* Add basic functionality

Request real data from the server
Currently the prices are not getting updated, but the petrol station
data is real

* Update values regularly

The tankerkoenig values get updated regularly with real data.

* Move base functionality for the sensor to a base class

And move that to an own file, so that it can be inherited

* Reduce calls to tankerkoenig api

Use a master/slave concept for sensors; one master gets the data and
updates it into the slaves.

* Update requirements files

* Update all gas stations at once

* Remove tests directory

Currently there are no tests for the integration; will be added in
a future commit.

* Fix slaves not being updated

Let the base class regularly poll, so that slaves are also updated

* Refactor entity creation

Create an auxiliary method to add a station to the entity list,
in preparation to allowing extra stations.

* Add possibility to manually add stations

Add a new configuration option "stations" to manually add extra stations

* Fix style issues

Make the code more pythonic

* Remove redundant code

Implement suggestions from the code review

* Change to platform component

Remove the master/slave concept, in favor of a platform with dummy sensors.
The platform takes care of contacting the server and fetching updates
atomically, and updating the data on the sensors.

* Rename ATTR_STATE

Rename the attribute to "IS_OPEN", to avoid confusion with the sensor state.

* Minor updates

Combine two consecutive error logs into a single one.
Update the sensor's icon

* Separate address into different fields

* Style updates

Use "[]" syntax instead of ".get()" for required parameters
Use warning log level for not available fuel types

* Implement review comments

Fix style issues
Improve error messages
Remove redundant options

* Refactor using DataUpdateCoordinator

Use the new DataUpdateCoordinator to fetch the global data from
the API, instead of implementing an own method.
Also fix comments from the PR

* Implement PR comments

Implement suggestions to improve code readability and keep the Home Assistant style.
Also separate fetching data to an async thread
2020-03-01 16:49:07 +01:00
Tim van Cann
1d962aeb65
Add Avri waste collection sensor (#31134)
* Add Avri waste collection sensor

* Apply black formatting

* Update manifest

* Add requirements

* Add sensor to coverage

* Update import order

* Bump dependency to include todays pickup

* Bump avri version in requirements_all.txt

* Code review comments

* Reduce scan interval to 4 hours

This makes sure that no matter what happens, in
the morning the correct dates have been pulled
without the old ones lingering for too long.

* Better logging

* Made scan interval a timedelta

* Fix import order

* Update homeassistant/components/avri/sensor.py

Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com>

* Update homeassistant/components/avri/sensor.py

Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com>

* Use filter instead of break statement

* Use positive int for house number extension

* Switch voluptuous types for house number and house number extension

* Update homeassistant/components/avri/sensor.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* Implement `available`

* Bump avri api

* Code review comments

* Replace `postcode` with `zip_code`

* Update logic for `available`

* Remove variable for delimiter

Co-authored-by: springstan <46536646+springstan@users.noreply.github.com>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-02-27 22:12:01 -08:00
Pierre
a1a835cf54
Add platform Ezviz (#30378)
* hookid : isort fix

* New platform: Ezviz

* updated CODEOWNERS for ezviz

* proper test requirements

* resolved conflict

* regenerated requirements

* removed stale comments, only one call to add_entities, removed unnecessary attributes

* setup is sync, not async. Removed stale comments

* Compatible with pyezviz 0.1.4

* pyezviz 0.1.4 is now requiredf

* Added PTZ + switch management

* added services.yaml

* proper requirement

* PTZ working in async mode

* Now updates the entity

* Compatible with pyezviz 0.1.5.1

* Fixed switch ir service registering

* now requires pyezviz 0.1.5.2

* now requires pyezviz 0.1.5.2

* Revert "regenerated requirements"

This reverts commit 848b317cf9.

* Rollbacked to a simpler version

* snake_case names everywhere, logging sanatizing, voluptuous proper check

* pyezviz 0.1.5, reworked the PR so that it's intelligible

* no need for services.yaml for now

* proper voluptuous validation

* Removed stale code, use proper conf variable, describe attributes

* regenerated requirements

* stale

* removed status from attributes, since we use it for available we don't need it here then.

* Fixed log message
2020-02-24 10:39:55 +01:00
Robbie Trencheny
f0d58ab7a7
Change TTS codeowner to @pvizeli (#32041) 2020-02-20 13:36:36 -08:00
Franck Nijhof
1c81e8ad68
Remove history_graph integration (#32028)
* Remove history_graph integration

* Update codeowners file
2020-02-20 09:01:29 -08:00
Franck Nijhof
5c5f839119
Remove weblink integration (#32024) 2020-02-20 08:50:40 -08:00
Joseph Albert
fee0d8dbdd
Add rainforest_eagle support for legacy hardware (#28082)
* Add compatibility with Legacy EAGLE models.

* added mdns resultion via zeroconf

* Added requirements to requirements_all.txt

* Fixed model determination bug

* Fixed formatting issue for Eagle-200 responses.

* Remove mDNS resolution, IP now required.

* added pypi deps, fixed handling of optional params

manifest updates

* Fixed import order per isort.

* Two pylint fixes.

* More consistent try-fail structure to guessing hardware.  Errors actually fail.
2020-02-15 21:10:04 -08:00
Emanuel Winblad
3e05fc1c11
Add initial version of Vilfo Router integration (#31177)
* Initial implementation of Vilfo router integration.

This commit is a combination of several commits, with commit messages in bullet form below.

* Added additional files to Vilfo integration.
* Added generated files.
* Fixed alphabetic order in generated config_flows.
* Continued implementation of config flow for Vilfo integration.
* Continued work on config_flow for Vilfo.
* Updated requirements in manifest for Vilfo Router integration.
* Some strings added to Vilfo Router integration.
* Vilfo Router integration updated with sensor support.
* Code style cleanup.
* Additional cleanup of config flow.
* Added additional UI strings for Vilfo Router
* Updated tests of config flow and fixed formatting
* Updated requirement upon vilfo-api-client.
* Sensor refactoring including support for icons
* Code style changes for Vilfo Router integration
* Code cleanup
* Fixed linting issues in Vilfo Router integration
* Fixed import order in test for Vilfo integration.

* Updates to Vilfo Router integration based on feedback

Based on the feedback received, updates have been made to the Vilfo Router integration.

A couple of the points mentioned have not been addressed yet, since the appropriate action has not yet been determined. These are:

* https://github.com/home-assistant/home-assistant/pull/31177#discussion_r371124477
* https://github.com/home-assistant/home-assistant/pull/31177#discussion_r371202896

This commit consists of:

    * Removed unused folder/submodule
    * Fixes to __init__
    * Fixes to config_flow
    * Fixes to const
    * Refactored sensors and applied fixes
    * Fix issue with wrong exception type in config flow
    * Updated tests for Vilfo integration config_flow
    * Updated dependency upon vilfo-api-client to improve testability
    * Import order fixes in test
    * Use constants instead of strings in tests

* Updated the VilfoRouterData class to only use the hostname as unique_id when it is the default one (admin.vilfo.com).

* Refactored based on feedback during review.

* Changes to constant names,
* Blocking IO separated to executor job,
* Data for uptime sensor changed from being computed to being a timestamp,
* Started refactoring uptime sensor in terms of naming and unit.
* Updated constants for boot time (previously uptime) sensor.
* Refactored test of Vilfo config flow to avoid patching code under test.
* UI naming fixes and better exception handling.

* Removed unused exception class.

* Various changes to Vilfo Router integration.

* Removed unit of measurement for boot time sensor,
* Added support for a sensor not having a unit,
* Updated the config_flow to handle when the integration is already configured,
* Updated tests to avoid mocking the code under test and also to cover the aforementioned changes.

* Exception handling in Vilfo Router config flow refactored to be more readable.

* Refactored constant usage, fixed sensor availability and fix API client library doing I/O in async context.

* Updated signature with hass first

* Update call to constructor with changed order of arguments
2020-02-12 19:11:15 +01:00
J. Nick Koston
f5be9ef7fb
Refresh the august access token when needed (#31735)
* Refresh the august access token
when needed.

Currently august will stop working when the token
expires about every six month.

This resolves issue #23788

* Make refresh_access_token_if_needed private since we do not want additional callers

* Add init
2020-02-11 22:13:54 -08:00
Kit Klein
3435281bd1
Support Konnected Pro alarm panel, embrace async, leverage latest HA features/architecture (#30894)
* fix unique_id computation for switches

* update konnected component to use async, config entries, registries. Pro board support and tests

* clean up formatting comments from PR

* use standard interfaces in tests

* migrate config flow to use options

* address latest pr feedback

* format for import as part of config schema validation

* address pr feedback

* lint fix

* simplify check based on pr feedback

* clarify default schema validation

* fix other schema checks

* fix translations

Co-authored-by: Nate Clark <nate@nateclark.com>
2020-02-11 22:04:42 +01:00
Ziv
4467409e5c
Dynalite Integration (#27841)
* Initial commit

* ran hassfest and gen_requirements_all scripts

* fixes per request from Paulus Schoutsen

* ran gen_requirements_all

* updated library version - removed some debug leftover

* get_requirements again...

* added documentation URL

* ran isort

* changed storage in hass.data[DOMAIN] to use entry_id instead of host

* adopted unit tests to latest fix

* Update const.py

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-02-10 13:16:04 -08:00
Vilppu Vuorinen
b78d156f0e
Add MELCloud integration (#30712)
* Add MELCloud integration

* Provides a climate and sensor platforms. Multiple platforms on one go
is not the best option, but it does not make sense to remove them and
commit them later either.

* Email and access token are stored to the ConfigEntry. The token can be
updated by adding the integration again with the same email address. The
config flow is aborted and the update is performed on the background.

* Run isort

* Fix pylint errors

* Run black

* Increase coverage

* Update pymelcloud dependency

* Add HVAC_MODE_OFF emulation

* Remove print

* Update pymelcloud to enable device type filtering

* Collapse except blocks and chain ClientNotReadys

* Add preliminary documentation URL

* Use list comp for creating model info

Filters out empty model names form units.

* f-string galore

Dropped 'HVAC' from AtaDevice name template.

* Delegate fan mode mapping to pymelcloud

* Fix type annotation

* Access AtaDevice through self._device

* Prefer list comprehension

* Update pymelcloud to leverage device type grouping

The updated backend lib returns devices in a dict grouped by the device
type. The devices do not necessarily need to be in a single list and
this way isinstance is not required to extract devices by type.

* Remove DOMAIN presence check

This does not seem to make much sense after all.

* Fix async_setup_entry

Entry setup used half-baked naming from few experimentations back.
The naming conventiens were unified to match the platforms.

A redundant noneness check was also removed after evaluating the
possible return values from the backend lib.

* Simplify empty model name check

* Improve config validation

* Use config_validation strings.

* Add CONF_EMAIL to config schema. The value is not strictly required
when configuring through configuration.yaml, but having it there makes
things more consistent.

* Use dict[key] to access required properties.

* Add DOMAIN in config check back to async_setup. This is required if an
integration is configured throught config_flow.

* Remove unused manifest properties

* Remove redundant ClimateDevice property override

* Add __init__.py to coverage exclusion

* Use CONF_USERNAME instead of CONF_EMAIL

* Use asyncio.gather instead of asyncio.wait

* Misc fixes

* any -> Any

* Better names for dict iterations

* Proper dict access with mandatory/known keys

* Remove unused 'name' argument

* Remove unnecessary platform info from unique_ids

* Remove redundant methods from climate platform

* Remove redundant default value from dict get

* Update ConfigFlow sub-classing

* Define sensors in a dict instead of a list

* Use _abort_if_unique_id_configured to update token

* Fix them tests

* Remove current state guards

* Fix that gather call

* Implement sensor definitions without str manipulation

* Use relative intra-package imports

* Update homeassistant/components/melcloud/config_flow.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-02-10 22:09:12 +01:00
elmurato
699d6ad658
Add Minecraft Server Integration (#30992)
* Add Minecraft Server integration

* Add unit test for config flow

* Fixed some review findings and increased unit test coverage

* Fixed docstrings of new test cases

* Removed unnecessary debug log messages

* Added unique IDs and device infos and removed duplicate name validation

* Attempt to fix unit test on CI

* Return state OFF instead of UNAVAILABLE in case connection to server drops

* Added property decorator to server properties, even less debug messages, improved sensor dispatcher connection and other review findings fixed

* Moved special property handling to sensors, fixed name confusion in sensor entity, switch to HA const for scan_interval, simplified building players list string

* Improved periodic update, speeded up unit tests

* Added type hints, added callback decorator to entity update callback, added const.py to unit test exclusions

* Changed state sensor to binary sensor, removed empty unit test file, added constants for icons and units

* Let HA handle unknown state, check for None in description and players list sensor

* Removed periods at end of log messages, removed constant for default host

* Updated requirements_test_pre_commit.txt, fixed codespell findings

* Use localhost as default host

* Removed passing hass to entities, moved log message from init, moved host lower to vol, use proper patch library, patch library instead of own code

* Replaced server properties with global instance attributes, removed config option scan_interval, switch back to async_track_time_interval

* Removed description and players list sensors, added players list as state attributes to online players sensor, raise OSError instead of deprecated IOError, other minor review findings fixed

* Use MAC address for unique_id in case of an IP address as host, added getmac to manifest.json, added invalid_ip to strings.json, added new test cases for changes in config_flow, replace all IOError's with OSError, other review findings fixed

* Removed double assignment

* Call get_mac_address async safe

* Handle unavailable and unknown states to reach silver quality scale, added quality scale to manifest.json
2020-02-08 09:28:35 +01:00
Franck Nijhof
1cfd69d484
Remove of liveboxplaytv integration (ADR0004) (#31525) 2020-02-06 12:54:46 +01:00
Malte Franken
8d429d7676
Add GDACS feed integration (#31235)
* initial version of gdacs integration

* updated translations

* generated files

* added abbreviation

* bumped library version

* small feed entry attribute fixes

* add unit tests

* need to use original mdi name

* bumped library version

* improved entity name for earthquakes

* round vulnerability number

* typo

* support for categories

* testing support for categories

* tie longitude and latitude together

* validating categories

* simplifying setup

* passing domain as parameter

* simplified test setup

* moved test code

* simplified test code

* removed superfluous code

* changed approach to unique identifier

* changed code structure

* simplified unit system handling

* made schema a constant

* comment added

* simplifying code

* added message if location already configured

* removed unnecessary code

* simplified test code

* avoid mocking __init__

* pylint

* simplified code

* fetch categories from integration library

* setting PARALLEL_UPDATES

* setting PARALLEL_UPDATES to zero/unlimited

* added quality scale
2020-02-06 11:32:30 +01:00
Quentame
201ea2557e
Add config flow to Meteo-France (#29927)
* Add config flow to Meteo-France

* Review 1

* Use config_entry.unique_id

* Fix config_flow _show_setup_form + init

* Remove empty *_setup_platform()

* Avoid HomeAssistantError: Entity id already exists: sensor.[city_name]_[sensor_type]. Platform meteo_france does not generate unique IDs

- when multiple district in one city

* Review + abort when API error

* Fix I/O

* Remove monitored_conditions

* Add async_unload_entry

* Review 3

* Fix pipe

* alert_watcher is already None

* Review 4

* Better fix for "Entity id already exists"

* Whoops, fix tests

* Fix string
2020-02-04 22:37:59 +01:00
Björn Orri
8852cd0def
Add Salt Fiber Box device tracker (#30986)
* Add salt component

* Update files from development checklist

* Use warning log level when data cannot be retrieved

Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com>

* Remove empty fields from manifest.json

* Remove default arguments for host and username

* Bump saltbox library version

* Refactor and improve error handling

* Dev checklist

* Fix linting errors

* Check for None and return empty list

* Log on debug level instead of info

* More compact None checks

* Remove redundant None check

* Return None on exception but store as empty list

* More compact syntax

Co-authored-by: springstan <46536646+springstan@users.noreply.github.com>
2020-02-02 17:26:51 +01:00
Austin Mroczek
f584df46b7
Add totalconnect zones as binary sensors (#28712)
* Bump skybellpy to 0.4.0

* Bump skybellpy to 0.4.0 in requirements_all.txt

* Added extra states for STATE_ALARM_TRIGGERED to allow users to know if
it is a burglar or fire or carbon monoxide so automations can take
appropriate actions.  Updated TotalConnect component to handle these new
states.

* Fix const import

* Fix const import

* Fix const imports

* Bump total-connect-client to 0.26.

* Catch details of alarm trigger in state attributes.

Also bumps total_connect_client to 0.27.

* Change state_attributes() to device_state_attributes()

* Move totalconnect component toward being a multi-platform integration.  Bump total_connect_client to 0.28.

* add missing total-connect alarm state mappings

* Made recommended changes of MartinHjelmare at
https://github.com/home-assistant/home-assistant/pull/24427

* Update __init__.py

* Updates per MartinHjelmare comments

* flake8/pydocstyle fixes

* removed . at end of log message

* added blank line between logging and voluptuous

* more fixes

* Adding totalconnect zones as HA binary_sensors

* fix manifest.json

* flake8/pydocstyle fixes.  Added codeowner.

* Update formatting per @springstan guidance.

* Fixed pylint

* Add zone ID to log message for easier troubleshooting

* Account for bypassed zones in update()

* More status handling fixes.

* Fixed flake8 error

* Another attempt at black/isort fixes.

* Bump total-connect-client to 0.50.  Simplify code using new functions in
total-connect-client package instead of importing constants.  Run black
and isort.

* Fix manifest file

* Another manifest fix

* one more manifest fix

* more manifest changes.

* sync up

* fix indent

* one more pylint fix

* Hopefully the last pylint fix

* make variable names understandable

* create and fill dict in one step

* Fix name and attributes

* rename to logical variable in alarm_control_panel

* Remove location_name from alarm_control_panel attributes since it is
already the name of the alarm.

* Multiple fixes to improve code per @springstan suggestions

* Update homeassistant/components/totalconnect/binary_sensor.py

Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com>

* Multiple changes per @MartinHjelmare review

* simplify alarm adding

* Fix binary_sensor.py is_on

Co-authored-by: springstan <46536646+springstan@users.noreply.github.com>
2020-02-01 10:09:52 +01:00
Rami Mosleh
9432054066
Rework Mikrotik device scanning following Unifi (#27484)
* rework device scanning, add tests

* update requirements and coverage

* fix description comments

* update tests, fix disabled entity updates

* rework device scanning, add tests

* update requirements and coverage

* fix description comments

* update tests, fix disabled entity updates

* update librouteros to 3.0.0

* fix sorting

* fix sorting 2

* revert to 2.3.0 as 3.0.0 requires code update

* fix requirements

* apply fixes

* fix tests

* update hub.py and fix tests

* fix test_hub_setup_failed

* rebased on dev and update librouteros to 3.0.0

* fixed test_config_flow

* fixed tests

* fix test_config_flow
2020-01-30 10:21:51 -08:00
Phil Bruckner
61e41f0ddc
Add code owner for amcrest integration (#31276) 2020-01-29 11:50:18 -06:00
Matthew Treinish
85dbf1ffad
Add OPNSense device tracker (#26834)
* Add OPNSense device_tracker

This commit adds a new component for using an OPNSense router as a
device tracker. It uses pyopnsense to query the api to look at the
arptable for a list of devices on the network.

* Run black formatting locally to appease azure

* Apply suggestions from code review

Co-Authored-By: Fabian Affolter <mail@fabian-affolter.ch>

* Fix issues identified during code review

This commit updates several issues found in the module during code
review.

* Update homeassistant/components/opnsense/__init__.py

Co-Authored-By: Fabian Affolter <mail@fabian-affolter.ch>

* Update CODEOWNERS for recent changes

* Fix lint

* Apply suggestions from code review

Co-Authored-By: Martin Hjelmare <marhje52@kth.se>

* More fixes from review comments

This commit fixes several issues from review comments, including
abandoning all the use of async code. This also completely reworks the
tests to be a bit clearer.

* Revert tests to previous format

* Add device detection to opnsense device_tracker test

This commit adds actual device detection to the unit test for the setup
test. A fake api response is added to mocks for both api clients so that
they will register devices as expected and asserts are added for that.

The pyopnsense import is moved from the module level to be runtime in
the class. This was done because it was the only way to make the
MockDependency() call work as expected.

* Rerun black

* Fix lint

* Move import back to module level

* Return false on configuration errors in setup

This commit updates the connection logic to return false if we're unable
to connect to the configured OPNsense API endpoint for any reason.
Previously we would not catch if an endpoint was incorrectly configured
until we first tried to use it. In this case it would raise an unhandled
exception. To handle this more gracefully this adds an api call early in
the setup and catches any exception raised by that so we can return
False to indicate the setup failed.

* Update tests

* Add pyopnsense to test requirements

* Rerun gen_requirements script

* Fix failing isort lint job step

Since opening the PR originally yet another lint/style checker was added
which failed the PR in CI. This commit makes the adjustments to have
this pass the additional tool's checks.

* Fix comment

* Update manifest.json

Co-authored-by: Fabian Affolter <mail@fabian-affolter.ch>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch>
2020-01-29 16:20:43 +01:00
brefra
03954be12d Add brefra to codeowners list Velbus integration (#31245)
* Add myself to codeowners list

* Add myself to CODEOWNERS file
2020-01-28 09:25:15 -05:00
Oscar Calvo
d813618d0d Add Gammu based local SMS notifications (#31233)
* Add sms integration

Committer: ocalvo <oscar@calvonet.com>

* Fix PyLint

* Update requirements
2020-01-28 09:35:41 +01:00
Ron Klinkien
4e2737bfb7 Add Garmin Connect integration (#30792)
* Added code files

* Correctly name init file

* Update codeowners

* Update requirements

* Added code files

* Correctly name init file

* Update codeowners

* Update requirements

* Black changes, added to coveragerc

* Removed documentation location for now

* Added documentation url

* Fixed merge

* Fixed flake8 syntax

* Fixed isort

* Removed false check and double throttle, applied time format change

* Renamed email to username, used dict, deleted unused type, changed attr name

* Async and ConfigFlow code

* Fixes

* Added device_class and misc fixes

* isort and pylint fixes

* Removed from test requirements

* Fixed isort checkblack

* Removed host field

* Fixed coveragerc

* Start working test file

* Added more config_flow tests

* Enable only most used sensors by default

* Added more default enabled sensors, fixed tests

* Fixed isort

* Test config_flow  improvements

* Remove unused import

* Removed redundant patch calls

* Fixed mock return value

* Updated to garmin_connect 0.1.8 fixed exceptions

* Quick fix test patch to see if rest is error free

* Fixed mock routine

* Code improvements from PR feedback

* Fix entity indentifier

* Reverted device identifier

* Fixed abort message

* Test fix

* Fixed unique_id MockConfigEntry
2020-01-27 09:12:18 -08:00
Maikel Punie
3f03848a07 Fix Velbus covers (includes velbus lib upgrade) (#31153)
* Fix velbus covers

* Update python-velbus lib

* flake8 and black fixes

* Fix comments

* fix codeowner
2020-01-26 14:36:29 +01:00
Matt Snyder
e4832ee4d0 Remove Owlet component (#31160)
* Remove owlet component

* Remove owlet from requirements_all.txt
2020-01-25 21:08:36 +01:00
Franck Nijhof
7e4b9adc3d
Rewrite of Spotify integration (#30717)
* Rewrite of Spotify integration

* Update homeassistant/components/spotify/config_flow.py

Co-Authored-By: Paulus Schoutsen <balloob@gmail.com>

* Remove configurator dependency

* Strip whitespace from device model in case Spotify product is missing

* Ensure domain dict exists in hass data on setup entry

* Simply config validation for client id and secret

* Abort flow on any exception from spotipy

* Add tests for config flow

* Gen requirements all

* Add test package __init__

* Remove Spotify from coveragerc

* Made alias handling more robuust

* Fix supported_features for Spotify free and open accounts

* Improve error message in the logs

* Re-implement Spotify media_player

* Change media content type when play a playlist

* Process review suggestions

* Move Spotify init, static current user and supported_features

* Remove unneeded me call

* Remove playlist content type due to frontend issues

* Improve playlist handling, when context is missing

* Handle entity disabled correctly

* Handle being offline/unavailable correctly

* Bump Spotipy to 2.7.1

* Update coverage RC, mark integration silver

* Remove URI limitation, lib supports all Spotify URI's now

* Final cleanup

* Addresses Pylint error

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-01-24 18:47:22 +01:00
Robin
c71ae090fc Add sighthound integration (#28824)
* Add component files

* Add test state

* Adds person detected event

* Update CODEOWNERS

* Updates requirements

* remove unused datetime

* Bump sighthound version

* Update CODEOWNERS

* Update CODEOWNERS

* Create requirements_test_all.txt

* Address reviewer comments

* Add test for bad_api_key
2020-01-23 09:30:06 +01:00
Jonathan Keljo
572b81e7e0 Add myself to owners for components I contributed (#31020)
* Add myself to owners for components I contributed

* Update CODEOWNERS
2020-01-22 17:49:00 -08:00
Abílio Costa
2aff913d9b Update pyipma to 2.0 (#30746)
* update ipma component for pyipma 2.0

* fix wind speed; refactor forecast

* update requirements*.txt

* fix tests; update CODEOWNERS; update pyipma to 2.0.1

* minor changes as suggested in PR

* make lint happy

* fix mocking coroutines

* restore old unique id

* fix station lat/lon; update pyipma version
2020-01-21 17:04:22 +01:00
Faucogney Anthony
b2212ad445 Add Derivative component (#26456)
* create derivation component

based on integration component
remove left and right

* Update test

(was'n saved)

* add some functionnal point test

* Change derivation to derivative

* Continue migration from derivation to derivative

* Add codeowners info

* fix tests typo and values

* Improve code from reviewer

add test case
fix test values
still a prefix issue that should not

* create derivation component

based on integration component
remove left and right

* Update test

(was'n saved)

* add some functionnal point test

* Change derivation to derivative

* Continue migration from derivation to derivative

* Add codeowners info

* fix tests typo and values

* Improve code from reviewer

add test case
fix test values
still a prefix issue that should not

* Update homeassistant/components/derivative/sensor.py

Fix test issue with unit of measurement

Co-Authored-By: Santobert <tobhaase@gmail.com>

* Fix review

Move ValueError to SyntaxError

* precise state test

* un comment original tests and remove error tests

* Fix isort issue

* Fix review

- update doc link
- migrate to general const import

* Rollback import conf_unit, just defined localy

Co-authored-by: Santobert <tobhaase@gmail.com>
2020-01-19 22:17:06 -08:00
Miroslav Ždrale
36796ef649 Update pyubee to 0.8 (#30785) 2020-01-15 16:24:06 +01:00
Paulus Schoutsen
5fdc60e067
Add Safe Mode (#30723)
* Store last working HTTP settings

* Add safe mode

* Fix tests

* Add cloud to safe mode

* Update logging text

* Fix camera tests leaving files behind

* Make emulated_hue tests not leave files behind

* Make logbook tests not leave files behind

* Make tts tests not leave files behind

* Make image_processing tests not leave files behind

* Make manual_mqtt tests not leave files behind
2020-01-14 13:03:02 -08:00
Paulus Schoutsen
c4673ddee1
Update Ring to 0.6.0 (#30748)
* Update Ring to 0.6.0

* Update sensor tests

* update -> async_update

* Delete temp files

* Address comments

* Final tweaks

* Remove stale print
2020-01-14 12:54:45 -08:00
Franck Nijhof
658d338058 Removes Cisco Spark integration (#30738) 2020-01-13 10:23:26 -08:00
Yarmo Mackenbach
96bf8bc395 Update NSAPI to version 3.0.0 (#30599)
* Updated NSAPI to version 3.0.0

* Fixed code style error

* Restructured API access

* Improved construction of attributes

* Fixed handling of API output

* Added @YarmoM as code owner

* Updated CODEOWNERS

* Reverted changes for full backwards compatibility

* Fixed bad conditional

* Simplify conditional
2020-01-12 20:30:26 +01:00
cgtobi
e793ed9ab0 Refactor Netatmo integration (#29851)
* Refactor to use ids in data class

* Use station_id

* Refactor Netatmo to use oauth

* Remove old code

* Clean up

* Clean up

* Clean up

* Refactor binary sensor

* Add initial light implementation

* Add discovery

* Add set schedule service back in

* Add discovery via homekit

* More work on the light

* Fix set schedule service

* Clean up

* Remove unnecessary code

* Add support for multiple entities/accounts

* Fix MANUFACTURER typo

* Remove multiline inline if statement

* Only add tags when camera type is welcome

* Remove on/off as it's currently broken

* Fix camera turn_on/off

* Fix debug message

* Refactor some camera code

* Refactor camera methods

* Remove old code

* Rename method

* Update persons regularly

* Remove unused code

* Refactor method

* Fix isort

* Add english strings

* Catch NoDevice exception

* Fix unique id and only add sensors for tags if present

* Address comments

* Remove ToDo comment

* Add set_light_auto back in

* Add debug info

* Fix multiple camera issue

* Move camera light service to camera

* Only allow camera entities

* Make test pass

* Upgrade pyatmo module to 3.2.0

* Update requirements

* Remove list comprehension

* Remove guideline violating code

* Remove stale code

* Rename devices to entities

* Remove light platform

* Remove commented code

* Exclude files from coverage

* Remove unused code

* Fix unique id

* Address comments

* Fix comments

* Exclude sensor as well

* Add another test

* Use core interfaces
2020-01-11 12:20:00 +01:00
etheralm
5ffbf55170 Add support for Dyson TP06 fan (#30611)
* initial commit

* update manifest.json

* update CODEOWNERS

* remove unnecessary else

* add rest of asserts for TP06 state test
2020-01-11 10:41:52 +01:00
NobleKangaroo
e2f591e5bc Remove self as Emulated Hue codeowner (#30654) 2020-01-10 22:35:18 +01:00
Paulus Schoutsen
3348f4f6d1
Add search integration (#30511)
* Add search integration

* Add scenes and config entry support

* Update comments

* Add support for groups

* Allow querying config entry

* Update manifest

* Fix scene tests
2020-01-10 19:57:37 +01:00
fwestenberg
498bec4a61 Add Stookalert integration (#30306)
* Added Stookalert integration

* Added Stookalert integration

* Added Stookalert integration

* Solved comments

* Flake8 change

* Bump stookalert to version 1.1.2

* Fixed attributes and state

* Get method for private variables

*  Update to stookalert 0.1.4

* Code optimization

* Update requirements
2020-01-08 21:03:50 +01:00
tetienne
13e6479b6e Ease code before adding color and temperature to light template (#30455)
* Split async_update

* Use pytest parameters to avoid duplicate code

* Fix UnboundLocalError

* Test error rendering for template state

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-01-07 17:22:42 +01:00
Aleix Murtra
1d1aa06d05 Add TMB sensor (#27964)
* Add TMB i-Bus sensor

* Raise exception if HTTP error

* Addressed comments

* Fixed format

* Fixed format

* Addressed comments

* Remove guard before add_entities method

* Remove unauthorized exception

* Make CONF_BUS_STOPS option required
2020-01-07 16:22:16 +01:00
Trekky12
5ed1f16f25 Add pilight dimmer as light component (#30107)
* Add pilight dimmer as light component

* fix CI errors

* fix missing new lines

* improve formatting and addresses comments of @springstan

* rename config parameter and remove super() call to match pylint

* import only used constants of the pilight component

* Add myself to the code owners

* fix CODEOWNERS
2020-01-06 20:13:08 -05:00
Maciej Bieniek
21029b1d7b Add Brother Printer integration (#30359)
* Init entities as unavailable when offline

* Initial commit

* Fix CODEOWNERS

* CODEOWNERS

* Run script.hassfest

* Add initial test

* Bump library

* More tests

* Tests

* Add new sensors and fix KeyError

* Fix unique_id and device_info

* Fix check for configured device

* More tests

* Bump library version

* Add uptime sensor

* Use config entry unique ID

* Run python3 -m script.gen_requirements_all

* Fix pylint error

* Remove pysnmp dependency

* Raise ConfigEntryNotReady when device offline at HA start

* Remove period from logging message

* Generator simplification

* Change raise_on_progress

* Rename data to printer

* Move update state to async_update

* Remove unused _unit_of_measurement

* Remove update of device_info

* Suggested change for tests

* Remove unnecessary argument

* Suggested change
2020-01-06 11:06:16 -06:00
Ben
1fffa210e1 Add surepetcare component (#24426)
* add surepetcare

* cleanup

* remove unused imports and comments

* remove comment

* fix bug which prevented updating the sensors

* improve config validation

* fix voluptuous usage

* fix format & credential storage

* various fixes to hass-conform

* small format fixes

* change False to None

* still trying to be hass-conform

* remove unused class

* fix imports

* fix f-string

* add guard clause?!

* central data fetch

* do not pass in hass, will be provided automatically

* make the linters happy

* disable constant-test warning and add commas

* worksforme

* fix link in manifest

* remove icon

* bump surepy to 0.1.5

* worksforme

* small doc fixes

* add discovery_info guard

* result of another awesome review

* and again :)

* exclude surepetcare in .coveragerc
2020-01-06 09:00:01 -05:00
David Cramer
3033dbd86c Add Sentry component (#30422) 2020-01-03 21:34:20 +01:00
Bas Nijholt
0d5486f772 Add KEF speakers integration (#28959)
* add KEF speakers platform for the integration

This will work with the KEF LS50 Wireless and KEF LSX speakers.
The development of this code happened on https://github.com/basnijholt/media_player.kef

* rename DATA_KEF -> DOMAIN

* use aiokef v0.2.0 and support LSX and new features

* sort imports

* fix @MartinHjelmare's suggestions

* remove _CONFIGURING

* change STATE_UNKNOWN to None

* use lat and long for unique_id

* bump aiokef to v0.2.2

* use config[ATTR] instead of config.get(ATTR)

* use getmac

* fix case when MAC is None

* use host as instance lifetime id

* fix requirements
2020-01-03 14:59:44 +01:00
Josh Bendavid
c1936f6fe4 Add generic command/button functionality to webostv (#30379)
* add generic command/button functionality to webostv

* update codeowners
2020-01-02 22:32:56 +01:00
Issac
3f570245aa Add local_ip component (#29973)
* Added localip component

* Split config and core logic, and migrate to sensor platform (requested by @MartinHjelmare)
Also allow overriding the sensor name via the config

* Tweak docstring

Co-Authored-By: Fabian Affolter <mail@fabian-affolter.ch>

* Initial support for config entries

* Rename localip to local_ip (1/2)

* Rename localip to local_ip (2/2)

* Add test for config_flow

* Split and rename tests

* Remove unneeded code from config_flow

* Implement configuration as config entry import.  Other misc requested changes from code review.

* Fix tests

* minor code review fixes

* remove unneeded code

Co-authored-by: Fabian Affolter <mail@fabian-affolter.ch>
2019-12-31 14:34:53 +01:00
Maciej Bieniek
2c1a7a54cd Add GIOS integration (#28719)
* Initial commit

* Add gios to requirements

* Add tests

* Update .coveragerc file

* Run gen_requirements_all.py

* Change DEFAULT_SCAN_INTERVAL

* Better strings

* Bump library version

* run script.hassfest

* run isort

* Add icons mapping

* Remove unnecessary f-string

* Remove unnecessary listener

* Refactoring config_flow

* Add unique_id to config entry

* Change AQI states to consts in English

* Remove unused init

* Remove unused exception

* Remove private instance attribute

* Remove overwrite state property

* Fix pylint error

* Add SCAN_INTERVAL for air_quality entity

* Add _abort_if_unique_id_configured()
2019-12-31 13:05:31 +01:00
Fabian Affolter
d0c9a42b81
Add custom validator for countries (#30280) 2019-12-30 17:51:25 +01:00
Tim Rightnour
f32eaa2fdd Add onewire devices and owserver remote host support (#29948)
* Add support for HobbyBoards sensors: Hub, Humidity, Moisture, PulseCounter
Add support for an owserver running on a remote host

* Cleanup and fixes for style/etc

* Forgot to convert to f-strings.

* Update with changes requested by @MartinHjelmare

* Pylint

* Fix to None

* Reverse logic for hobbyboard test to eliminate pylint complaint

* Modified manifest to list myself as codeowner

* Move some functions down into OneWireProxy instead of the top OneWire

* Oops, missed some decode()'s

* And another!
2019-12-24 14:41:29 +01:00
Alan Tse
3aa2ae1700 Enable config flow for Tesla (#28744)
* build: bump teslajsonpy to 0.2.0

* Remove tests

* feat: add config flow

* feat: add async

* perf: convert unnecessary async calls to sync

* feat: add charger voltage and current sensor

* feat: add options flow

* build: bump teslajsonpy to 0.2.0

* Remove icon property

* Revert climate mode change

* Remove charger sensor

* Simplify async_setup_platform

* Update homeassistant/components/tesla/sensor.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* Update homeassistant/components/tesla/binary_sensor.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* Address requested changes

* Fix pylint error

* Address requested changes

* Update codeowners

* Fix pylint error

* Address requested changes

* Address requested change

* Remove unnecessary check for existing config entry

* Load scan_interval in async_setup_entry

* Include coverage of config_flow

* Add tests for full coverage

* Address requested test changes

* Remove unnecessary init lines

* Remove unnecessary init

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2019-12-23 21:54:25 +01:00
Paulus Schoutsen
b9eb831d29
Revert Tahoma removal (#29840)
* Revert "Remove Tahoma component #29744 (#29745)"

This reverts commit df74272ba6.

* Revert "Cleanup removed component (#29788)"

This reverts commit 3a28361beb.
2019-12-12 06:37:55 +01:00
Quentame
c804f8f961 Add config flow to iCloud (#28968)
* iCloud: setup ConfigFlow and prepare for more platforms

- add config flow + tests
- fix existing services
- add play_sound & display_message services
- document services
- can use devices with the same name
- prepare to add sensor platform

* Review : not copy account conf

* Review: Safer test patch

* Review: remove reset_account

* Review: Use executor_job while IO

* Review: Use executor_job while IO 2

* Review: use hass.helpers.storage.Store()

* Review: no IO in tests

* Remove reset from services.yaml

* Review: remove authenticate.return_value = Mock()

* Review: do not initialize the api with the mocked service

* isort

* Review: @MartinHjelmare Test config flow with all steps

* Review: Fix failed tests names

* Codevov: Add one missing test
2019-12-09 17:19:42 +01:00
tetienne
df74272ba6 Remove Tahoma component #29744 (#29745) 2019-12-09 13:35:14 +01:00
Bernhard B
d451e54e34 Add Signal Messenger integration (#28537)
* added signalmessenger integration

* allows to send a message (with an attachment) to one or more
  recipients

* added signalmessenger documentation to manifest file

* remove debug logging from signalmessenger integration

* add signalmessenger to .coveragerc

* fixed typo in signalmessenger manifes

* moved service specific code to own pypi library

* updated pysignalclirestapi dependeny in manifest.json

* added pysignalclirestapi requirement for signalmessenger component

* fixed typo in codeowners

* reworked signalmessenger integration based on code review input

* updated requirements for signalmessenger

* small code improvements in signalmessenger integration

* no need to use the get() method to access dict parameters that are
required

* small changes in signalmessenger integration

* re-ordered import statements
* removed empty "requirements" list (not needed)

* changed import order in signalmessenger integration according to PEP 8

* used isort to order includes in signalmessenger integration

* renamed signalmessenger to signal_messenger

* renamed signalmessenger to signal_messenger in CODEOWNERS file

* changed documentation url in signal_messenger integration to new name

* changed signal messenger naming in .coveragerc
2019-12-09 00:27:06 +01:00
James Nimmo
c78773970b Add IntesisHome Climate Platform (#25364)
* Add IntesisHome Climate Platform

* Add support for IntesisHome and Airconwithme devices

* Implement requested changes from PR review

* Improve error handling for IntesisHome component

* Fix snake-case naming style

* Update exception logging
2019-12-08 15:09:16 +01:00
Franck Nijhof
cc9589cff2 Add Elgato Key Light integration (#29592)
* Add Elgato Key Light integration

* Remove passing in of hass loop

* Tweaks a comment

* Tweaks a function name

* Ensure domain namespace in data exists in entry setup
2019-12-08 09:26:31 +01:00
Rohan Kapoor
b2d5de6a79 Switch iperf3 to generate a new client every time it runs a test (#29495)
* Switch iperf3 to generate a new client every time it runs a test

* Add myself to CODEOWNERS

* Fix imperative mood
2019-12-04 22:49:26 -08:00
Andy Loughran
434b783b4c Update heatmiserv3 integration (#29006)
* Updated heatmiserV3 initial commit

* Fixing heatmiser component

* Updated codeowners and heatmiserV3 version

* Updating files as part of PR process

* Removed extra _LOGGER statements.

* Added in HVAC_MODE_OFF to allowed states to track whether heating on/off

* Handling PR comments

* Removed legacy tests

* fixing pylint errors

* Update homeassistant/components/heatmiser/climate.py

Removed .get from config

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/heatmiser/climate.py

Removed .get from config

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/heatmiser/climate.py

Removed .get from config

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Updated climate based on latest feedback

* Removed cast to int and update requirements

* Update requirements

* Updated heatmiser deps
2019-12-03 06:48:51 +01:00
Felipe Martins Diel
5a24dbf599 Broadlink remote (#26528)
* Add broadlink remote control platform

* Fix order of the imports

* Add remote.py to .coveragerc

* Optimize MAC address validation

* Use storage helper class and improve code readability

* Add me to the manifest as a code owner

* Fix dosctring

* Add me to the code owners

* Remove storage schemas, rename storage keys and improve readability
2019-12-02 13:20:36 -08:00
NobleKangaroo
67498595e4 Add Emulated Hue code owner (#29319) 2019-12-02 21:29:31 +01:00
Andreas Oberritter
64628c1f70 Add ATEN PE component for ATEN eco PDUs (#27960)
* Add ATEN PE component for ATEN eco PDUs

* aten_pe: Require host configuration

* aten_pe: Do not import from other integrations

* aten_pe: Include unnamed outlets

* aten_pe: Avoid get() for config entries having default values

* aten_pe: Fix documentation URI

* aten_pe: Remove unused return value

* aten_pe: Update atenpdu lib to 0.2.0 for asyncio

* aten_pe: Raise exception if initialization fails

* aten_pe: Update atenpdu lib to 0.3.0 for improved exception handling
2019-12-01 17:46:12 +01:00
Wim Haanstra
daed314585 Dsmr reader (#28701)
* Added DSMR Reader platform

- Added DSMR Reader platform
- Updated codeowners for other components I added earlier

* Move sensor definitions to new file

* Sensor definitions in new file

* Add energy prices from MQTT

* lint fixes

* Black formatted some files

* Update .coveragerc

* Support transform methods on definitions

* Manifest mangled by Black, fixed

* Visual studio code reformatting dictionary error

* Fix issues with code, remove unrelated manifest changes

* Update CODEOWNERS
2019-11-28 20:30:24 +01:00
Paulus Schoutsen
004476a1f8 Add intent integration to expose intent handle API (#29124)
* Add intent integration to expose intent handle API.

* Run hassfest + fix scaffolding

* Update __init__.py
2019-11-27 11:25:43 +01:00
Colin O'Dell
0849d42dc6 Remove the alarm_control_panel CODEOWNER (#29114)
Although I originally contributed this component, I no longer use it myself and haven't been following the internal development of HA, so I'm no longer a good person to review any further changes to this component.  I would therefore like to relinquish my CODEOWNER status over this component.
2019-11-26 21:57:45 +01:00
Nikolay Vasilchuk
a37260faa9 StarLine integration (#27197)
* Device Tracker works

* Device Tracker works

* Binary Sensor

* Sensor

* Lock

* Switch and service

* New switches

* Update interval options

* WIP

* Translation errors

* Check online state

* WIP

* Move to aiohttp

* Some checks

* CI

* CI

* .coveragerc

* Black

* icon_for_signal_level test

* update_interval renamed to scan_interval

* async logic

* Fix cookie read

* Requirement starline

* Reformat

* Requirements updated

* ConfigEntryNotReady

* Requirement starline

* Lint fix

* Requirement starline

* available status

* Translations

* Expiration to config

* CI

* Linter fix

* Small renaming

* Update slnet token

* Starline version bump

* Fix updates

* Black

* Small fix

* Removed unused fields

* CI

* set_scan_interval service

* deps updated

* Horn switch

* Starline lib updated

* Starline lib updated

* Black

* Support multiple integrations

* Review

* async_will_remove_from_hass

* Deps updated

* Test config flow

* Requirements

* CI

* Review

* Review

* Review

* Review

* Review

* CI

* pylint fix

* Review

* Support "mayak" devices

* Icons removed

* Removed options_flow

* Removed options_flow test

* Removed options_flow test
2019-11-26 11:17:11 -08:00
Adam Cheng
6e7b5b71f5 Add scale and offset to temperature values to Modbus Climate (#27045)
* Add scale and offset to temperature values

* fix (no-else-return)

* Update manifest.json

* Added codeowners
2019-11-25 20:59:01 -08:00
Heine Furubotten
04754b354c Entur public transport code owner (#29080)
* entur code owner

* gen codeowners file
2019-11-25 23:45:33 +01:00
Heine Furubotten
66b7dfec53 Nilu integration code owner (#29081)
* nilu code owner

* gen codeowners file
2019-11-25 23:45:14 +01:00
majuss
3dd5222ec7 Bumped lupupy to version 0.0.18 (#28989)
* Bumped lupupy

* Ran gen req

* Ran gen hassfest


Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2019-11-25 20:21:54 +01:00
Michaël Arnauts
c21c167f4e Use TADO_MODE for temperature overrides in tado climate component. (#29014)
* Use TADO_MODE for temperature overrides in tado climate component.

* Fix typo in pydoc

* Add myself as a code owner

* Update CODEOWNERS file
2019-11-25 14:04:36 +01:00
Chris Mandich
08432c7c09 Add flume support (#27235)
* Add Flume Sensor

Add support for Flume API and sensor

* Add support for choosing timezone

Timezone is now a required option in configuration.yaml

* Add Flume to coveragerc and CODEOWNERS

Add flume to be ommited from testing. Add @ChrisMandich as Flume Code owner

* Revert "Add Flume to coveragerc and CODEOWNERS"

This reverts commit 0b27437a3b.

* Update manifest.json

Added Documentation URL for Flume to HASS.IO

* Update manifest.json

Added missing Newline at EOF.

* Update sensor.py

Update sensor to not required Device ID for configuration. Now loops through all available Type 2 devices and adds them as an entity.

* Update Manifest, CODEOWNERS, and manifest.json

Resolved errors related to code owners and requirements. Using hassfest and gen_requirements_all

* Update sensor.py

Implemented recommendations from @Quentame. Including time zone from Home Assistant, Updated variable names, and Consolidated duplicate functions.

* Implemented suggested changes from @Quentame

This includes: components name, using f-strings instead of concat, snake_case for variables, constants for the addition of future device types, clearer errors, and removed variables no longer in use.

* Update sensor.py

Restored unit_of_measurement. Updated return to "gal".

* Address pylint errors

* Update sensor.py

Include protected attributes in setup_platform.

* Address Pylint errors

homeassistant/components/flume/sensor.py:63:11: W0703: Catching too general exception Exception (broad-except)
homeassistant/components/flume/sensor.py:133:8: R1720: Unnecessary "else" after "raise" (no-else-raise)
homeassistant/components/flume/sensor.py:162:8: R1705: Unnecessary "else" after "return" (no-else-return)
homeassistant/components/flume/sensor.py:236:8: R1720: Unnecessary "else" after "raise" (no-else-raise)

* Update sensor.py

I'm okay with the broad exception clause.
homeassistant/components/flume/sensor.py:65:11: W0703: Catching too general exception Exception (broad-except)

* Update sensor.py

Add more specific exceptions for Try/Except.

* Update Flume Sensory.py

add requirements, exclude from tests, us pyflume pypi package.

* Update sensor.py to support latest pyflume package

* Update manifest

provide better flow of manifest and easier readibility.

* Update manifest.json

Reccomended by @balloob as it is already a core requirement

* Update sensor.py

Add proposed changes from @balloob

* Update requirements_all.txt

pytz is a core dependency, removing flume's requirement for it.

* Update sensor.py

Added @MartinHjelmare recommended changes.

* Update sensor.py

Resolving PyLint error

* Update sensor.py

Remove `KeyError`. Add length check for flume entity list before adding.

* Update sensor.py

* Update pyflume version

* Update imports with isort

* Add line break between standard library and thirdparty imports.

* Remove throttle from sensor.py
2019-11-23 09:55:46 +01:00
Jonas
829e0a7c42 Add Proxmox VE integration (#27315)
* Added the Proxmox VE integration

* Fixed code as described in PR #27315

* Fixed small linting error

* Fix code as described in PR #27315 code review

* Improve code as described in PR #27315
2019-11-22 23:03:41 +01:00
Rohan Kapoor
cd8c281cb6 Add @rohankapoorcom to CODEOWNERS for speedtestdotnet and fastdotcom (#28879) 2019-11-19 13:43:21 -06:00
Steven Impens
475c8ebae2 Add component VersaSense (#24619)
* Add component VersaSense

* Updates based on review

* Changes based on review

* Fixed whitespace

* Fixed lines too long

* Fixed lines too long

* Formatted using black

* Added available property

* Set unavailable property appropriately

* Conversion to f-strings

* Load platform only once per platform

* Fixed duplicate identifiers across multiple devices

* Single call to async_add_entities during setup

* Removed unnecessary async/await syntax

* Added constants for key-value pairs

* Removed async/await syntax

* Added breaks in measurement check

* Added guard clause for discovery_info
2019-11-19 14:05:23 +01:00
Malte Franken
4e9e9efa43 GeoNet NZ Volcanic Alert Level sensor (#26901)
* first version of new integration

* moved icon to shared consts

* added unit tests

* transformed from geolocation to sensor integration

* alert level is now the state of the sensor

* adopted unit tests

* fixed comment

* keep all sensors registered even if the feed update fails intermittently

* bumped version of upstream library

* bumped version of integration library

* regenerated requirements

* bumped version of integration library

* bumped version of integration library

* fixed generated file

* removed commented out code

* regenerated config flow file

* update to latest integration library version

* simplified code

* removed debug log statement

* simplified code structure

* defined constant

* use core interfaces

* moved test and fixture

* sorted imports

* simplified patching

* moved fixture to central config file
2019-11-19 14:00:59 +01:00
Michaël Arnauts
d6e99db38e
Fix Comfoconnect errors during startup (#28802)
* Add callback registrations to async_added_to_hass

* Fix CODEOWNERS

* Fix code formatting

* Requested changes.

* Don't pass unused hass and fix string formatting

* Fix import order.
2019-11-16 15:05:17 +01:00
Davide Varricchio
d796053d9f Add support for Hisense AEH-W4A1 wifi module (AC remote control) (#28641)
* First commit

* First working release, but there's a lot to do

* Added support for preset_modes

* Refined logic

* Added translations for config_flow

* Updated translations

* modified:   homeassistant/components/hisense_aehw4a1/climate.py

* modified:   climate.py

* Updated library to latest version

* Small changes

* Null states when AC off

* Minor fixes

* Latest updates for TOX

* First commit

* First working release, but there's a lot to do

* new file:   requirements_test_all.txt

* Added support for preset_modes

* Refined logic

* Added translations for config_flow

* Updated translations

* modified:   homeassistant/components/hisense_aehw4a1/climate.py

* modified:   climate.py

* Updated library to latest version

* Small changes

* Null states when AC off

* Minor fixes

* Latest updates for TOX

* new file:   requirements_test_all.txt

* Fighting with tox

* vs Tox round 2

* Isort and updated requirements_test_all.txt

* Fighting with lint

* Implemented available state

* Changed exception type after Travis-ci pylint fails

* Support entry in configuration.yaml

* Removed commented code

* Switched to async

* Minor changes

* Updated library and fixed pylint errors

* Code optimization

* Implemented static ip addresses in configuration.yaml

* Reverted to existing constant

* Corrected pylint wrong-import-order

* Recovery from nuke event (messing all while rebase)

* Resolved Ci error

* Changes for PR

* Corrected temp scale for frontend

* Added test for config entry from configuration.yaml

* Updated dependency

* Check on manual config

* Imported custom exceptions and modified import config

* Optimized

* Change based on PR revision

* Added logging for failure event on manual config

* Tests added but to be corrected

* Edited tests

* Tests updated to ensure no I/O

* Working on tests

* Cheanges based on revision for PR

* Setting librey exception as direct side_effect in test

* Final changes for PR

* Redundand on command solved

* Improved AC logic
2019-11-15 21:22:24 +01:00
Jon Gilmore
aea7c1c0ce Add codeowner for lutron integration (#28682)
* add codeowner for lutron integration

* ran hassfest
2019-11-11 01:51:24 +01:00
Shulyaka
58eeea903f Add pcal9535a integration (#26563)
* Support for PCAL9535A chip

Signed-off-by: Denis Shulyaka <Shulyaka@gmail.com>

* Code review changes

* Code review changes

* Fix import order

* Fix import order

* Apply suggestions from code review
2019-11-09 08:14:46 +01:00
Heine Furubotten
af73e54aee Add azure servicebus notify service (#27566)
* Add azure servicebus notify service

* files added to .coveragerc

* fix: import content type from const

* Moved imports to top level

* Code review fixes
+ added code owner
+ fixed config validation with has at least one
+ seperate attributes for dto to asb
* fixed doc link
* async setup instead of sync

* rename all the things
- removed too many ifs
* changed setup back to sync
+ comment about sync IO in lib

* More informative logging

* logging exception -> error
2019-11-07 14:47:44 +01:00
Franck Nijhof
78b83c653a
Add WLED integration (#28542)
* Add WLED integration

* Use f-string for uniq id in sensor platform

* Typing improvements

* Removes sensor & light platform

* Remove PARALLEL_UPDATES from integration level

* Correct type in code comment 'themselves'

* Use async_track_time_interval in async context

* Remove stale code

* Remove decorator from Flow handler

* Remove unused __init__ from config flow

* Move show form methods to sync

* Only wrap lines that can raise in try except block

* Remove domain and platform from uniq id

* Wrap light state in bool object in is_on method

* Use async_schedule_update_ha_state in async context

* Return empty dict in device state attributes instead of None

* Remove unneeded setdefault call in setup entry

* Cancel update timer on entry unload

* Restructure config flow code

* Adjust tests for new uniq id

* Correct typo AdGuard Home -> WLED in config flow file comment

* Convert internal package imports to be relative

* Reformat JSON files with Prettier

* Improve tests based on review comments

* Add test for zeroconf when no data is provided

* Cleanup and extended tests
2019-11-06 23:55:39 +01:00
Jesse Hills
a43095b2b5 Add override switch for juicenet (#28049)
* Add override switch for juicenet

* Update generated files

* Update indentation

* Fix indentation

* Remove unnecessary else statement

* Update homeassistant/components/juicenet/switch.py

Co-Authored-By: Fabian Affolter <mail@fabian-affolter.ch>

* Update homeassistant/components/juicenet/switch.py

Co-Authored-By: Fabian Affolter <mail@fabian-affolter.ch>

* Remove state property

* Change string formatting

* Bump juicenet package version again
2019-11-05 14:24:20 +01:00
Bouwe Westerdijk
fb0e20543e Update Plugwise (#28237)
* Plugwise update

* Fix DEFAULT_NAME

* Fix pylint errors

* Remove showing of DHW-status

* Remove `if not None` where possible

* Forgot to remove dhw-related code

* Updated w.r.t. comments from MartinHjelmare

* Remove the illuminance attribute - move to sensor

* Update homeassistant/components/plugwise/climate.py

Co-Authored-By: Martin Hjelmare <marhje52@kth.se>

* Breaking lines

* Remove thermostat_temperature

* Try fix lint errors.

* Remove spaces

* Remove more spaces
2019-11-05 02:58:17 +01:00
Pascal Vizeli
99c0559a0c
Speech to Text component (#28434)
* Initial commit for STT

* Fix code review
2019-11-04 13:10:42 +01:00
Paulus Schoutsen
79ac77a93d
Almond integration (#28282)
* Initial Almond integration

* Hassfest

* Update library

* Address comments

* Fix inheritance issue py36

* Remove no longer needed check

* Fix time
2019-10-28 23:47:31 -07:00