Commit Graph

1560 Commits

Author SHA1 Message Date
Niccolo Zapponi 5ddf99e496
Add support for OpenWeatherMap One Call API (#39839) 2020-11-03 08:37:30 -10:00
Schachar Levin af048715f0
Add next alarm time sensor to Garmin (#40420)
* Add sensor for garmin next alarm(s)

* code-review changes

* type fix

* linter fix

* review fixes
2020-10-23 23:01:29 +02:00
Erik Montnemery b626df1316
Improve cast integration tests (#42229)
* Improve cast tests

* Address review comments

* Further cleanup of tests
2020-10-23 16:16:55 +02:00
Greg Dowling 9a54c31c34
Add media browser support to roon media player (#42061) 2020-10-22 14:54:55 +02:00
Chris Talkington d8577a1550
Add config flow for cloudflare (#41167)
* add config flow for cloudflare

* Create const.py

* work on flow.

* remove const.

* lint.

* Apply suggestions from code review

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update config_flows.py

* Update homeassistant/components/cloudflare/strings.json

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review

* Update strings.json

* Apply suggestions from code review

* Update __init__.py

* Update __init__.py

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-10-21 09:09:00 -05:00
rajlaud fcdb54d878
Add browse media support to squeezebox integration (#40642)
* Add browse media support to squeezebox integration

* Move browse media logic to browse_media.py

* Fix missing command when loading single url

* Update .coveragerc

* Handle empty library gracefully

* Apply suggestions from code review

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Implement suggestions from code review

* Additional suggestion from code review

* Use MEDIA_CLASS_GENRE

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-10-20 01:17:00 -05:00
Paulus Schoutsen 39ba0fc7ee
Remove BOM integration because it uses webscraping (#41941)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-10-17 13:56:11 +02:00
J. Nick Koston ad6ce5fa83
Convert rest sensors to async using httpx (#41973) 2020-10-16 19:21:13 -05:00
Paulus Schoutsen 2f69b53bc3
Fix upcloud coverage that is breaking CI (#41934) 2020-10-16 11:30:51 +02:00
Jason Hunter c10fe4f723
Add sensors to Xbox integration (#41868)
* favorited friends binary sensors

* add binary_sensor to .coveragerc

* fix copy/paste comments...

* make sensor entities instead of attributes

* address PR review comments

* default state to None
2020-10-15 19:11:05 -04:00
On Freund 086378c48f
Add media browser capability to volumio (#40785) 2020-10-15 15:49:36 +02:00
Jason Hunter 2b1fc90de7
Add Media Source to Xbox Integration (#41833)
* initial implementation of xbox media source

* minor fixes

* fix lint

* add media class map to remove multi-line ternary
2020-10-14 15:02:08 -04:00
epenet 3cba25a892
Add test coverage for onewire (#40786)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-10-14 10:19:12 +02:00
Jason Hunter 3013f39191
Add Remote entity to Xbox Integration (#41809) 2020-10-13 21:00:44 -04:00
Jason Hunter c3ccea52a5
Add Browse Media to Xbox (#41776)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-10-13 17:51:51 +02:00
Jason Hunter 9877e8e25b
Add Xbox Integration (#41697)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-10-13 15:37:01 +02:00
Niccolo Zapponi 8a45bc2d13
Add support for SimpliSafe sensors (#41080)
* Add support for SimpliSafe sensors

* Turn sensor refresh rate to a configurable setting

* Set minimum to scan interval

* Removed dynamic sensor refresh rate

* Refactoring

* Refactoring

* Move battery entities to binary_sensor platform

* Bug fix

* Clean up

* Simplified device info override

* Ignore sensor cache
2020-10-12 11:31:55 -06:00
Angelo Gagliano 874e1f6103
Prevent tplink missing devices and unavailable state (#39762)
* Adds self to codeowners for tplink

* Adds retry to update to prevent missing devices

* Runs through isort and corrects async commit

* Runs through black

* Runs through pre-checks

* Corrects and matches var names

* Re-runs through black

* Corrects var name

* Removes the retry loop and in favor of async add

* Cleanup imports

* Removes no longer valid test

* Removes is_ready and only log retry once

* Corrects switch logging vars

* Adds list of entities to add_entities

* Consumes exception for attempt_update

* Consumes specific exception

* Removes unnecessary update

* Reducing back to 2 seconds

* Removes useless return

* Call get_sysinfo for all at once

* Formated black

* Adds missing docstirng

* Corrects docstring

* Update homeassistant/components/tplink/light.py

Co-authored-by: Anders Melchiorsen <amelchio@nogoto.net>

* Corrects sysinfo call

* Adds default for host vars

* Adds log when device responds again

* Revert host alias default

* Removes unncessary host var

* Removes host var

* Get device details from sysinfo

* Use host and alias for log msg

* Gets hosts from smartbulb

* Changes retry logging to debug

* Attempts coverage add

* Removes unused import

* Updates tests for new retry

* Runs through isort

* Removes unneeded try

* Prevents static entries from failing integration

* Format black

* Forces an update after turn on off

* Remove common test

* Revert update after turn_on off

* Adds patch for sleep_time 0

* Returns False when update fails

Co-authored-by: Anders Melchiorsen <amelchio@nogoto.net>
2020-10-11 21:10:36 +02:00
Martin Hjelmare e006e0ddb3
Revert zoneminder config flow (#41395) 2020-10-07 16:28:49 +02:00
Raman Gupta 6db4075a23
Add OZW node config parameters websocket commands (#40527)
* add websocket commands to retrieve and set config parameters for a node

* move set_config_parameter into generic function and refactor service and WS API

* add payload to return to make service call behave the same way it did before

* create response class

* update error message to pass tests

* move things a bit to reduce LOC

* add tests

* handle logging errors better and make new response class more generic to prepare for lock user code work

* remove unused function parameter

* invert check

* add additional error checking

* refactor a bit to remove repeat code

* revert log msg change

* one more refactor to create generic get_config_parameters function

* change if logic for consistency

* fix test

* add support to provide bool value in set_config_parameter service call

* standardize parameter names on service call

* add test coverage

* fix tests and message sending

* remove unnecessary logging import

* fix one test to get missing coverage

* update per martin and kpines reviews

* remove false assertion

* string line length

* add support for Decimal config param, remove node instance ID as input, and move helper functions to node.py

* cast Decimal appropriately

* revert change to support Decimal for config params since they are not supported as a config param type

* revert to using error arguments to make next PR for WS lock commands easier

* switch to class method and add guard for list Value not being a number

* update logic to use new openzwavemqtt util methods

* add support for bitsets

* use parent exception class

* bump openzwavemqtt version, remove node.py from .coveragerc and put file references in the right place

* add comment

* improve config validation

* remove bitset support from config validation

* re-add bitset support with some additional tests

* move send_result out of try block
2020-10-05 21:47:28 +02:00
Daniel Hjelseth Høyer 9bdc716e60
Include config flow modules in coverage (#40798)
* update coveragerc

* typo
2020-09-30 19:55:26 +02:00
Quentame 1d816d25f7
Add Surveillance Station home mode switch for Synology DSM (#40490)
* Use camera name as device name

* Add Surveillance Station home mode switch for Synology DSM

- camera uses Surveillance Station as device parent
- camera uses camera name instead of NAS name + camera name

* Without device_class otherwise no icon

* Update .coveragerc
2020-09-30 18:27:06 +02:00
jan iversen 0ca19133d9
Add tests for modbus binary sensor (#40367)
* Add test coverage of binary sensor.

Update conftest to be generic.

* Pass total config structure to run_base_test.

Simple devices like sensor/switch do only have one entry in the
dict array, whereas e.g. switch have multiple entries.

* Use STATE_ON / _OFF for binary_sensor test.

* Update coveragerc

Only exclude files that uses a third party library.

* Remove modbus/* from coveragerc

* Remove modbus from .coveragerc

* Update .coveragerc

Co-authored-by: Chris Talkington <chris@talkingtontech.com>
2020-09-27 20:00:44 -05:00
epenet f886ea9e3d
Move onewire constants to separate file (#40550)
* Move constants to separate file

* Ignore coverage of const.py
2020-09-27 19:02:20 -05:00
tkdrob 67a7b28c84
Add Integration for Goal Zero Yeti Power Stations (#39231)
* Add Integration for Goal Zero Yeti Power Stations

* Goal Zero Yeti integration with config flow

* Remove unused entities

* Remove entry from requirements_test_all

* Pylint fix

* Apply suggestions from code review

Co-authored-by: Franck Nijhof <frenck@frenck.nl>

* Add tests for goalzero integration

* Fix UNIT_PERCENTAGE to PERCENTAGE

* isort PERCENTAGE

* Add tests

* Add en translation

* Fix tests

* bump goalzero to 0.1.1

* fix await

* bump goalzero to 0.1.2

* Update tests/components/goalzero/__init__.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* apply recommended changes

* isort

* bump goalzero to 0.1.4

* apply recommended changes

* apply recommended changes

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-09-27 12:44:21 -05:00
Oliver Acevedo 0c12af347e
Add Omnilogic integration (#40474)
* Scaffold

* Added the en translation

* Modified the name

* Basic functionality for config flow.

* Pulled in enough to validate config flow works.

* Update manifest.json

* initial data polling (water and air temp sensors)

* Adding sensors, debugging update function

* polling updates working

* support for new data format from library

* Updated entity_id, friendly name, conversion for ppm, attributes for hayward display units, MSPSystemID and component systemID

* Fixed errors for PR

* clean up

* Add login exc, check if configured, test login.

* Remove debug print.

* Black formatting, ran isort, update requirements.

* Updated w isort. fix flake8 failures.

* Fix flake8 errors

* Fixed self.attrs to remove invalid self._ values - small change

* Missed on small change - fixing attributes

* Updated naming, updated unit of measure, updated icon, bumped omnilog…

* Updated to fix flake8 issues in __init__.py and config_flow.py

* Updated test_config_flow.py to pass, updated config_flow.py to correct errors in test

* Remove comments in preparation for PR

* update .covezragerc

* Formatting fix

* Rewrote sensors to dynamically add all BOWs, pumps, clorinators. Still to do - add CSAD sensors.

* Rewrote sensors to dynamically add all BOWs, pumps, clorinators. Still to do - add CSAD sensors.

* Added CSAD sensors for pools that have them.

* Added CSAD sensors for pools that have them.

* Fixed CSAD to not create if blank or don't exist, removed broad except usage to pass linting.

* Updated entity naming convention. Fixed linting issues.

* Added device association to the back yard / omnilogic system

* Removed .0 from ppm values when returning imperial values for salt sensor

* Updated to return state = None for water temp when pump is off, handled Chlorinator operatingMode = 2, and added PlatformNotReady check

* Corrected exception from Omnilogic library

* Bumped omnilogic to 0.3.7. Added alarm sensor/data to sensors. Handle pump off condition for ph and orp sensors.

* Bumped omnilogic to 0.3.7. Added alarm sensor/data to sensors. Handle pump off condition for ph and orp sensors.

* Bumped omnilogic to 0.3.7. Added alarm sensor/data to sensors. Handle pump off condition for ph and orp sensors.

* Removed nested_lookup dependency, bumped omnilogic.py to 0.3.8.

* Fixed lint error

* Added logging for sensor creation.

* Fixed linting errors with logging.

* Fixed explicit chaining of raised error. Fixed issue with alarm sensor.

* Fixed manifest.json based on feedback.

* Fixed self.attrs, should_poll, CoordinatorEntity, SCAN_INTERVAL from comments in PR.

* Addressed unique_id, moved data update coordinator, addressed minor other issues from testing

* Created main OmniLogic entity for common items, reworked DataUpdateCoordinator to it's own class.

* Addressed config_schema not used in __init__.py

* Fixed linting issues.

* Addressed several comments, still todo - separate sensor classes.

* Split the Omnilogic Sensors into separate logical classes for simpler logic.

* Fixed snake case lint error for AddAlarms (to add_alarms)

* Addressed config_flow issues from comments.

* Changed addressed ConfigNotReady issue from comments.

* Updated strings.json and generated corrected en.json with translations.

* Updated en.json to standard generated file.

* Added config_flow tests and updated issue with config_flow on cannot_connect

* Added test case for incomplete information entered.

* Compressed logic in the sensor classes to reduce duplication.

* Updated strings.json for polling_interval, added generic exception handling on config flow.

* Removed omnilogic from the .coveragerc omit file.

* Updated test_config_flow to follow recommended pattern.

* Excluded sensor.py from test coverage tests.

* Corected minor issues in test_config_flow from comments

* Fixed linting issues on last commits

* Fixed linting issues.

* Corrected issue when temp state is not available from Omnilogic

* Added omnililogic_common.py from .coveragerc to bypass test coverage check.

* Return false on Login Exception, handle OmniLogicException in config_flow and in tests.

* Handle all exceptions and in config_flow and tests, clarified test naming.

* Broke out test cases per comments.

* Regenerated en.json file.

* Addressed changes from comments in PR.

* Added session and bumped API to 0.4.0, addressed other comments from PR.

* Addressed entitydata (missed earlier).

* Fixed pylint issue

* Added test case for options flow in test_config_flow.py

* Removed super() and used self when calling methods in current class.

* Addressed comments in PR.

* Addressed comments in PR.

* Updated translations file.

* Rewrote data coordinator to output dict for easy searching.

* Updated chlorinator unit when chlorinator is on/off only

* Scaffold

* Added the en translation

* Modified the name

* Basic functionality for config flow.

* Pulled in enough to validate config flow works.

* Update manifest.json

* initial data polling (water and air temp sensors)

* Adding sensors, debugging update function

* polling updates working

* support for new data format from library

* Updated entity_id, friendly name, conversion for ppm, attributes for hayward display units, MSPSystemID and component systemID

* Fixed errors for PR

* clean up

* Add login exc, check if configured, test login.

* Remove debug print.

* Black formatting, ran isort, update requirements.

* Updated w isort. fix flake8 failures.

* Fix flake8 errors

* Fixed self.attrs to remove invalid self._ values - small change

* Missed on small change - fixing attributes

* Updated naming, updated unit of measure, updated icon, bumped omnilog…

* Updated to fix flake8 issues in __init__.py and config_flow.py

* Updated test_config_flow.py to pass, updated config_flow.py to correct errors in test

* Remove comments in preparation for PR

* update .covezragerc

* Formatting fix

* Rewrote sensors to dynamically add all BOWs, pumps, clorinators. Still to do - add CSAD sensors.

* Rewrote sensors to dynamically add all BOWs, pumps, clorinators. Still to do - add CSAD sensors.

* Added CSAD sensors for pools that have them.

* Added CSAD sensors for pools that have them.

* Fixed CSAD to not create if blank or don't exist, removed broad except usage to pass linting.

* Updated entity naming convention. Fixed linting issues.

* Added device association to the back yard / omnilogic system

* Removed .0 from ppm values when returning imperial values for salt sensor

* Updated to return state = None for water temp when pump is off, handled Chlorinator operatingMode = 2, and added PlatformNotReady check

* Corrected exception from Omnilogic library

* Bumped omnilogic to 0.3.7. Added alarm sensor/data to sensors. Handle pump off condition for ph and orp sensors.

* Bumped omnilogic to 0.3.7. Added alarm sensor/data to sensors. Handle pump off condition for ph and orp sensors.

* Bumped omnilogic to 0.3.7. Added alarm sensor/data to sensors. Handle pump off condition for ph and orp sensors.

* Removed nested_lookup dependency, bumped omnilogic.py to 0.3.8.

* Fixed lint error

* Added logging for sensor creation.

* Fixed linting errors with logging.

* Fixed explicit chaining of raised error. Fixed issue with alarm sensor.

* Fixed manifest.json based on feedback.

* Fixed self.attrs, should_poll, CoordinatorEntity, SCAN_INTERVAL from comments in PR.

* Addressed unique_id, moved data update coordinator, addressed minor other issues from testing

* Created main OmniLogic entity for common items, reworked DataUpdateCoordinator to it's own class.

* Addressed config_schema not used in __init__.py

* Fixed linting issues.

* Addressed several comments, still todo - separate sensor classes.

* Split the Omnilogic Sensors into separate logical classes for simpler logic.

* Fixed snake case lint error for AddAlarms (to add_alarms)

* Addressed config_flow issues from comments.

* Changed addressed ConfigNotReady issue from comments.

* Updated strings.json and generated corrected en.json with translations.

* Updated en.json to standard generated file.

* Added config_flow tests and updated issue with config_flow on cannot_connect

* Added test case for incomplete information entered.

* Compressed logic in the sensor classes to reduce duplication.

* Updated strings.json for polling_interval, added generic exception handling on config flow.

* Removed omnilogic from the .coveragerc omit file.

* Updated test_config_flow to follow recommended pattern.

* Excluded sensor.py from test coverage tests.

* Corected minor issues in test_config_flow from comments

* Fixed linting issues on last commits

* Fixed linting issues.

* Corrected issue when temp state is not available from Omnilogic

* Added omnililogic_common.py from .coveragerc to bypass test coverage check.

* Return false on Login Exception, handle OmniLogicException in config_flow and in tests.

* Handle all exceptions and in config_flow and tests, clarified test naming.

* Broke out test cases per comments.

* Regenerated en.json file.

* Addressed changes from comments in PR.

* Added session and bumped API to 0.4.0, addressed other comments from PR.

* Addressed entitydata (missed earlier).

* Fixed pylint issue

* Added test case for options flow in test_config_flow.py

* Removed super() and used self when calling methods in current class.

* Addressed comments in PR.

* Addressed comments in PR.

* Updated translations file.

* Rewrote data coordinator to output dict for easy searching.

* Updated chlorinator unit when chlorinator is on/off only

* Fixed ORP method not being @property, fixed unique_id potential issue. Does not address comments from PR.

* Rewrote coordinator for updated dict structure, rewrote sensors to parse new data structure.

* Added alarms as attributes on all entities which support alarm reporting.

* Updated SENSOR_TYPES to sensor_types to adhere to snake case in pylint.

* Addressed PR comments.

* Update homeassistant/components/omnilogic/sensor.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/omnilogic/sensor.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/omnilogic/sensor.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/omnilogic/sensor.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/omnilogic/sensor.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/omnilogic/sensor.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/omnilogic/sensor.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/omnilogic/sensor.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/omnilogic/sensor.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/omnilogic/sensor.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/omnilogic/sensor.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/omnilogic/sensor.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/omnilogic/sensor.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/omnilogic/sensor.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/omnilogic/sensor.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/omnilogic/sensor.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Removed binary sensor conditions (alarms, on/off sensor types) and added ability for multiple guard conditions

* Update homeassistant/components/omnilogic/sensor.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Updated per comments in PR for Pump Type and removal of force_update().

* Update homeassistant/components/omnilogic/sensor.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/omnilogic/common.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Correctly asserting conditions for the login exception case.

* Update .coveragerc

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

Co-authored-by: Mike Hershberger <mike.hershberger@gmail.com>
Co-authored-by: Chad <54695185+chadlyy@users.noreply.github.com>
Co-authored-by: Tim Empringham <tim.empringham@live.ca>
Co-authored-by: djtimca <60706061+djtimca@users.noreply.github.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-09-25 17:55:10 +02:00
Tom Schneider 6e8e4eedb5
Add binary_sensor for elevator states to hvv_departures (#36822)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-09-22 17:42:50 +02:00
Perry Naseck 0582bf7746
Firmata analog input, PWM/analog output, deprecate arduino (#40369)
* firmata analog input

* firmata pwm/analog out, use more HA const

* firmata update pymata to 1.19

* deprecate arduino, firmata supersedes it

* firmata sensor diff min, pull review quality changes

* firmata condense platform setup into loop
2020-09-22 09:44:16 +02:00
Brett 4f5d3b4035
Rebuilt Splunk using custom library (#40123)
* Rebuilt Splunk using splunk_data_sender

* Fixing lint issues

* Apply suggestions from code review

Recommended Fixes

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Moved to single send queue and fixed ssl verify

* Using coroutine and Asyncio.lock

* Changed to custom library hass_splunk

* Fixed "use_ssl" parameter

* Better error catching

* Better error log

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-09-20 11:22:43 +02:00
Robert Van Gorkom 70173488a8
Add config support to zoneminder integration (#37060)
* Add config support to zoneminder integration.

* Fixing spelling issue.
Adding self to maintainers.
Updating config flows generated file.

* Maintain zoneminder functionality without breaking changes.

* Addressing lint feedback.
Updating code owners.

* Using non-blocking calls.

* Adding tests package file.

* Update service description.

Co-authored-by: Rohan Kapoor <rohan@rohankapoor.com>

* Resolving conflicts in requirements file.

* Resolving more conflicts.

* Addressing PR feedback.

* Merging from dev.

Co-authored-by: Rohan Kapoor <rohan@rohankapoor.com>
2020-09-16 22:58:51 -07:00
Chris Talkington 00acb180d6
Add canary alarm_control_panel tests (#40029)
* add canary alarm_control_panel tests

* Update .coveragerc

* Create test_alarm_control_panel.py

* Update __init__.py

* Update __init__.py

* Update test_alarm_control_panel.py

* Update test_alarm_control_panel.py

* Update test_alarm_control_panel.py

* Update test_alarm_control_panel.py

* Update __init__.py

* Update __init__.py

* Update test_alarm_control_panel.py

* Update test_alarm_control_panel.py

* Update test_alarm_control_panel.py

* Update test_alarm_control_panel.py

* Update test_alarm_control_panel.py

* Update test_alarm_control_panel.py

* Update test_alarm_control_panel.py

* Update test_alarm_control_panel.py

* Update test_alarm_control_panel.py

* Update test_alarm_control_panel.py
2020-09-13 16:36:26 -05:00
AJ Schmidt c32f698671
Add Config Flow to AlarmDecoder (#37998) 2020-09-13 12:29:25 -05:00
Xiaonan Shen b66aaeea99
Add camera support to synology_dsm (#39838)
* Add camera support to synology_dsm

* Code improvements

* More code improvements
2020-09-10 21:08:37 +02:00
Chris Talkington 74219663d6
Fix nzbget sensors (#39833)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-09-09 14:56:40 +02:00
Paulus Schoutsen 1e2741ff1b
Some shelly fixes (#39798) 2020-09-08 15:12:20 +02:00
Simone Chemelli 0c8630a2f0
Support shelly cover(roller) mode (#39711)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-09-08 10:35:01 +02:00
Tom bb9ea7ce6e
Add tests for Plugwise integration (#36371) 2020-09-08 08:37:44 +02:00
cgtobi ef8cdf0405
Add Kodi media browser support (#39729)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-09-07 18:22:20 +02:00
Paulus Schoutsen b07628ae57
Rework Shelly sensors (#39747)
* Rework Shelly sensors

* Lint

* Add shelly/entity to coveragerc
2020-09-07 14:13:20 +02:00
Evgeny b0192cf9c0
Add OpenWeatherMap config_flow (#34659)
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-09-04 18:22:50 -05:00
Andrew Marks 01bac9f433
Refactor sharkiq tests (#39564)
* Refactor sharkiq tests

* Fix linting

* Remove unussed logger

* Test one more code branch

* Don't patch integration files

* Remove legacy calls

* Linting fixes

* Refactor coordinator update tests

* Reformat test params

* Refector config flow tests

* Minor code cleanup

* Fix spelling error

* Address review

* Minor formatting change

* Remove vacuum.py from .coveragerc
2020-09-04 15:13:11 -05:00
Markus Bong fa1b8c824c
Add devolo thermostat devices (#38594)
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-09-04 08:33:54 -05:00
Angelo Gagliano eb7742ea7c
Add support for VeSync Fans (#36132)
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-09-03 21:05:37 -05:00
Maciej Bieniek 226406b853
Improve tests for GIOS integration (#39514) 2020-09-03 09:27:21 +02:00
Tom Harris 75153dd4a3
Apply code review for insteon config flow (#39171)
* Move options import to async_setup_entry

* Add tests for insteon init

* Move common constants to const

* Clean up to adhear to standards

* Create mock insteon device manager

* Update for HA standards

* Use keys and align to config_flow steps

* Fix default port for hub v1

* Update doc string to represent function

* Remove dump print commands

* Add modem_type entry

* Simplify dict key test

* Setup platforms in async_setup_entry

* Black

* Black tests
2020-08-30 19:15:09 -04:00
Arda ŞEREMET e707b50658
Add integration for ProgettiHWSW automation boards (#37922)
* Opened a new fresh page to clean my mess.

* Solved pylint warnings

* Fixing pylint issue of defining attr outside init.

* Excluded files from being tested by codecov.

* Solved binary sensor error.

* Fixed some stylisation errors.

* Resolved input not updating problem.

* Added port entry to test file.

* Added tests for create_entry.

* Added support for better state management.

* Increased code coverage of config_flow.py & made some tweaks.

* Increased coverage of config_flow.py by adding tests for unknown exceptions.

* A small bugfix.

* Stylised code as per Chris' suggestions.

* Stylised code again.

* Improved quality of test code.

* Added step_id in config flow tests.
2020-08-30 15:03:33 -05:00
Andrew Marks 3d1ff5b8d0
Add sharkiq integration for Shark IQ robot vacuums (#38272)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-08-30 15:26:11 +02:00
Maciej Bieniek 4aa8b6cad8
Add basic binary_sensor support to Shelly (#39365) 2020-08-30 14:16:41 +02:00
Chris Talkington 7469f57a7b
Add config flow to nzbget (#38938)
* work on config flow

* Update test_init.py

* work on config flow

* Update test_config_flow.py

* Update test_config_flow.py

* Update __init__.py

* Update test_config_flow.py

* Update __init__.py

* Update test_config_flow.py

* Update test_config_flow.py

* Update test_config_flow.py

* Update test_config_flow.py

* Update test_config_flow.py

* Update test_config_flow.py

* Update __init__.py

* Update __init__.py

* Update __init__.py

* Apply suggestions from code review

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update __init__.py

* Update __init__.py

* Update __init__.py

* Update config_flow.py

* Update __init__.py

* Update __init__.py

* Create coordinator.py

* Update __init__.py

* Update sensor.py

* Update __init__.py

* Update .coveragerc

* Update coordinator.py

* Update __init__.py

* Update coordinator.py

* Update __init__.py

* Update coordinator.py

* Update config_flow.py

* Update __init__.py

* Update coordinator.py

* Update __init__.py

* Update test_config_flow.py

* Update coordinator.py

* Update test_config_flow.py

* Update test_init.py

* Update homeassistant/components/nzbget/coordinator.py

* Update test_config_flow.py

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-08-29 16:47:00 -05:00
Paulus Schoutsen 4b8217777e
Add basic light and sensor support to Shelly (#39288)
* Add basic light platform

* Add sensor support

* Bump aioshelly to 0.2.1

* Lint

* Use UNIT_PERCENTAGE

Co-authored-by: Maciej Bieniek <bieniu@users.noreply.github.com>

* Format sensor.py

Co-authored-by: Maciej Bieniek <bieniu@users.noreply.github.com>
2020-08-28 17:33:34 +02:00
Felipe Martins Diel e4d29bf3ec
Add tests for Broadlink sensors (#39230)
* Add tests for Broadlink sensors

* Remove sensor.py from .coveragerc
2020-08-26 22:43:17 -05:00
Chris Talkington ab6fb5cb77
Ensure unique ids are generated for surepetcare (#39196)
* ensure unique ids are generated for surepetcare

* Create test_binary_sensor.py

* work on tests

* Update test_binary_sensor.py

* Update __init__.py

* Update __init__.py

* Update test_binary_sensor.py

* Update test_binary_sensor.py

* Update test_binary_sensor.py

* Update test_binary_sensor.py

* Update test_binary_sensor.py

* Update test_binary_sensor.py

* Update __init__.py
2020-08-25 11:34:14 -05:00
Paulus Schoutsen ca2bc9906d
Add Shelly integration (#39178) 2020-08-24 12:43:31 +02:00
J. Nick Koston 3cc099af80
Make emulated_hue upnp responder async (#39126) 2020-08-23 09:50:59 +02:00
Martin Hjelmare 3cea3eb6e5
Remove dead ozw discovery code (#39098) 2020-08-21 12:44:40 +02:00
Felipe Martins Diel a2c1f08c8c
Implement config flow in the Broadlink integration (#36914)
* Implement config flow in the Broadlink integration

* General improvements to the Broadlink config flow

* Remove unnecessary else after return

* Fix translations

* Rename device to device_entry

* Add tests for the config flow

* Improve docstrings

* Test we do not accept more than one config entry per device

* Improve helpers

* Allow empty packets

* Allow multiple config files for switches related to the same device

* Rename mock_device to mock_api

* General improvements

* Make new attempts before marking the device as unavailable

* Let the name be the template for the entity_id

* Handle OSError

* Test network unavailable in the configuration flow

* Rename lock attribute

* Update manifest.json

* Import devices from platforms

* Test import flow

* Add deprecation warnings

* General improvements

* Rename deprecate to discontinue

* Test device setup

* Add type attribute to mock api

* Test we handle an update failure at startup

* Remove BroadlinkDevice from tests

* Remove device.py from .coveragerc

* Add tests for the config flow

* Add tests for the device

* Test device registry and update listener

* Test MAC address validation

* Add tests for the device

* Extract domains and types to a helper function

* Do not patch integration details

* Add tests for the device

* Set device classes where appropriate

* Set an appropriate connection class

* Do not set device class for custom switches

* Fix tests and improve code readability

* Use RM4 to test authentication errors

* Handle BroadlinkException in the authentication
2020-08-20 17:30:41 +02:00
Franck Nijhof d3389fa22e
Sentry integration enhancements (#38833)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-08-20 11:37:27 +02:00
sean tearney 9244bf28ef
Add Agent DVR Alarm Control Panel (#36468)
* Add Agent DVR Alarm Control Panel

* code review

* remove return statement
2020-08-13 07:28:06 +02:00
Greg Dowling e9b50706a9
Add roon media player integration (#37553)
* Import roon code.

* Fix flake8/pylint issues.

* Fix lint issues, extend timeout, change contact infomation.

* Add new files to .coveragerc

* Make file executable.

* Fix problem with integration not working after initial creation.

* Improve logic unavailable players by caching data.

* Review changes

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Review changes

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Review changes

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Review changes

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Review changes

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Review changes

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Review changes

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Review changes

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Review changes

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Review changes

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update review suggestions

* Rremove custom play action script.

* Add test requirements.

* Tidy manifest.

* Missed fixes.

* Refactor config_flow to use current pattern.

* Add config_flow tests.

* Refactor to use signal dispatch helpers.

* Remove ToDo: for now.

* Remove remaining zone / source logic for initial release,

* Stop authenticate blocking, handle timeout.

* Removed unneeded code.

* Review comments update.

* Fix comment.

* Apply suggestions from code review

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Apply suggestions from code review

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Fix bug in seek.

* Use sync rather than async update

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Upgrade library, remove exception now caught in library,

* Review comments.

* Review changes

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Check for duplicate host before adding.

* Review comment.

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Remove unused code, revise turn_on/turn_off.

* Sync translations.

* Make interim timeout const.

* Refactor tests.

* Add tests with an existing config entry.

* Apply suggestions from code review

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Remove CannotConnect

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-08-12 09:09:47 -04:00
Tom Harris b1fd931cdc
Add config flow to insteon component (#36467)
* Squashed

* Fix requirements_all

* Update homeassistant/components/insteon/__init__.py

Only update options if the result is to create the entry.

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/insteon/__init__.py

No return value needed.

Co-authored-by: J. Nick Koston <nick@koston.org>

* Ref RESULT_TYPE_CREATE_ENTRY correctly

* Return result back to import config process

* Make DOMAIN ref more clear

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-08-11 18:04:44 -05:00
Eliseo Martelli 9bc68b9a73
Remove prezzibenzina integration (ADR-0004) (#38736) 2020-08-11 10:17:34 +02:00
Maciej Bieniek a7e19c8896
Improve tests for AccuWeather integration (#38621)
* Add more tests

* Add tests for sensor platform

* Add more tests

* More tests

* Simplify parsing of attributes

* Change Quality scale to platinum

* Patch the library in the manual update entity test

* Add unsupported condition icon test

* Do not patch _async_get_data

* Apply suggestions from code review

* Update config_flow.py

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review

* Update tests/components/accuweather/test_weather.py

* Apply suggestions from code review

* Add return_value

Co-authored-by: Chris Talkington <chris@talkingtontech.com>
2020-08-09 09:21:36 -05:00
Markus Bong e3e9ad1342
Add devolo blinds devices (#36597)
* add support for devolo blinds

* correct internal sync function

* correct naming

* fix R1719 in line 73:15

* remove 'break point' print

* simplified _sync check

* change comment

* change log msg
2020-08-06 12:14:39 +02:00
Quentame 21f4d694bb
Remove Linky integration (#38565) 2020-08-06 11:18:05 +02:00
Markus Bong 6c5bcbfc3e
Add devolo light devices (#37366) 2020-08-05 18:16:21 +02:00
Aidan Timson caca762088
OVO Energy Integration (#36104)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2020-08-05 14:38:29 +02:00
J. Nick Koston a91f5b7192
Prevent ping integration from blocking startup (#38504) 2020-08-05 12:43:35 +02:00
cgtobi 31dbdff3c4
Add Netatmo data handler (#35571)
* Fix webhook registration

* Only load camera platform with valid scope

* Add initial data handler and netatmo base class

* Update camera to use data handler

* Update init

* Parallelize API calls

* Remove cruft

* Minor tweaks

* Refactor data handler

* Update climate to use data handler

* Fix pylint error

* Fix climate update not getting fresh data

* Update climate data

* update to pyatmo 4.0.0

* Refactor for pyatmo 4.0.0

* Exclude from coverage until tests are written

* Fix typo

* Reduce parallel calls

* Add heating request attr

* Async get_entities

* Undo parallel updates

* Fix camera issue

* Introduce individual scan interval per device class

* Some cleanup

* Add basic webhook support for climate to improve responsiveness

* Replace ClimateDevice by ClimateEntity

* Add support for turning camera on/off

* Update camera state upon webhook events

* Guard data class registration with lock

* Capture errors

* Add light platform

* Add dis-/connect handling

* Fix set schedule service

* Remove extra calls

* Add service to set person(s) home/away

* Add service descriptions

* Improve service descriptions

* Use LightEntity instead of Light

* Add guard if no data is retrieved

* Make services entity based

* Only raise platform not ready if there is a NOC

* Register webhook even during runtime

* Fix turning off event

* Fix linter error

* Fix linter error

* Exclude light platform from coverage

* Change log level

* Refactor public weather sensor to use data handler

* Prevent too short coordinates

* Ignore modules without _id

* Code cleanup

* Fix test

* Exit early if no home data is retrieved

* Prevent discovery if already active

* Add services to (un-)register webhook

* Fix tests

* Not actually a coroutine

* Move methods to base class

* Address pylint comment

* Address pylint complaints

* Address comments

* Address more comments

* Add docstring

* Use single instance allowed

* Extract method

* Remove cruft

* Write state directly

* Fix test

* Add file to coverage

* Move nested function

* Move nested function

* Update docstring

* Clean up code

* Fix webhook bug

* Clean up listeners

* Use deque

* Clean up prints

* Update homeassistant/components/netatmo/sensor.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/netatmo/sensor.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/netatmo/sensor.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/netatmo/sensor.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/netatmo/sensor.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/netatmo/sensor.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/netatmo/camera.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/netatmo/camera.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/netatmo/camera.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/netatmo/camera.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/netatmo/camera.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/netatmo/camera.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Rename data_class variable

* Break when match

* Extract method

* Extract methods

* Rename variable

* Improve comment

* Some refinements

* Extra

* Extract method

* Simplify code

* Improve reability

* Code simplification

* Simplify code

* Simplify code

* Code cleanup

* Fix import

* Clean up

* Clean up magic strings

* Replace data_class_name with CAMERA_DATA_CLASS_NAME

* Replace data_class_name with CAMERA_DATA_CLASS_NAME

* Replace data_class_name with HOMEDATA_DATA_CLASS_NAME

* Replace data_class_name in public weather sensor

* Clean up

* Remove deprecated config options

* Schedule immediate update on camera reconnect

* Use UUID to clearly identify public weather areas

* Use subscription mode

* Move clean up of temporary data classes

* Delay data class removal

* Fix linter complaints

* Adjust test

* Only setup lights if webhook are registered

* Prevent crash with old config entries

* Don't cache home ids

* Remove stale code

* Fix coordinates if entered mixed up by the user

* Move nested function

* Add test case for swapped coordinates

* Only wait for discovery entries

* Only use what I need

* Bring stuff closer to where it's used

* Auto clean up setup data classes

* Code cleanup

* Remove unneccessary lock

* Update homeassistant/components/netatmo/sensor.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update tests/components/netatmo/test_config_flow.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Clean up dead code

* Fix formating

* Extend coverage

* Extend coverage

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-08-04 20:46:46 +02:00
James Hilliard 064cc52ad6
Add config flow to HLK-SW16 (#37190)
* Add config flow to HLK-SW16

* Use entry_id for unique_id

* Add options update capability

* Refactor entry_id under domain

* Remove name from config

* Set options

* Remove options flow

* remove unneccesary else block from validate_input and move domain cleanup to async_unload_entry

* Add tests and config import

* Add back config schema

* Remove config import

* Refactor unload

* Add back config import

* Update coveragerc

* Don't mock validate_input

* Test duplicate configs

* Add import test

* Use patch for timeout test

* Use mock for testing timeout

* Use MockSW16Client for tests

* Check mock_calls count

* Remove unused NameExists exception

* Remove title from strings.json

* Mock setup for import test

* Set PARALLEL_UPDATES for switch

* Move hass.data.setdefault(DOMAIN, {}) to async_setup_entry
2020-08-02 17:52:53 -10:00
Xiaonan Shen e8b6ed5a27
Add platform tests to yeelight (#37745)
* Add platform tests to yeelight

* Update requirements

* Break long string
2020-08-02 16:37:31 +02:00
Maciej Bieniek a57dca1e11
Add sensor platform for AccuWeather integration (#38312)
* Add sensor platform

* Fix typo
2020-08-02 09:22:51 -05:00
Rob Bierbooms af97141f4f
Increase test coverage for rfxtrx integration (#38435)
* Remove rfxtrx from coveragerc

* Tweak binary sensor test

* Tweak light test
2020-08-01 11:26:26 -05:00
Maciej Bieniek ad0560ef37
Improve tests for Airly integration (#38357)
* Add tests

* More tests

* Add PARALLEL_UPDATES

* Change Quality scale to platinum

* Change PARALLEL_UPDATES value
2020-07-30 08:41:18 -10:00
On Freund b226a7183f
Add config flow to Volumio (#38252) 2020-07-27 09:19:19 +02:00
Aidan Timson dcba45e67d
Add Azure DevOps Integration (#33765)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-07-26 00:04:10 +02:00
Maciej Bieniek 581c4a4edd
Add AccuWeather integration (#37166)
* Initial commit

* Fix strings

* Fix unit system

* Add config_flow tests

* Simplify tests

* More tests

* Update comment

* Fix pylint error

* Run gen_requirements_all

* Fix pyline error

* Round precipitation and precipitation probability

* Bump backend library

* Bump backend library

* Add undo update listener on unload

* Add translation key for invalid_api_key

* Remove entity_registry_enabled_default property

* Suggested change

* Bump library
2020-07-24 15:59:15 -05:00
RogerSelwyn 393dd4fe7f
Change sky_hub to async and fix exception spamming (#37129)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-07-22 19:58:07 +02:00
Adam Król bedb0753f3
Add Wolflink integration (#34104)
* WOLF Smart-set integration

* Removed translations. Changed device class of timestamp. Added new test for unknown exception

* Remove unit_of_measurement from hours sensor

* Code cleanup. Pull Request comments fixes

* ConnectError import change. Removed DEVICE_CLASS_TIMESTAMP

* Add unique id guard with tests. Use common translations. Move device_id resolution to config_flow.

* Remove debug print
2020-07-20 11:52:52 +02:00
lawtancool 432cbd3148
Add Control4 integration (#37632)
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-07-19 13:48:08 -07:00
Perry Naseck 93919dea88
Add Firmata Integration (attempt 2) (#35591) 2020-07-16 17:58:45 -07:00
Haemish Kyd 8a2b34cc09
Updates to poolsense integration (#37613)
* Created a binary sensor and corrected some review comments.

* Updated the poolsense class and its interface to handle credentials better

* Moved the client session to the PoolSense class.

* Apply suggestions from code review

* Update binary_sensor.py

* Update homeassistant/components/poolsense/__init__.py

* Update sensor.py

* Update binary_sensor.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>
2020-07-10 21:53:34 -05:00
cgtobi 155a5f7c26
Add back Netatmo public weather sensors (#34401)
* Add public weather sensors back in

* Remove stale code

* Cleanup after before adding entities

* Fix pylint complaint

* Add test for options flow

* Change mode to listbox

* Update .coveragerc

* Address comments

* Don't process empty list

* Address comment

* Fix mistake

* Make signal unique

* Make string more unique

* Fix merge conflict
2020-07-09 06:39:33 +02:00
jduquennoy af6a4bb6cf
Refactor Enocean part 1 (#35927)
* First step of an EnOcean integration refactoring, including code reorganisation and support of a setup config flow

* Moved title to root of strings file

* Fixed pre-commit checks failures

* Fixed linter errors

* Updated formatted string format in logs

* Removed leftover comment

* Multiple changes after PR change requests.
Using an import flow for yaml config, removed unnecessary logs, added proper unload in __init__ and EnOceanDongle
Replaced config state machine by several flows.
Serial port validity check done in the EnOceanDongle class asynchronously, removed unique ID from config flow
Multiple cosmetic changes

* Multiple changes after PR change requests

* Added variable to store default value, as setdefault was caught returning None when the empty dict literal was passed as an argument

* Literal used directly

* Added tests for EnOcean config flows, changed static methods to bundle methods for bundle

* Updated variable name

* Added missing mock to test, replaced repeated magic strings by constants

* Changed imports to avoid an unused import warning from pylint on DOMAIN

* Adding pylint exception for unused import

* Added proper propagation of setup and unload to platforms, removed dead code, some syntax changes

* Removed setup_entry forwarding as the entities can only be configured using yaml

* Removed forwarding of unload

* Enabled code coverage for config flow only

* Clean up coveragerc

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-07-08 20:46:38 -04:00
Aaron Bach 0067b6a84d
Transition Guardian to use a DataUpdateCoordinator (#37380)
* Migrate Guardian to use the DataUpdateCoordinator

* Finish work

* Cleanup

* Don't use UpdateFailed error

* Code cleanup

* Code cleanup

* Remove unnecessary change

* Code review

* Code review

* Use a subclass of DataUpdateCoordinator

* Make sure to pop client upon unload

* Adjust coverage
2020-07-05 16:09:40 -06:00
Baptiste Candellier 3062312649
Add config flow + async support for SmartHab integration (#34387)
* Setup barebones SmartHab config flow

* Setup authentication flow

* Make setup async, add config flow receivers

* Add French translation

* Fix async issues

* Address review comments (thanks bdraco!)

* Fix unloading entries

* Migrate translations dir according to warning

* Create list of components

* Fix pylint false positive

* Fix bad copy-pastes 🤭

* Add async support to SmartHab component

* Address review comments (bdraco)

* Fix pylint

* Improve exception handling (bdraco)

* Apply suggestions from code review (bdraco)

Co-authored-by: J. Nick Koston <nick@koston.org>

* Don't log exceptions manually, fix error

* Reduce repeated lines in async_step_user (bdraco)

* Remove useless else (pylint)

* Remove broad exception handler

* Create strings.json + remove fr i18n

* Write tests for smarthab config flow

* Test import flow

* Fix import test

* Update homeassistant/components/smarthab/config_flow.py

Co-authored-by: J. Nick Koston <nick@koston.org>

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-07-05 14:20:51 -05:00
Eugene Prystupa 80aebcc7d2
Add more unit tests for plum_lightpad (#37275)
* add more unit tests for plum_lightpad

* add more unit tests for plum_lightpad

* add more unit tests for plum_lightpad

* add more unit tests for plum_lightpad

* Update tests/components/plum_lightpad/test_init.py

apply suggested way to invoke async_setup_entry

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update tests/components/plum_lightpad/test_init.py

apply suggested way to invoke async_setup_entry

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update tests/components/plum_lightpad/test_init.py

apply suggested way to invoke async_setup_entry

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update tests/components/plum_lightpad/test_init.py

remove now unused import

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update tests/components/plum_lightpad/test_init.py

import Mock from tests.async_mock as suggested

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update tests/components/plum_lightpad/test_init.py

remove now unused import

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update tests/components/plum_lightpad/test_init.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* fix unit tests that were failing after suggested changes

Co-authored-by: Chris Talkington <chris@talkingtontech.com>
2020-07-03 16:40:17 -05:00
Haemish Kyd 10786bbe7f
Create PoolSense integration (#35561)
* Created integration for PoolSense - a device to maintain your pool

* Updated poolsense integration with changes due to code review comments.

* Update poolsense with lint fix (logging-not-lazy)

* Update poolsense with lint fix (f string missing placeholders)

* Update homeassistant/components/poolsense/config_flow.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/sensor.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/sensor.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/sensor.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/sensor.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/sensor.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/sensor.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/sensor.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/sensor.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/sensor.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/strings.json

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/strings.json

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/strings.json

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/strings.json

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Added test for poolsense component. Updated config_flow to better follow the guidelines.

* Update tests/components/poolsense/test_config_flow.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update tests/components/poolsense/test_config_flow.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update tests/components/poolsense/test_config_flow.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update tests/components/poolsense/test_config_flow.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update tests/components/poolsense/test_config_flow.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update tests/components/poolsense/test_config_flow.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update tests/components/poolsense/test_config_flow.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update tests/components/poolsense/test_config_flow.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Removed uneccessary functions.

* Added local venv to gitignore

* Update homeassistant/components/poolsense/strings.json

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/strings.json

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/strings.json

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/strings.json

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/strings.json

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/strings.json

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update to strings to allow for translations. Also some coding convention updates.

* Removed space in icon return

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Removed space in icon return

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Removed space in icon return

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/__init__.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/__init__.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/__init__.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Update homeassistant/components/poolsense/strings.json

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Updated to include some error checks for pypi package

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review

* Update tests/components/poolsense/test_config_flow.py

* Update homeassistant/components/poolsense/sensor.py

* Apply suggestions from code review

* Update homeassistant/components/poolsense/__init__.py

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review

* Update homeassistant/components/poolsense/sensor.py

* Apply suggestions from code review

* Update homeassistant/components/poolsense/__init__.py

* Update homeassistant/components/poolsense/sensor.py

Co-authored-by: Chris Talkington <chris@talkingtontech.com>
2020-07-01 00:44:10 -05:00
Eugene Prystupa 7ef33a7219
Add first unit test to config flow for Plum Lightpad (#37183)
* add first unit test to config flow for Plum Lightpad

* add first unit test to config flow for Plum Lightpad (add changed requirements_test_all.txt)

* add first unit test to config flow for Plum Lightpad

* add first unit test to config flow for Plum Lightpad (bring coverage to 100%)

* add first unit test to config flow for Plum Lightpad

* add first unit test to config flow for Plum Lightpad (updated patch path as suggested)

* add first unit test to config flow for Plum Lightpad (add unit test for abort)
2020-06-29 18:07:43 +02:00
mdegat01 b96ce9c210
Additional testing for InfluxDB and some quality improvements (#37181)
* refactoring and added tests to sensor

* using caplog and not mocking main setup method in sensor tests
2020-06-29 17:31:49 +02:00
Markus Bong 35dc5ba742
Add devolo sensor devices (#37049) 2020-06-24 10:06:11 -07:00
bsmappee fbd5ccf156
Add smappee binary_sensor platform (#37023) 2020-06-24 14:37:48 +02:00
mdegat01 6c7355785a
Add support for glob matching to entity filters (#36913)
* Added GLOB capability to entityfilter and every place that uses it. All existing tests are passing

* added tests for components affected by glob change

* fixed flake8 error

* mocking the correct listener

* mocking correct bus method in azure test

* tests passing in 3.7 and 3.8

* fixed formatting issue from rebase/conflict

* Checking against glob patterns in more performant way

* perf improvments and reverted unnecessarily adjusted tests

* added new benchmark test around filters

* no longer using get with default in entityfilter

* changed filter name and removed logbook from filter benchmark

* simplified benchmark tests from feedback

* fixed apache tests and returned include exclude schemas to normal

* fixed azure event hub tests to properly go through component logic

* fixed azure test and clean up for other tests

* renaming test files to match standard

* merged mqtt statestream test changes with base

* removed dependency on recorder filter schema from history

* fixed recorder tests after merge and a bunch of lint errors
2020-06-23 20:02:29 -05:00
Thomas Le Gentil 2af961513d
Remove fortigate integration (#34586) 2020-06-24 00:21:51 +02:00
Franck Nijhof 8b21b415c4
Fix/Rewrite of Toon integration (#36952)
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-06-22 18:22:41 -07:00
Franck Nijhof 6660cf701d
Remove lockitron integration (#37012) 2020-06-22 16:34:26 -06:00
rajlaud 3f427602ba
Squeezebox config flow (#35669)
* Squeezebox add config flow and player discovery

* Fixes to config flow

* Unavailable player detection and recovery

* Improved error message for auth failure

* Testing for squeezebox config flow

* Import configuration.yaml

* Support for discovery integration

* Internal server discovery

* Fix bug restoring previously detected squeezebox player

* Tests for user and edit steps in config flow

* Tests for import config flow

* Additional config flow tests and fixes

* Linter fixes

* Check that players are found before iterating them

* Remove noisy logger message

* Update requirements_all after rebase

* Use asyncio.Event in discovery task

* Use common keys in strings.json

* Bump pysqueezebox to v0.2.2 for fixed server discovery using python3.7

* Bump pysqueezebox version to v0.2.3

* Don't trap AbortFlow exception

Co-authored-by: J. Nick Koston <nick@koston.org>

* Refactor validate_input

* Update squeezebox tests

* Build data flow schema using function

* Fix linter error

* Updated en.json

* Update homeassistant/components/squeezebox/media_player.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/squeezebox/media_player.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/squeezebox/media_player.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/squeezebox/media_player.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update .coveragerc for squeezebox config flow test

* Mock TIMEOUT for faster testing

* More schema de-duplication and testing improvements

* Apply suggestions from code review

Co-authored-by: J. Nick Koston <nick@koston.org>

* Testing and config flow improvements

* Remove unused exceptions

* Remove deprecated logger message

* Update homeassistant/components/squeezebox/media_player.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Implement suggestions from code review

* Add async_unload_entry

* Use MockConfigEntry in squeezebox tests

* Remove unnecessary config schema

* Stop server discovery task when last config entry unloaded

* Improvements to async_unload_entry

* Fix bug in _discovery arguments

* Do not await server discovery in async_setup_entry

* Do not await start server discovery in async_setup

* Do not start server discovery from async_setup_entry until homeassistant running

* Re-detect players when server removed and re-added without restart

* Use entry.entry_id instead of unique_id

* Update unittests to avoid patching homeassistant code

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-06-22 09:29:01 -05:00
starkillerOG 1f9721bad3
Add Xiaomi Aqara Config Flow (#35595)
* Xiaomi Aqara Config Flow

* Xiaomi Aqara Config Flow

* Xiaomi Aqara Config Flow

* Xiaomi Aqara Config Flow

* Xiaomi Aqara Config Flow

First tested and working version

* Remove depricated discovery

* Add Xiaomi Aqara Config Flow

* Add Xiaomi Aqara tests

* Update .coveragerc

* Update requirements_test_all.txt

* fix spelling mistake

* fix select scheme

* fix wrong conflict resolve

* add IP to zeroconf discovery title

* black styling

* add getmac requirement

Co-authored-by: Maciej Bieniek <bieniu@users.noreply.github.com>

* add getmac

* add getmac

* Clean up

* Update homeassistant/components/xiaomi_aqara/__init__.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/xiaomi_aqara/__init__.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/xiaomi_aqara/__init__.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/xiaomi_aqara/__init__.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/xiaomi_aqara/__init__.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* resolve data storage

* move format_mac down

* Remove discovery_retry from config flow

* remove unused strings

* fix styling

* fix black styling

* fix tests

* remove mac connection

This is needed to prevent a conflict with the Xiaomi Miio integration that I discovered during testing.

* fix flake8

* remove getmac depandance

* check for inavlid_interface + test

* Validate gateway key

* add invalid key tests

* Fix spelling

* Only set up sensors if no key

Co-authored-by: Maciej Bieniek <bieniu@users.noreply.github.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-06-22 11:54:17 +02:00
bsmappee 5228282f69
Renew Smappee (sensors and switches) (#36445)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-06-17 13:28:28 +02:00
starkillerOG 6db5ff98ed
DenonAVR Config Flow (#35255)
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-06-16 14:46:39 +02:00
Philip Allgaier 25607c7129
Use MDI CPU icon for glances (#36736)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-06-16 14:44:37 +02:00
Kevin Fronczak a68af0a3a9
Add blink tests (#36672)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-06-16 11:05:33 +02:00
Tom Schneider 0331ebdd47
Add HVV integration (Hamburg public transportation) (#31564)
Co-authored-by: springstan <46536646+springstan@users.noreply.github.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-06-15 00:15:20 +02:00
Markus Bong 3495932eb0
Add devolo binary_sensor devices (#36370)
* initial commit

* small corrections

* fix linting error

* add new files to coveragerc

* rename devolo_sensor to devolo_device

* use correct import

* use binary_switch platform

* use binary_switch platform

* add binary_sensor to coverage

* adjustments according PR review

* make super call easier to read

* use f-string instead of concatenating

* update docstrings - remove device_id property

* add will_remove_from_hass
2020-06-06 10:10:05 -05:00
Tim van Cann d73a4e1ed5
Add Avri config flow (#34288)
* Add config flow to Avri integration

* Add config flow validation

* Update .coveragerc

* Start adding config flow tests

* Fix failing test

* Fix pylint

* Update homeassistant/components/avri/config_flow.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/avri/config_flow.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Fix import order

* Code review comments

* Update homeassistant/components/avri/sensor.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Remove device information

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-06-06 09:37:31 -05:00
Alexey Kustov 3076fc5f25
Add notify_events notify integration (#36049)
* Add new notify_events notification component

* Fix manifest

* Formatting fix

* Black formatting + CODEOWNERS

* Fix requirements_all.txt

* Flake8 warning fix

* Isort fixes

* Update notify-events library requirement version

* Replace Exception to more suitable and update lib version

* Reformat integration according to "0007-integration-config-yaml-structure.md"

* Update homeassistant/components/notify_events/manifest.json

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Fix manifest + remove async

* Black formatting

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-06-05 21:26:56 +02:00
Aaron Bach 7a3c2e1f6c
Add config flow for Tile (#36173)
* Overhaul Tile

* Adjust coverage

* Fix tests

* Code review

* Code review

* Remove unused config flow step

* Revert "Remove unused config flow step"

This reverts commit cb206e0446.

* Fix tests
2020-06-04 10:07:27 -06:00
Maciej Bieniek 465b98513b
Add config flow to Dune HD (#36345)
* Add config_flow to the dunehd integration

* Add tests

* Run gen_requirements_all

* Fix pylint error

* Better hostname validation

* Build device info in the class
2020-06-03 07:01:56 -05:00
Tom 61c08e792d
Update plugwise to async and config_flow switch part (#36383)
* Add switch component

* Update homeassistant/components/plugwise/switch.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/plugwise/switch.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Improvements by @bdraco

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-06-02 14:45:14 -05:00
Franck Nijhof 08566f84cd
Remove wunderlist, platform is decommissioned (#36380) 2020-06-02 19:37:52 +02:00
Tom c68e0a1d46
Update plugwise to async and config_flow binary_sensor part (#36378)
* Add binary_sensor component

* Version bump

* Blushing commit - tnx @bdraco
2020-06-02 11:30:00 -05:00
Quentame 26cbca101a
Refactor Synology entries to allow not fetching the API when it's disabled + add security binary sensor (#35565)
- add Synology DSM Security binary sensor (enabled by default)
- use device name instead of id in names
- add device type to name
- show disk manufacturer, model and firmware version in devices
- some entries are disabled by default (`entity_registry_enabled_default`)
- binary sensor + sensor uses `device_class` when possible
- do not fetch a concerned API if all entries of it are disabled
- entity unique_id now uses key instead of label
- entity entity_id changes for disk and volume: example from `sensor.synology_status_sda` to `sensor.synology_drive_1_status`, or from `sensor.synology_average_disk_temp_volume_1` to `sensor.synology_volume_1_average_disk_temp`
- now binary sensor:
  - disk_exceed_bad_sector_thr
  - disk_below_remain_life_thr
- removed sensor:
  - volume type (RAID, SHR ...)
  - disk name (Drive [X])
  - disk device (/dev/sd[Y])
2020-06-02 18:22:51 +02:00
Franck Nijhof e5d81aeb2a
Remove gearbest integration (ADR-0004) (#36347) 2020-06-01 17:43:20 +02:00
Tom d0fedad000
Update plugwise to async and config_flow sensor part (#36219)
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-06-01 14:01:17 +02:00
Barry Williams b6407f77da
Add service to openhome to invoke a pin (#31119)
Setup platform async
Use entity services
Store UUID in default data rather than entity
2020-05-30 14:40:35 +02:00
Chris Talkington 940249f45e
Refactor Sonarr Integration (#33859)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-05-29 17:08:05 -07:00
Tom 7e693afcf3
Update plugwise to async and config_flow (#33691)
* Update plugwise async, config_flow and multi entity

* Update battery percentage

* Fix yamllint on services

* Fix yamllint on services

* Fix formatting for pyupgrade

* Update homeassistant/components/plugwise/__init__.py

Co-Authored-By: Robert Svensson <Kane610@users.noreply.github.com>

* Add try/except on setup

* Bump module version, battery version and valve position

* Removing sensor, switch, water_heater for later (child) PRs

* Catchup and version bump

* Remove title from strings.json

* Readd already reviewd await try/except

* Readd already reviewed config_flow

* Fix pylint

* Fix per 0.109 translations

* Remove unused import from merge

* Update plugwise async, config_flow and multi entity

* Update battery percentage

* Fix yamllint on services

* Fix yamllint on services

* Bump module version

* Bump module version, battery version and valve position

* Removing sensor, switch, water_heater for later (child) PRs

* Catchup and version bump

* Remove title from strings.json

* Fix pylint

* Fix per 0.109 translations

* Translations and config_flow, module version bump with required changes

* Translations and config_flow, module version bump with required changes

* Fix requirements

* Fix requirements

* Fix pylint

* Fix pylint

* Update homeassistant/components/plugwise/__init__.py

Improvement

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/plugwise/__init__.py

Improvement

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/plugwise/__init__.py

Improvement

Co-authored-by: J. Nick Koston <nick@koston.org>

* Include configentrynotready on import

* Update __init__.py

* DataUpdateCoordinator and comment non-PR-platforms

* Fix reqs

* Rename devices variable in favor of entities

* Rework updates with DataUpdateCoordinator

* Peer review

* Peer review second part

* Cleanup comments and redundant code

* Added required config_flow test

* Peer review third part

* Update service was replaced by DataUpdateCoordinator

* Corrected testing, version bump for InvalidAuth, move uniq_id

* Remove according to review

* Await connect (py38)

* Remove unneccesary code

* Show only when multiple

* Improve config_flow, rename consts

* Update homeassistant/components/plugwise/climate.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/plugwise/climate.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Process review comments

Co-authored-by: Robert Svensson <Kane610@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-05-28 10:52:25 -05:00
Aaron Bach 369745c4cf
Add support for Elexa Guardian water valve controllers (#34627)
* Add support for Elexa Guardian water valve controllers

* Zeroconf + cleanup

* Sensors and services

* API registration

* Service bug fixes

* Fix bug in cleanup

* Tests and coverage

* Fix incorrect service description

* Bump aioguardian

* Bump aioguardian to 0.2.2

* Bump aioguardian to 0.2.3

* Proper entity inheritance

* Give device a proper name

* Code review
2020-05-26 08:47:25 -05:00
MatsNl 67a9622209
Add tests to Atag integration (#35944)
* add tests

* better error handling in dependency

* dont suppress errors

* add support for multiple devices

* add test for Unauthorized status

* raise error on service call failure
2020-05-26 08:38:02 +02:00
Aaron Bach 05cbb3f0e4
Remove WWLLN integration (#35926) 2020-05-25 22:34:51 +02:00
braam 1f3d3c3e5b
Add Unify Circuit (#35756) 2020-05-25 15:51:41 +02:00
Martin Hjelmare cc369cd461
Fix lutron_caseta setup options (#35974) 2020-05-22 23:01:48 +02:00
Jason Hunter 8cd905487e
Bump pyAV and close unclosed outputs (#35960)
* bump pyAV and close unclosed outputs

* skip stream from coverage for now

* fix divide by zero error
2020-05-22 18:13:37 +02:00
Alan Murray 65e509ed8f
Add Acmeda integration (#33384)
* First cut of Rollease Acmeda Pulse Hub integration.

* Acmeda integration improvements:
 - Moved common code into a base entity
 - Battery level sensor added
 - Localisation now working

* Added requirement for aiopulse now that it has been uploaded to PyPI.

* Exclude acmeda integration from coverage check as it relies on a hub being present.

* Fix Travis CI build issues.

* Remove unused constants.

* Remove unused group logic from cover.py

* Removed commented code from base.py

* Remove sensors (battery entities) on removal of hub.

* Remove unused groups from sensor.py

* Acmeda device and entity update made fully asynchronous using subscriptions to remove need for config polling.

* Updated aiopulse version dependency.
Removed non-functional battery charging indication.

* Rationalised common code to update entities into helpers.py

* Fix linting issue.

* Correct additional CI pylint errors.

* Index config_entries by entry_id.
Move entity loading and unloading to __init__.py
Add entry_id to dispatcher signal
Removed now unused polling code hub
Added config_flow unit tests

* Tweak to integration config_entry title.

* Bumped aiopulse module to 0.3.2.
Reduced verbosity of aiopulse module.

* Changed to using direct write of device state.
Removed old style async_step_init config_flow step.

* Remove superfluous battery_level and device_state_attributes from battery entity.

* Removal of unused strings.
Removal of unused create_config_flow helper.
Removal of stale comment.

* Remove use of shared container to track existing enities.
Moved removal and deregistration of entities to base class through use of dispatch helper.

* Fixed strings.json

* Fix incorrect use of remove instead of pop on dict.

* Add support for tilting covers, bump aiopulse version number.

* Bump aiopulse version to v0.3.4.
Fixed bug in cover supported_features.

* Bumped aiopulse version to 0.4.0
Update acmeda .coveragerc exclusions

* Removed already configured hub check from __init__.py async_setup_entry
Removed passing in hass reference to base entity class
Renamed entity async_reset to async_will_remove_from_hass
Changed device_info and properties
Migrated to CoveEntity from CoverDevice
Added dispatched_connect cleanup on hub removal
Removed unused entries from manifest
Removed override of battery icon
Renamed translations folder

* Reversed unintended change to .coveragerc

* Fixed config flow for multi-hub discovery.

* Acmeda enhancements as requested by MartinHjelmare

* Force import to connect to hub to retrieve id prior to creating entry

* Remove YAML configuration support.

* Tidied up config_flow and tests:
 - removed unnecessary steps
 - fixed typos

* Removed storage of hub in config_flow.
2020-05-17 12:15:06 +02:00
Robert Van Gorkom 11b786a4fc
Add config flow to gogogate2 component (#34709)
* Add config flow to gogogate2 component.

* Using a more stable gogogate api.

* Getting config flows working better by using different downstream library.

* Fixing options not getting default values.
Adding availability to cover entity.

* Simplifying return types of function.

* Address PR feedback.

* Making user config flow not abort.

* Using DataUpdateCoordinator.

* Addressing PR feedback.

* Using standard method for using hass.data

* Split auth fail test into separate tests.
2020-05-16 10:53:11 -05:00
Franck Nijhof 0be20ec6ab
Rename zwave_mqtt to ozw (#35631) 2020-05-14 22:56:04 +02:00
Franck Nijhof c67d035366
Rename zigbee to xbee (#35613) 2020-05-14 12:19:59 +02:00
Aaron Bach c9b702c4c2
Remove Automatic integration (#35029) 2020-05-14 11:24:22 +02:00
J. Nick Koston 6d8b8ecfa9
Add ssdp discovery for isy994 (#35568)
* Add ssdp discovery for isy994

* Increase test coverage for existing config flow

* Update tests/components/isy994/test_config_flow.py

Co-authored-by: shbatm <support@shbatm.com>

* Update tests/components/isy994/test_config_flow.py

Co-authored-by: shbatm <support@shbatm.com>

* move constants

* Update tests/components/isy994/test_config_flow.py

Co-authored-by: shbatm <support@shbatm.com>

* undo CONF_TLS_VER from homeassistant.const

Co-authored-by: shbatm <support@shbatm.com>
2020-05-13 11:15:17 -05:00
Steffen Zimmermann ee96ff2846
Add wiffi integration (#30784)
* Add integration for wiffi devices

wiffi devices are DIY board manufactured by stall.biz.
Several devices are available, e.g. a weather station (weatherman), an
indoor environmental sensor (wiffi-wz) and some more.
This intgration has been developed using a weatherman device, but should
also work for other devices from stall.biz.

* Fix pylint warning

* Use WIFFI / STALL WIFFI instead of wiffi to be consistent with stall.biz

* Don't update disabled entities.

* fix complains

- move wiffi specific code to pypi
- remove yaml configuration code

* incorporate various suggestions from code review

* fix remaining comments from Martin

* fix comments

* add tests for config flow

* fix comments

* add missing requirements for tests

* fix pylint warnings

* fix comments

* fix comments

remove debug log
rename .translations to translations

* rebase and adapt to latest dev branch

* Update homeassistant/components/wiffi/config_flow.py

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

* Update homeassistant/components/wiffi/config_flow.py

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

* fix missing import

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-05-13 10:40:58 +02:00
Felipe Martins Diel 6464c94990
Fix connection problems in the Broadlink integration (#34670)
* Use helper functions for exception handling

* Create a separate class to handle communication with the device

* Update manifest

* Use coroutine for service setup

* Fix sensor update

* Update tests

* Fix MP1 switch

* Add device.py to .coveragerc

* Remove unnecessary blocking from test_learn_timeout

* Change access method for entries with default values

* Make the changes suggested by MartinHjelmare

* Remove dot from debug message

* Use underscore for unused variable
2020-05-13 10:36:32 +02:00
Emily Mills 306f15723d
Add Zerproc integration (#35477) 2020-05-13 00:26:44 +02:00
Jason Hunter 132bb4e890
ONVIF Event Implementation (#35406)
Initial implementation of ONVIF event sensors
2020-05-11 13:12:12 -04:00
Daniel Høyer Iversen f302c6fd65
Add Mill config flow (#35136)
* Mill config, wip

* add tests

* fix merge

* update tests

* unique id

* Mill strings

* mill config flow

* mill config flow

* test import

* test import

* req

* ccoverage

* Apply suggestions from code review

Co-authored-by: J. Nick Koston <nick@koston.org>

* style

* Apply suggestions from code review

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>

* update strings

* add test

Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-05-10 08:44:05 -05:00
Xiaonan Shen 8994931ec4
Songpal code and test improvement (#35318)
* Use tests.async_mock instead of asynctest

* Remove unnecessary existence check

* Improve songpal service registering

* Add tests

* Seperate device api from entity api

* Improve disconnect log messages

* Improve tests

* Rename SongpalDevice to SongpalEntity

* Improve reconnecting

* Remove logging and sleep patch from tests

* Test unavailable state when disconnected

* Rename SongpalEntity.dev to _dev

* Add quality scale to manifest
2020-05-09 22:30:34 -04:00
Willem-Jan cf30895460
Add BSBLan Climate integration (#32375)
* Initial commit for BSBLan Climate component

The most basic climate functions work.

* Delete manifest 2.json

wrongly added to commit

* fix incorrect name

current_hvac_mode

* update coverage to exclude bsblan

* sorted and add configflow

* removed unused code, etc

* fix hvac, preset  mix up

now it sets hvac mode to none and preset to eco

* fix naming

* removed commented code and cleaned code that isn't needed

* Add test for the configflow

* Update requirements

fixing some issues in bsblan Lib

* Update coverage file to include configflow bsblan

* Fix hvac preset is not in hvac mode

rewrote how to handle presets.

* Add passkey option

My device had a passkey so I needed to push this functionality to do testing

* Update constants

include passkey and added some more for device indentification

* add passkey for configflow

* Fix use discovery_info instead of user_input

also added passkey

* Fix name

* Fix for discovery_info[CONF_PORT] is None

* Fix get value CONF_PORT

* Fix move translation to new location

* Fix get the right info

* Fix remove zeroconf and fix the code

* Add init for mockConfigEntry

* Fix removed zeroconfig and fix code

* Fix changed ClimateDevice to ClimatEntity

* Fix log error message

* Removed debug code

* Change name of device.

* Remove check

This is done in the configflow

* Remove period from logging message

* Update homeassistant/components/bsblan/strings.json

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Add passkey

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-05-09 22:16:21 -04:00
Brynley McDonald e2b622fb78
Add Flick Electric NZ integration (#30696)
* Add integration for Flick Electric NZ

* Start adding Config Flow and external API

* Second Wave of Config Flow and API implementation

* Fix test (errors is None instead of blank array?)

* Don't update sensor if price is still valid

* Add input validation

* Fix linting for DOMAIN

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

* Remove platform schema (config is by entries only)

* Don't catch AbortFlow exception

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

* Update test

* Re-arrange try-catch in config flow

* Fix linting in sensor.py

* Staticly define list of components

* Fix test exceptions

* Fix _validate_input not being awaited

* Fix tests

* Fix pylint logger

* Rename test and remove print debug

* Add test for duplicate entry

* Don't format string in log function

* Add tests __init__ file

* Remove duplicate result assignment

* Add test for generic exception handling

* Move translations folder

* Simplify testing

* Fix strings/translation

* Move to "flick_electric" as domain

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-05-09 22:13:06 -04:00
Chris Talkington 06ddda8c95
Improve roku remote (#35419)
* Update remote.py

* Create test_remote.py

* Update .coveragerc
2020-05-09 16:04:37 -05:00
Glenn Waters 9353169203
Universal Powerline Bus Scene support (#35401)
* Universal Powerline Bus Scene support.

* Omint UPB scene.py

* Fix lint errors, rename .translations, Light->LightEntity.

* Add rounding to brightness to percent calcs.
2020-05-08 21:42:23 -05:00
Glenn Waters efb52961f0
Add Universal Powerline Bus (#34692)
* Initial version.

* Tests.

* Refactored tests.

* Update requirements_all

* Increase test coverage. Catch exception.

* Update .coveragerc

* Fix lint msg.

* Tweak test (more to force CI build).

* Update based on PR comments.

* Change unique_id to use stable string.

* Add Universal Powerline Bus "link" support.

* Fix missed call.

* Revert botched merge.

* Update homeassistant/components/upb/light.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Three changes.

Update service schema to require one of brightness/brightness_pct.
Fix bug in setting brightness to zero.
Replace async_update_status and replace with async_update.

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-05-08 15:00:47 -05:00
Markus Bong 62f2520ee1
Fix devolo switch on and off (#35357)
* use correct API set methods

* add devolo_home_control to coveragerc except config_flow.py
2020-05-08 21:41:56 +02:00
sean tearney 1be41b9de8
Add agent_dvr integration (#32711)
* initial

* add missing fixture

* fix mocks

* fix mocks 2

* update coverage

* fix broken sync between agent and integration

* Update homeassistant/components/agent_dvr/camera.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/agent_dvr/camera.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/agent_dvr/camera.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/agent_dvr/camera.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* updates for review

* add back in should poll again

* revert motion detection enabled flag in state attributes

* Update homeassistant/components/agent_dvr/camera.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/agent_dvr/camera.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/agent_dvr/camera.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/agent_dvr/camera.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/agent_dvr/__init__.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/agent_dvr/camera.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/agent_dvr/camera.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/agent_dvr/camera.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* add is_streaming

* fix is_streaming bug, remove mp4 stream

* cleanup

Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-05-08 09:49:47 -05:00
Jesse Hills e696c08db0
Rewrite JuiceNet for async and config flow (#34365)
* Add config flow to JuiceNet

* Fix some lint issues

* Fix imports

* Abort on reconfigure / Allow multiple accounts
Abort on bad API token
Fix strings

* Remove unused variable

* Update strings

* Remove import

* Fix import order again

* Update imports
Remove some unused parameters

* Add back ignore

* Update config_flow.py

* iSort

* Update juicenet integration to be async

* Update coverage for juicenet config flow

* Update homeassistant/components/juicenet/entity.py

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

* Black

* Make imports relative

* Rename translations folder

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-05-08 00:52:20 -05:00
J. Nick Koston 502afbe9c2
Delete flapping automatic tests (#35356) 2020-05-07 21:25:17 -07:00
Xiaonan Shen 33077f0cdd
Add config flow support to songpal integration (#34714)
* Add config flow to songpal

* Add config flow to songpal

* Add songpal to migrated service in discovery

* Improve songpal/set_sound_setting service

* Remove songpal config flow from .coveragerc omit

* Bump python-songpal to 0.12 and fix exception handling

* Revert "Improve songpal/set_sound_setting service"

This reverts commit 9be076ab52e21f268322572c36709a17d41db771.

* Code style fix

* Add connections to device_info

* Fix pylint

* Ignore braava tv

* Fix test warning

* Add @shenxn as codeowner

* Remove model from configuration data

* Get name from device in user step

* Add unload entry support

* Delete translations as it will get generated as part of CI

* Code cleanup

* Fix typo

* Remove _show_setup_form

* Change configuration from media_player to songpal

Co-authored-by: Raman Gupta <7243222+raman325@users.noreply.github.com>
2020-05-07 00:52:33 +02:00
Jason Hunter 19734e7b2c
Refactor ONVIF (#35222) 2020-05-06 09:29:59 -07:00
Alexei Chetroi c71a7b901f
New configuration flow for ZHA integration (#35161)
* Start gateway using new zigpy init.

Update config entry data  import.
Use new zigpy startup.
Fix config entry import without zha config section.
Auto form Zigbee network.

* Migrate config entry.

* New ZHA config entry flow.

Use lightweight probe() method for ZHA config entry validation when
available. Failback to old behavior of setting up Zigpy app if radio lib
does not provide probing.

* Clean ZHA_GW_RADIO

* Don't import ZHA device settings.

* Update config flow tests.

* Filter out empty manufacturer.

* Replace port path with an by-id device name.

* Rebase cleanup

* Use correct mock.

* Make lint happy again

* Update tests/components/zha/test_config_flow.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update tests/components/zha/test_config_flow.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update tests/components/zha/test_config_flow.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Use executor pool for IO

* Address comments.

Use AsyncMock from tests.

* Use core interface to test config flow.

* Use core interface to test config_flow.

* Address comments. Use core interface.

* Update ZHA dependencies.

* Schema guard

* Use async_update_entry for migration.

* Don't allow schema extra keys.

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-05-06 12:23:53 +02:00
David Straub 86d410d863
Add Home Connect integration (#29214) 2020-05-05 11:26:14 +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 a2efc079f1
Add battery sensors to hunterdouglas_powerview (#34917) 2020-04-30 18:25:59 -07:00
João Gabriel 4e55fa6c5c
Refactor Remote class in panasonic_viera (#34911) 2020-05-01 02:35:02 +02:00
alxrdn 55bf5514ad
Add overlay options wrapper to rpi_camera (#34461)
* add overlay options wrapper to rpi_camera

* Refactor to set config yaml section under the top level integration domain key

* Remove return values that are not checked

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

* Remove superfluous debug log messages

* Return if not set up via discovery

* Add convenience reference to hass.data[DOMAIN]

* Black formatting

* Isort

* Exclude all rpi_camera modules

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-04-30 15:30:37 +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
starkillerOG e46f1b69ba
Add Xiaomi miio Alarm Control Panel (#32091)
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
2020-04-29 01:44:31 +02:00
Ziv 561b033ebb
Add coverage to qwikswitch (#33939) 2020-04-23 08:44:28 +02:00
Aaron Bach 4d292c2723
Add support for AirVisual Node/Pro units (#32815)
* Add support for AirVisual Node Pro units

* Fixed tests

* Updated dependencies

* Guard looks cleaner

* Limit options update to geography-based entries

* Docstring

* Use proper precision in display_temp

* Add availability for AirVisualNodeProSensor

* Updated translations

* Samba stuff in play

* Wrap up Samba

* Fix tests

* Remove unnecessary updates

* Normalize labels

* Bump requirements

* Don't include configuration.yaml support for this new functionality

* Fix tests

* Code review

* Code review

* Update coveragerc

* Code review
2020-04-23 01:41:14 +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
Franck Nijhof 60f79c848a
Remove Pushetta integration (#34497) 2020-04-21 14:28:03 +02:00
escoand c87ecf0ff6
Add config flow and device registry to fritzbox integration (#31240)
* add config flow

* fix pylint

* update lib

* Update config_flow.py

* remote devices layer in config

* add default host

* avoid double setups of entities

* remove async_setup_platform

* store entities in hass.data

* pass fritz connection together with config_entry

* fritz connections try no4 (or is it even more)

* fix comments

* add unloading

* fixed comments

* Update config_flow.py

* Update const.py

* Update config_flow.py

* Update __init__.py

* Update config_flow.py

* Update __init__.py

* Update __init__.py

* Update config_flow.py

* Update __init__.py

* Update __init__.py

* Update __init__.py

* Update config_flow.py

* add init tests

* test unloading

* add switch tests

* add sensor tests

* add climate tests

* test target temperature

* mock config to package

* comments

* test binary sensor state

* add config flow tests

* comments

* add missing tests

* minor

* remove string title

* deprecate yaml

* don't change yaml

* get devices async

* minor

* add devices again

* comments fixed

* unique_id fixes

* fix patches

* Fix schema

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-04-20 15:00:07 +02:00
Felipe Martins Diel a365f456fc
Add support to the new Broadlink RM Mini 3 and RM4 Series (#32523)
* Add device type

* Use snake_case for devtype

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

* Validate device type as positive int

* Add device type 0x5f36 to switch

* Use default type for sensors

* Add RM4 to switch platform

* Use snake_case for devtype

* Support multiple types of remote

* Validate ip address

* Improve code readability

* Add const.py to .coveragerc

* Use None for unknown device types

* Fix sensors and standardize platform schemas

* Fix if statement

Co-authored-by: springstan <46536646+springstan@users.noreply.github.com>
2020-04-19 01:16:49 +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
Chris Talkington b3eba49a2f
Add tests for Roku (#34380) 2020-04-18 17:23:55 -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
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
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
BarrettLowe ba394fd2aa
Add snapcast latency attribute and service (#34126)
* Implemented snapcast latency attributes

* Code review changes and Snapcast maintenance

Updated how entity services get called - now conforms to most
current method

* Cleanup tasks
Moved constants into separate file
Removed unnecessary logger message
Remove unnecessary schemas

* FIx linting errors

* Sort imports

* Update with requested change

Better - use next()

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

* Add guards for bad service calls

* Add back in platform schema

* Add check for unjoin service call

* Fix lint/format

* remove comma inserted by black

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-04-14 20:22:01 +02: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
Aaron Bach cb058ff6c0
Add config entry for Flu Near You (#32858)
* Add config flow for Flu Near You

* Cleanup

* Cleanup

* Add tests

* Add test requirements

* Code review

* Reduce unnecessary async-ness

* Handle API registration

* Cleanup

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

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

* Code review

* Ensure config schema allows additional keys

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-04-02 16:54:11 -07:00
J. Nick Koston b783aab41b
Add binary sensor for myq gateway connectivity (#33423) 2020-03-31 11:58:44 -07: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
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
elmurato 45241e57ca
Add support for Minecraft SRV records (#32372)
* Added support for Minecraft SRV records

* Switched from dnspython to aiodns, improved server ping and log messages, use address instead of host and port in config flow

* Updated component requirements
2020-03-23 16:51:13 -07: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
Franck Nijhof e87fab6b5f
Remove mopar integration (ADR-0004) (#33066) 2020-03-21 07:09:48 +01:00
Franck Nijhof acf41d03db
Remove alarmdotcom integration (ADR-0004) (#33056) 2020-03-20 20:21:20 +01:00
Maciej Bieniek c1ceab09e5
Migrate Brother to use DataUpdateCoordinator (#32800)
* Use DataCoordinator to update Brother data

* Simplify error text

* Improve tests

* Rename DEFAULT_SCAN_INTERVAL to SCAN_INTERVAL

* Add entity_registry_enabled_default property

* Add quality_scale to manifest.json file

* Remove misleading coordinator.data.data
2020-03-17 22:21:56 -05:00
Chris Talkington cf8dfdae47
Add config flow to roku (#31988)
* create a dedicated const.py

* add DEFAULT_PORT to const.py

* work on config flow conversion.

* remove discovery.

* work on config flow and add tests. other cleanup.

* work on config flow and add tests. other cleanup.

* add quality scale to manifest.

* work on config flow and add tests. other cleanup.

* review tweaks.

* Update manifest.json

* catch more specific errors

* catch more errors.

* impprt specific exceptions

* import specific exceptions

* Update __init__.py

* Update config_flow.py

* Update media_player.py

* Update remote.py

* Update media_player.py

* Update remote.py

* Update media_player.py

* Update remote.py

* Update config_flow.py

* Update config_flow.py

* Update media_player.py

* Update __init__.py

* Update __init__.py

* Update config_flow.py

* Update test_config_flow.py

* Update config_flow.py

* Update __init__.py

* Update test_config_flow.py

* Update remote.py

* Update test_init.py

* Update test_init.py

* Update media_player.py

* Update media_player.py

* Update media_player.py
2020-03-15 21:13:04 -07:00
shred86 d36259f067
Add Abode tests (#32562)
* Add tests for several devices

* Update coveragerc

* Code review changes and minor clean up

* More code review changes

* Update manifest and minor test updates

* Add test for locks and covers

* Add tests for switch on and off

* Add more complete test for alarms

* Fix for camera test

* Patch abodepy.mode for tests

* Add test for unknown alarm state and minor cleanup

* Update to make tests more robust

* More specific tests

* Update quality scale to silver

* Remove integration quality scale
2020-03-16 03:05:10 +01: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 bb666b9ac6
Add config flow to directv (#32162)
* initial work on config flow.

* more work on config flow.

* work on config flow and add tests. other cleanup.

* cleanup tests.

* fix test.

* isort

* Update .coveragerc

* Update test_init.py

* Update test_init.py

* Update test_init.py

* Update test_config_flow.py

* Update test_config_flow.py

* Update test_config_flow.py

* correct upnp serial format.

* improve config flow coverage.

* review tweaks.

* further review tweaks

* simplify dtv data gathering job

* lint

* black

* Update test_init.py

* Update test_init.py

* Simplify exception handling.

* Simplify exception handling.

* Update media_player.py

* Update test_media_player.py

* Update test_media_player.py

* Update test_media_player.py

* Update test_media_player.py

* Update test_media_player.py

* fix failing test.

* restore change made during debug.

* isort.

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-03-11 12:28:38 -07:00
jjlawren 44c7743351
Rewrite and add Plex tests (#32633)
* Rewrite and add Plex tests

* Remove unnecessary mocks

* Explicitly import constants for readability
2020-03-11 09:37:02 -07:00
cgtobi 50c32d57f5
Remove Netatmo binary sensor (#32673)
* Clean up for access scope review

* Remove deleted from coverage omit list
2020-03-11 09:25:19 -07:00
J. Nick Koston 048f9e7daa
Throw ConfigEntryNotReady when august servers are offline or u… (#32635)
* Throw ConfigEntryNotReady when august servers are offline

* august has tests now and its nearing 100%

* Adjust per review

* define in init
2020-03-10 17:10:00 -07:00
Vilppu Vuorinen b2bb9cf134
Add support for MELCloud Air-to-Water devices (#32078)
* Add support for melcloud Air-to-Water devices

* Add water_heater entity for the water heater component.

* Add individual climate entities for 0-2 supported radiator zones.

* Add sensors for zone room temperatures, outdoor temperature and tank
temperature.

* Update .coveragerc

* Use device_state_attributes

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

* Apply suggestions from code review

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

* Complete state_attributes -> device_state_attributes migration

* Move constants to top of file

* Remove async_turn_on/off

* Drop mac from ATW unique_ids

* Add MAC to device_info connections

* Remove redundant ABC inheritance

* Update homeassistant/components/melcloud/water_heater.py

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

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-03-10 11:00:07 -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 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
jjlawren df3f7687d4
Refactor Certificate Expiry Sensor (#32066)
* Cert Expiry refactor

* Unused parameter

* Reduce delay

* Deprecate 'name' config

* Use config entry unique_id

* Fix logic bugs found with tests

* Rewrite tests to use config flow core interfaces, validate created sensors

* Update strings

* Minor consistency fix

* Review fixes, complete test coverage

* Move error handling to helper

* Subclass exceptions

* Better tests

* Use first object reference

* Fix docstring
2020-03-02 07:44:24 -06: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
Aaron Bach e9a7b66df6
Add config entry for AirVisual (#32072)
* Add config entry for AirVisual

* Update coverage

* Catch invalid API key from config schema

* Rename geographies to stations

* Revert "Rename geographies to stations"

This reverts commit 5477f89c24cb3f58965351985b1021fc5fc794a5.

* Update strings

* Update CONNECTION_CLASS

* Remove options (subsequent PR)

* Handle import step separately

* Code review comments and simplification

* Move default geography logic to config flow

* Register domain in config flow init

* Add tests

* Update strings

* Bump requirements

* Update homeassistant/components/airvisual/config_flow.py

* Update homeassistant/components/airvisual/config_flow.py

* Make schemas stricter

* Linting

* Linting

* Code review comments

* Put config flow unique ID logic into a method

* Fix tests

* Streamline

* Linting

* show_on_map in options with default value

* Code review comments

* Default options

* Update tests

* Test update

* Move config entry into data object (in prep for options flow)

* Empty commit to re-trigger build
2020-02-28 20:14:17 -07: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
Aaron Bach c97b1c60b0
Modernize Notion config flow (#32167)
* Modernize Notion config flow

* Linting
2020-02-24 21:36:58 -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
Alexei Chetroi 3385893b77
ZHA device channel refactoring (#31971)
* Add ZHA core typing helper.
* Add aux_channels to ZHA rule matching.
* Add match rule claim_channels() method.
* Expose underlying zigpy device.
* Not sure we need this one.
* Move "base" channels.
* Framework for channel discovery.
* Make DEVICE_CLASS and REMOTE_DEVICE_TYPE default dicts.
* Remove attribute reporting configuration registry.
* Refactor channels.
- Refactor zha events
- Use compound IDs and unique_ids
- Refactor signal dispatching on attribute updates

* Use unique id compatible with entities unique ids.
* Refactor ZHA Entity registry.
Let match rule to check for the match.

* Refactor discovery to use new channels.
* Cleanup ZDO channel.
Remove unused zha store call.

* Handle channel configuration and initialization.
* Refactor ZHA Device to use new channels.
* Refactor ZHA Gateway to use new discovery framework.
Use hass.data for entity info intermediate store.

* Don't keep entities in hass.data.
* ZHA gateway new discovery framework.
* Refactor ZHA platform loading.
* Don't update ZHA entities, when restoring from zigpy.
* ZHA entity discover tests.
* Add AnalogInput sensor.
* Remove 0xFC02 based entity from Keen smart vents.
* Clean up IAS channels.
* Refactor entity restoration.
* Fix lumi.router entities name.
* Rename EndpointsChannel to ChannelPool.
* Make Channels.pools a list.
* Fix cover test.
* Fix FakeDevice class.
* Fix device actions.
* Fix channels typing.
* Revert update_before_add=False
* Refactor channel class matching.
* Use a helper function for adding entities.
* Make Pylint happy.
* Rebase cleanup.
* Update coverage for ZHA device type overrides.
* Use cluster_id for single output cluster registry.
* Remove ZHA typing from coverage.
* Fix tests.
* Address comments.
* Address comments.
2020-02-21 18:06:57 -05:00
Patrick Kishino f32411e394
Add asuswrt interface and dnsmasq location configuration (#29834)
* Added interface and dnsmasq location configuration

* Updated aioasuswrt requirement to latest 1.2.1 release

* Updated to working aioasus library and fixed correct conf formatting
2020-02-21 17:01:57 +01:00
Markus Pöschl 245482d802
Add Twitch subscription and additional stats (#31122)
* add oauth functionality and additional attributes

* Add tests WIP

* Make mocks work the correct way

* Use CONF_TOKEN constant for config

* Remove twitch from .coveragerc

* Update homeassistant/components/twitch/sensor.py

Lets be consistent

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

Co-authored-by: springstan <46536646+springstan@users.noreply.github.com>
2020-02-18 11:51:37 -08:00
Franck Nijhof 4497e98ea2
Remove duke_energy integration (ADR-0004) (#31921) 2020-02-17 21:51:53 +01: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
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
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
Bernhard B 294c6a713f
Support multiple attachments in signal messenger integration (#31141)
* added support for multiple attachments to signal_messenger integration

* updated pysignalclirestapi version in requirements_all.txt

* reworked multiple attachments feature in signal_messenger integration

* stay backwards compatible by both allowing the "attachment" and
  the "attachments" attribute.

* reworked multiple attachments feature in signal_messenger integration

* stay backwards compatible by both allowing the "attachment" and
  the "attachments" attribute.

* small change in signal_messenger integration

* added deprecation warning for 'attachment' attribute

* small changes in signal_messenger integration

* use 'warning' instead of 'warn' when logging the warning message

* re-generated requirements_test_pre_commit.txt

* added tests for signal_messenger integration

* regenerated requirements_test_all.txt for signal_messenger integration

* added more signal_messenger tests

* remove signal_messenger integration files from .coveragerc
2020-02-01 14:21:16 -08:00
escoand d225fc08fe
drop fritzdect (#31359) 2020-01-31 14:20:06 -08:00
Raman Gupta 73ea34e417
Update media_player and add tests to qualify vizio integration for platinum quality score (#31187)
* add media player test and update media player logic to qualify vizio for platinum quality score

* add SCAN_INTERVAL and log message once when device goes from available to unavailable and vice versa

* move test constants into one file to avoid defining dupes in each test file

* move constant to shrink diff

* move pytest fixtures to conftest.py

* remove commented out code

* move unload test to test_init

* updates to tests and logging based on review

* bypass notification service

* add fixture so component setup makes it through config flow

* split failure tests into two

* fix setup and entity check for test_init and setup failures in test_media_player

* make domain references consistent across test files

* remove logging steps that were introduced to help debug

* move common patches out to new fixture and use config entry everywhere appropriate

* fix docstring

* add test for update options to increase code coverage

* add one more assert

* refactor test_media_player to move boiler plate logic out of each test into _test_init function

* final refactor of test_media_player to move repeat logic into separate function

* update docstrings

* refactor setup failure tests to move shared logic into private function

* fix last new functions code to use variable instead of static config variable

* remove trailing comma

* test that volume_step gets properly passed to Vizio volume function

* fix comment language

* assert with unittest.mock.call in _test_service and use config_entries.async_setup instead of config_entries.async_add

* replace config_entries.async_add with config_entries.async_setup everywhere

* simplify if statement for argument assertion

* fix logging based on style guide

* remove accidentally committed changes

* update scan interval to something more reasonable and add tests for availability changes

* change filter function to list comprehension, simplify log messages, remove default entity id from logs since it is user configurable, fix docstrings
2020-01-30 22:13:45 +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
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
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
Matt Snyder e4832ee4d0 Remove Owlet component (#31160)
* Remove owlet component

* Remove owlet from requirements_all.txt
2020-01-25 21:08:36 +01:00
Quentame c481a48e3a Separate iCloud class (#31022)
* Separate iCloud class

* Update .coveragerc

* Fix pipe
2020-01-25 13:24:50 -05:00
Paulus Schoutsen 98bac43228
Validate coveragerc with hassfest (#31112)
* Validate coveragerc

* Test if files exists

* Print progress

* Flush
2020-01-24 10:25:46 -08: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
Raman Gupta 8630a076a7 Use default media player device classes for vizio component (#30802)
* use media player defined device classes instead of custom ones, add options flow test, add timeout options parameter

* make options update error more generic

* fix config flow options update logic

* simplify logic for options update during import

* use platform list for load and unload

* update private config flow function name and description

* fix grammar in strings.json

* update mock config variable names to be more accurate

* remove timeout conf option, create device_class property

* update requirements

* update .coveragerc to indicate that config_flow has tests

* fix source of device_class property and move constants to const.py

* fix grammar in error message

* remove redundant device check in async_setup_entry since device connection is checked during config flow

* revert change to async_setup_entry, raise ConfigEntryNotReady if device can't be connected to

* update error text

* add more context to error text
2020-01-18 09:15:05 +01:00
Peter Nijssen 196bf2f3a0 remove PostNL component as it is no longer working (#30902) 2020-01-17 12:51:32 -08:00
Franck Nijhof 658d338058 Removes Cisco Spark integration (#30738) 2020-01-13 10:23:26 -08: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
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
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
Raman Gupta 7d58de1bda Update vizio component to prepare for config flow and zeroconf support (#30522)
* move constants, move schema validation to init, prepare for zeroconf/config flow

* update requirements_all and make setup validation more pythonic

* mistake in refactor

* un-revert change from previous PR

* rename schema var

* update .coveragerc, move validate_auth to __init__, only attempt to get ESN if device setup is validated

* reinstate validate_setup but change logic to use new connection test function

* fix schema validation

* simplify string empty check logic

* missed commit
2020-01-06 20:32:31 -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
Ville Skyttä f400b77837
Preserve new BLE tracker item name if seen before adding discovery (#30318)
* Preserve new BLE device name if one seen before the last scan but not on it

* Save an indented else block

* Use async_fire_time_changed and mock_device_tracker_conf in tests
2020-01-05 23:13:54 +02: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
brefra 3c8ebf1844 Add light support to Velbus integration (#30323)
* Add light support to Velbus integration

* Add Velbus light.py to .coveragerc

* Applied black formatting
2019-12-31 15:46:02 +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
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
Robert Van Gorkom 78e831b08e Make tplink light more responsive (#28652)
* Making tplink light more responsive.

* Adding light platform tests.

* Addressing PR feedback.

* Mocking the module, not the api.

* Using sync method for background update.
2019-12-17 02:24:50 +01:00
Ville Skyttä 445fd15f76 Drop Python 3.6 support (#29978) 2019-12-16 07:29:19 +01:00
Quentame 820780996a Add battery sensor to iCloud (#29818)
* Add battery sensor to iCloud

* Update .coveragerc

* Review: @balloob & @MartinHjelmare

* Review: use f string
2019-12-14 23:06:00 +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
Pascal Vizeli 3a28361beb Cleanup removed component (#29788) 2019-12-09 16:21:12 +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
Robert Van Gorkom e577f047f7 Add tests for vera component (#28340)
* Adding tests for vera component.
Fixing update bug in the vera climate platform.

* Updating requrements file.

* Moving vera stop to a job.
Sorting imports.

* Addressing simple PR feedback.

* Splitting tests into platforms.

* Mocking controller instead of using requests_mock.

* Updating pyvera to use version that stops threads quickly.

* Updating requirements files.

* Mocking the pyvera module, not the API.

* Addressing PR feedback.
Handling start/stop of patch in fixture.
Removing unecessary code.

* Using generator
2019-12-09 00:19:38 +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
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
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
Raman Gupta 88376bf363 move wemo services to wemo domain (#29135) 2019-11-27 16:49:12 -08:00
Raman Gupta ceb1528b50 Update bluetooth_tracker service name and domain from 'device_tracker' to 'bluetooth_tracker' (#29161)
* move service constants to const.py, update service domain, add service description

* update .coveragerc
2019-11-27 14:18:01 -08:00
Raman Gupta b274fcba05 Update service domain for harmony from 'remote' to 'harmony' (#29146)
* move harmoney services to harmony domain

* update service names
2019-11-27 18:14:46 +01:00
Raman Gupta d577868190 move yamaha service to yamaha domain (#29142) 2019-11-27 18:13:54 +01:00
Raman Gupta 12ae8b025f move squeezebox service to squeezebox domain (#29141) 2019-11-27 13:54:00 +01:00
Raman Gupta 59939004bf Update service domain for mill from 'climate' to 'mill' (#29132) 2019-11-27 13:47:38 +01:00
Raman Gupta 1681d36637 Update service domain for todoist from 'calendar' to 'todoist' (#29131)
* move todoist constants to const.py and update service domain

* update .coveragerc

* remove unused variable

* save file
2019-11-27 11:26:59 +01:00
Raman Gupta ec61a86678 move service constants to const.py and move channels services to channels domain (#29139) 2019-11-27 11:23:52 +01:00