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

761 Commits

Author SHA1 Message Date
João Gabriel
72759d7501
Re-add forced update in Panasonic Viera (#41804) 2020-10-14 15:33:47 +02:00
Clifford Roche
839b9f226e
Add gree climate integration (#37498)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-10-14 15:15:56 +02:00
J. Nick Koston
ef9cd485fd
Update to zeroconf 0.28.6 to accomodate devices that are not strictly name compliant (#41784) 2020-10-13 14:02:52 -05:00
Jason Hunter
9877e8e25b
Add Xbox Integration (#41697)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-10-13 15:37:01 +02:00
Brett
3e41c682f4
Add Advantage Air Integration (#40159)
Co-authored-by: Robert Svensson <Kane610@users.noreply.github.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-10-12 13:22:15 +02: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
Gabe Cook
4b617db669
Add Ruckus Unleashed integration (#40002)
* Add Ruckus Unleashed integration

* Tweak catches to better rely on CoordinatorEntity error handling, rename LoginError to AuthenticationError

* Make router_update be a callback function

* Make name property return hint match the newer value

* Add entity to tracked set when restoring on boot

* Add a device's MAC to the attributes
2020-10-10 13:01:53 +02:00
epenet
843c4e27f3
Update Onewire SysBus integration to use a 3rd party library (#40943) 2020-10-09 17:31:05 +02:00
Martin Hjelmare
e006e0ddb3
Revert zoneminder config flow (#41395) 2020-10-07 16:28:49 +02:00
Erik Montnemery
06e9489fc7
Add Tasmota integration (#39624)
* Add Tasmota integration

* Refactor

* Add tests, small improvements

* isort

* Attempt to fix tests failing with Python 3.8

* Revert "Attempt to fix tests failing with Python 3.8"

This reverts commit 11454f8a00136f068ea27204183fa3e62f3cd263.

* Fix tests failing with Python 3.8

* Cleanup tests

* Address review comments

* Address review comments

* Address review comments

* Use MAC address for device identification

* Bump hatasmota

* Bump hatasmota

* Apply suggestions from code review

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

* Fix indentation

* Remove preparation for device remove WS API

* Address review comments

* Remove useless try-except

* Tweak

* Improve tests

* Tweak

* Address review comments

* Correct test

* Update manifest.json

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-10-06 14:51:58 +02:00
J. Nick Koston
494d4a262a
Add Profiler integration (#41175)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-10-05 07:57:07 -05:00
Rob Bierbooms
c5041b41c8
Implement config and option flow for rfxtrx integration (#39117)
* Create option flow for Rfxtrx integration (#37982)

* Implement config flow for rfxtrx integration (#39299)

* Add config flow

* Add strings

* Add first series of tests

* Add tests

* Adjust tests according review comments

* Adjust strings

* Add executor for testing connection

* Change ports to dict

* Fix pylint issue

* Adjust tests

* Migrate config entry for rfxtrx integration (#39528)

* Add rfxtrx device connection validation when importing (#39582)

* Implement import connection validation

* Fix binary sensor tests

* Move rfxtrx data

* Fix cover tests

* Fix test init

* Fix light tests

* Fix sensor tests

* Fix switch tests

* Refactor rfxtrx test data

* Fix strings

* Fix check

* Rework device string in test code

* Add option to delete multiple rfxtrx devices (#39625)

* Opt to remove multiple devices

* Fix devices key

* Add tests (phase 1)

* Add tests (phase 2)

* Tweak remove devices test

* Implement device migration function in rfxtrx option flow (#39694)

* Prompt option to replace device

* Revert unwanted changes

* Add replace device function

* WIP replace entities

* Remove device/entities and update config entry

* Fix styling

* Add info

* Add test

* Fix strings

* Refactor building migration map

* Allow migration for all device types

* Add test to migrate control device

* Fixup some names

* Fixup entry names in test code

* Bump pyRFXtrx to 0.26 and deprecate debug config key (#40679)

* Create option flow for Rfxtrx integration (#37982)

* Implement config flow for rfxtrx integration (#39299)

* Add config flow

* Add strings

* Add first series of tests

* Add tests

* Adjust tests according review comments

* Adjust strings

* Add executor for testing connection

* Change ports to dict

* Fix pylint issue

* Adjust tests

* Migrate config entry for rfxtrx integration (#39528)

* Add rfxtrx device connection validation when importing (#39582)

* Implement import connection validation

* Fix binary sensor tests

* Move rfxtrx data

* Fix cover tests

* Fix test init

* Fix light tests

* Fix sensor tests

* Fix switch tests

* Refactor rfxtrx test data

* Fix strings

* Fix check

* Rework device string in test code

* Add option to delete multiple rfxtrx devices (#39625)

* Opt to remove multiple devices

* Fix devices key

* Add tests (phase 1)

* Add tests (phase 2)

* Tweak remove devices test

* Implement device migration function in rfxtrx option flow (#39694)

* Prompt option to replace device

* Revert unwanted changes

* Add replace device function

* WIP replace entities

* Remove device/entities and update config entry

* Fix styling

* Add info

* Add test

* Fix strings

* Refactor building migration map

* Allow migration for all device types

* Add test to migrate control device

* Fixup some names

* Fixup entry names in test code

* Bump version number

* Remove debug key from connect

* Remove debug option from config flow

* Remove debug from tests

* Fix event test

* Add cv.deprecated

* Fix test

* Fix config schema

* Add timeout on connection

* Rework config schema

* Fix schema...again

* Prevent creation of duplicate device in rfxtrx option flow (#40656)
2020-10-01 08:55:57 +02:00
Alex
373a1cabe6
Re-enable hdmi_cec component (#40671) 2020-09-28 08:31:35 +02: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
Vladimír Záhradník
1d41f024cf
Add Modbus cover (#33642)
* Add Modbus cover

* Fix improper commands written for Modbus cover via coil

* Make changes per review comments

* Fix default hub not defined

Since support for multiple hubs was added, the default hub option
was not implemented correctly. Now I added necessary logic to make
it work. First hub in a list will be used as a default hub.

* Move Cover config under Modbus section

* Revert setting up a default hub alias

* Make hub mandatory for Cover

* Add default scan interval

* Read scan_interval from discovery info

* Fix linter error

* Use default scan interval from Cover platform

* Handle polling for Modbus cover directly inside entity

* Move covers under hub config

* Fix for review comment

* Call update() from Cover actuator methods

* Fix time validation
2020-09-26 11:11:51 -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
Martin Eberhardt
700b119482
Add @darkfox as Rejseplanen code owner (#40329) 2020-09-25 07:48:08 +02:00
Dermot Duffy
0a656f13eb
Fix/Refactor Hyperion Integration (#39738) 2020-09-24 21:37:34 +02:00
Julien Tant
8b9c757fdc
Add zodiac integration (#38935)
* add zodiac sign integration

* add tests & refacto

* Apply suggestions from code review

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

* fix indentation from suggested correction, fix quality scale and remove useless functions

* fix code formatting

* Create const.py

* Update sensor.py

* Update const.py

* Update test_sensor.py

* Update test_sensor.py

* Update test_sensor.py

* Update test_sensor.py

* Update test_sensor.py

* Update sensor.py

* Update test_sensor.py

* Update __init__.py

* Update sensor.py

* Update test_sensor.py

* Update sensor.py

* Update __init__.py

* Update test_sensor.py

* Update __init__.py

* Fix zodiac time patch

* Delete sensor.fr.json

* Update sensor.py

* Delete sensor.en.json

* Update test_sensor.py

* Apply suggestions from code review

Co-authored-by: Chris Talkington <chris@talkingtontech.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-09-21 10:41:30 -05:00
Finbarr Brady
4aa9b72739
Remove myself as Luci code owner (#40398) 2020-09-21 14:10:39 +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
cgtobi
4efefd7fba
Add cgtobi to kodi code owners (#40202)
* Add myself to Kodi code owners

* Run hassfest
2020-09-17 20:17:22 -05:00
cgtobi
689f1519c0
Add cgtobi to sonos code owners (#40204)
* Add myself to Sonos code owners

* Run hassfest
2020-09-17 20:16:29 -05: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
Xiaonan Shen
d26160c755
Add rpi_power integration (#35527)
Co-authored-by: Toast <swetoast@users.noreply.github.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-09-14 12:53:01 +02:00
Joakim Sørensen
1d12d4d54c
Bump pyhaversion to 3.4.0 (#40016) 2020-09-13 11:30:51 +02:00
Greg Dowling
f1cb8e80b3
Bump pyloopenergy library to 0.2.1 (#39919) 2020-09-11 20:47:48 +02:00
Quentame
95a33ba894
Bump Synology DSM to 0.9.0 (#39819) 2020-09-08 23:38:41 +02:00
Bas Nijholt
fa1a53cdeb
Restore miflora now that v0.7.0 is out (#39787)
* add miflora again, reverts part of github.com/home-assistant/core/pull/37707

* edit CODEOWNERS
2020-09-08 13:50:53 +02:00
uvjustin
c9a4deb118
Set log level for libav.mp4 in stream (#39719)
Also add @uvjustin to codeowners
2020-09-06 20:46:36 +02:00
Keilin Bickar
3022fc4702
Add Emulated Kasa Integration (#39630)
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-09-05 07:57:45 -05: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
Jason Hunter
f2b3e63ff6
Media Source implementation for Chromecast (#39305)
* Implement local media finder and integrate into cast

* update to media source as a platform

* Tweak media source design

* fix websocket and local source

* fix websocket schema

* fix playing media

* Apply suggestions from code review

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

* Add resolve_media websocket

* Register that shit

* Square brackets

* Sign path

* add support for multiple media sources and address PR review

* fix lint

* fix tests from auto whitelisting config/media

* allow specifying a name on the media source

* add tests

* fix for python 3.7

* Apply suggestions from code review

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* add http back to cast and remove guess_type from executor as there is no i/o

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-09-04 11:16:29 -04: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
Rob Bierbooms
d0120d5e0a
Update DSMR integration to import yaml to ConfigEntry (#39473)
* Rewrite to import from platform setup

* Add config flow for import

* Implement reload

* Update sensor tests

* Add config flow tests

* Remove some code

* Fix pylint issue

* Remove update options code

* Add platform import test

* Remove infinite while loop

* Move async_setup_platform

* Check for unload_ok

* Remove commented out test code

* Implement function to check on host/port already existing

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

* Implement new method in import

* Update tests

* Fix test setup platform

* Add string

* Patch setup_platform

* Add block till done to patch block

Co-authored-by: Chris Talkington <chris@talkingtontech.com>
2020-09-03 16:19:45 -05:00
Michael Thingnes
0892acbabd
Met.no migrate from classic to complete endpoint (#39493) 2020-09-02 14:11:13 +02:00
jdelaney72
762d7357b5
Fix outdated api url in noaa_tides (#39370)
* Fix outdated dependency in noaa_tides

* Catch exceptions when instantiating new Station

* Add myself to codeowners
2020-09-01 12:42:39 +02:00
Emily Mills
3fe8afe667
Removing myself as a kodi owner
I no longer use Kodi
2020-08-31 16:53:32 -04:00
Xiaonan Shen
45a927ffb2
Add config flow to yeelight (#37191) 2020-08-31 16:40:56 +02: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
Maciej Bieniek
80910b4f9a
Add bieniu as code owner for shelly (#39467) 2020-08-30 13:17:27 -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
Marvin Wichmann
a2651845f3
Centralize knx config and update xknx to 0.12.0 (#39219)
* Refactor KNX integration to centralize configuration yaml (#39189)

* Updates for xknx 0.12.0 (#38880)
2020-08-26 18:03:03 +02:00
Daniel Hjelseth Høyer
7bc273b182
Remove yr integration after a request from yr.no (#39247) 2020-08-25 21:18:45 +02:00
Leonardo Figueiro
a47f73244c
Add Wilight integration with SSDP (#36694)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-08-24 14:15:07 +02:00
Paulus Schoutsen
ca2bc9906d
Add Shelly integration (#39178) 2020-08-24 12:43:31 +02:00
Fabian Affolter
1f5b948ead
Upgrade connect-box to 0.2.7 (#39162) 2020-08-22 13:57:28 -05:00
Fabian Affolter
e909596587
Upgrade volkszaehler to 0.1.3 (#39147) 2020-08-22 12:12:09 -04:00
On Freund
1b8d9f7cc4
Add Risco integration (#36930)
* Risco integration

* Fix lint errors

* Raise ConfigEntryNotReady if can't connect

* Gracefully handle shutdown

* pass session to pyrisco

* minor change to init

* Fix retries

* Add exception log

* Remove retries

* Address code review comments

* Remove log
2020-08-21 23:49:09 -05:00
On Freund
c1ed584f2d
Add config flow to kodi (#38551)
* Add config flow to kodi

* Fix lint errors

* Remove entry update listener

* Create test_init.py

* Apply suggestions from code review

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

* Update __init__.py

* fix indentation

* Apply suggestions from code review

* Apply suggestions from code review

* Update tests/components/kodi/__init__.py

* Fix init test

* Fix merge

* More review changes

* Apply suggestions from code review

* Apply suggestions from code review

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

* Fix black formatting

* Fix Flake8

* Don't store CONF_ID

* Fall back to entry id

* Apply suggestions from code review

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

* Update __init__.py

* Apply suggestions from code review

* Apply suggestions from code review

Co-authored-by: Chris Talkington <chris@talkingtontech.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-08-20 23:16:58 -05: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
Graham Wetzler
bb164bb32c
Smart Meter Texas integration (#37966)
* Run scaffold script

* Update version

* Bump version

* Initial commit

* Move meter and ESIID to device attributes

* Update internal to hourly due to api limit

* Format with Black

* Fix typo

* Update tests

* Update description

* Disable Pylint error

* Don't commit translations

* Remove meter number from sensor name

* Allow multiple meters per account

* Move data updates to a DataUpdateCoordinator

* Use setdefault to setup the component

* Move strings to const.py

* Fix tests

* Remove meter last updated attribute

* Bump smart-meter-texas version

* Fix logger call

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

* Remove unneeded manifest keys

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

* Remove icon property

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

* Handle instance where user already setup an account

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

* Remove icon constant

* Fix indentation

* Handle config flow errors better

* Use ESIID + meter number as unique ID for sensor

* Update config flow tests to reach 100% coverage

* Avoid reading meters on startup

Cherrypick @bdraco's suggestion

* Run scaffold script

* Update version

* Bump version

* Initial commit

* Move meter and ESIID to device attributes

* Update internal to hourly due to api limit

* Format with Black

* Fix typo

* Update tests

* Update description

* Disable Pylint error

* Don't commit translations

* Remove meter number from sensor name

* Allow multiple meters per account

* Move data updates to a DataUpdateCoordinator

* Use setdefault to setup the component

* Move strings to const.py

* Fix tests

* Remove meter last updated attribute

* Bump smart-meter-texas version

* Fix logger call

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

* Remove unneeded manifest keys

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

* Remove icon property

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

* Handle instance where user already setup an account

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

* Remove icon constant

* Fix indentation

* Handle config flow errors better

* Use ESIID + meter number as unique ID for sensor

* Update config flow tests to reach 100% coverage

* Remove unnecessary try/except block

This checks for the same exception just prior in execution on L51.

* Remove unused return values

* Add tests

* Improve tests and coverage

* Use more pythonic control flow

* Remove all uses of hass.data

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-08-19 13:16:45 -05:00
Paulus Schoutsen
24a16ff8fe
Add image integration (#38969) 2020-08-19 11:33:04 +02:00
endor
bf643b63ad
Add wind max speed to trafikverket_weatherstation (#38929)
* Add wind max speed to trafikverket_weatherstation

* Update CODEOWNERS
2020-08-17 15:39:00 -04: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
stephan192
016cd8f8ef
Move DwdWeatherWarningsAPI to a library hosted on PyPI (#34820)
* Move DwdWeatherWarningsAPI to a library hosted on PyPI
PyPI library uses new DWD WFS API
WFS API allows a more detailed query with reduced data sent as return
Change CONF_REGION_NAME from Optional to Required because it was never really optional
Set attribute region_state to "N/A" because it is not available via the new API
Add attributes warning_i_parameters and warning_i_color

* Use constants instead of raw strings
Streamline methods state and device_state_attributes

* Wrap api, use UTC time

* Update homeassistant/components/dwd_weather_warnings/sensor.py

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

* Update homeassistant/components/dwd_weather_warnings/manifest.json

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

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-08-11 17:55:50 +02:00
David F. Mulcahey
227d7c0a99
[RFC] Add Tag integration (#38727)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-08-11 11:08:47 +02:00
Jc2k
f82f815304
Add water level sensors provided by UK Environment Agency (#31954) 2020-08-10 15:51:04 +02:00
David F. Mulcahey
f1fd8aa51f
Add support for Flo by Moen water shutoff devices (#38171) 2020-08-10 14:19:38 +02:00
Marcio Granzotto Rodrigues
761067559d
Add Nightscout integration (#38615)
* Implement NightScout sensor integration

* Add tests for NightScout integration

* Fix Nightscout captalization

* Change quality scale for Nightscout

* Trigger actions

* Add missing tests

* Fix stale comments

* Fix Nightscout manufacturer

* Add entry type service

* Change host to URL on nightscout config flow

* Add ConfigEntryNotReady exception to nighscout init

* Remote platform_schema from nightscout sensor

* Update homeassistant/components/nightscout/config_flow.py

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

Co-authored-by: Chris Talkington <chris@talkingtontech.com>
2020-08-09 13:15:56 -05:00
Quentame
21f4d694bb
Remove Linky integration (#38565) 2020-08-06 11:18:05 +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
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
Oncleben31
6b85e23408
Refactor Météo-France to use API instead of web scraping (#37737)
* Add new python library

* Update requirements

* Remove old libs

* config flow with client.search_places

* WIP: UI config + weather OK

* WIP: sensors

* WIP: add pressure to weather + available to sensor

* WIP: coordinator next_rain + alert

* Make import step working

* migrate to meteofrance-api v0.0.3

* Create coordinator for rain only if data available in API

* Fix avoid creation of rain sensor when not available.

* Add options flow for forecast mode

* Fix import config causing bug with UI

* Add alert sensor

* Add coastal alerts when available (#5)

* Use meteofrance-api feature branch on Github

* Update unit of next_rain sensor

* Test different type of attibutes

* Typo for attribute

* Next rain sensor device class as timestamp

* Better design for rain entity attributes

* use master branch for meteofrance-api

* time displayed in the HA server timezone.

* fix bug when next_rain_date_locale is None

* Add precipitation and cloud cover sensors

* Add variable to avoid repeating computing

* Apply suggestions from code review

Co-authored-by: Quentame <polletquentin74@me.com>

* Attributes names in const.

* Cleaning

* Cleaning: use current_forecast and today_forecast

* Write state to HA after fetch

* Refactor, Log messages and bug fix. (#6)

* Add messages in log

* Refactor using 'current_forecast'.

* Use % string format with _LOGGER

* Remove inconsistent path

* Secure timestamp value and get current day forecast

* new unique_id

* Change Log message to debug

* Log messages improvement

* Don't try to create weather alert sensor if not in covered zone.

* convert wind speed in km/h

* Better list of city in config_flow

* Manage initial CONF_MODE as None

* Review correction

* Review coorections

* unique id correction

* Migrate from previous config

* Make config name detailed

* Fix weather alert sensor unload (#7)

* Unload weather alert platform

* Revert "Unload weather alert platform"

This reverts commit 95259fdee84f30a5be915eb1fbb2e19fcddc97e4.

* second try in async_unload_entry

* Make it work

* isort modification

* remove weather alert logic in sensor.py

* Refactor to avoid too long code lines

Co-authored-by: Quentin POLLET <polletquentin74@me.com>

* Update config tests to Meteo-France (#18)

* Update meteo_france exception name

* Update MeteoFranceClient name used in tests

* Update 'test_user'

* Make test_user works

* Add test test_user_list

* Make test_import works

* Quick & Dirty fix on exception managment. WIP

* allow to catch MeteoFranceClient() exceptions

* remove test_abort_if_already_setup_district

* bump meteofrance-api version

* We do not need to test Exception in flow yet

* Remove unused data

* Change client1 fixture name

* Change client2 fixture name

* Finish cities step

* Test import with multiple choice

* refactor places

* Add option flow test

Co-authored-by: Quentin POLLET <polletquentin74@me.com>

* Fix errors due to missing data in the API (#22)

* fix case where probability_forecast it not in API
* Workaround for probabilty_forecast data null value
* Fix weather alert sensor added when shouldn't
* Add a partlycloudy and cloudy value options in condition map
* Enable snow chance entity

* fix from review

* remove summary

* Other fix from PR review

* WIP: error if no results in city search

* Add test for config_flow when no result in search

* Lint fix

* generate en.json

* Update homeassistant/components/meteo_france/__init__.py

* Update homeassistant/components/meteo_france/__init__.py

* Update homeassistant/components/meteo_france/__init__.py

* Update homeassistant/components/meteo_france/sensor.py

* Update homeassistant/components/meteo_france/__init__.py

* Update homeassistant/components/meteo_france/__init__.py

* string: city input --> city field

Co-authored-by: Quentin POLLET <polletquentin74@me.com>
2020-08-01 22:56:00 +02:00
Glenn Waters
c5ca484eaa
Bump ElkM1 library version. (#38368)
To reduce required version of dependent library.
No code changed.
2020-07-29 21:49:10 +02:00
starkillerOG
b7976d2856
Add myself to xiaomi miio codeowners (#38350)
* add myself to xiaomi miio codeowners

* Update CODEOWNERS

* Update manifest.json
2020-07-29 11:21:47 +02: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
Philipp Schmitt
027ece52e6
Fix Nuki Locks and Openers not being available after some time (#38159) 2020-07-24 16:42:42 +02: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
Ivan Belokobylskiy
cecdce07cc
Fix Yandex transport Integration, add signature to requests (#37365) 2020-07-17 12:55:30 -07:00
Perry Naseck
93919dea88
Add Firmata Integration (attempt 2) (#35591) 2020-07-16 17:58:45 -07:00
Joakim Plate
1a64108eea
Switch rfxtrx to config entries (#37794)
* Switch to config flow setup

* Add minimal test for config flow

* Add myself as codeowner and address some review concerns

* Address some further review comments
2020-07-13 23:24:28 +02:00
Eugene Prystupa
9b77e16ffc
Add new integration for Bond hub (#37477)
* create foundation for Bond integration

* add Bond hub integration (fix lint)

* Update homeassistant/components/bond/__init__.py

adding async_unload_entry per PR review suggestion

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

* add Bond hub integration (fix missing import after applying PR suggestion)

* Update tests/components/bond/test_init.py

add a unit for unloading per PR review suggestion

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

* Update tests/components/bond/test_init.py

add unit test for unload per PR review suggestion

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

* Update tests/components/bond/test_init.py

PR review suggestion

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

* Update tests/components/bond/test_init.py

PR review suggestion

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

* Update tests/components/bond/test_init.py

PR review suggestion

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

* add Bond hub integration (fix formatting)

* Update homeassistant/components/bond/manifest.json

PR suggestion

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

* Update homeassistant/components/bond/manifest.json

PR suggestion

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

* Update homeassistant/components/bond/manifest.json

PR suggestion

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

* Update homeassistant/components/bond/strings.json

PR suggestion

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

* Update homeassistant/components/bond/manifest.json

PR suggestion

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

* Update requirements_all.txt

PR suggestion

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

* Update homeassistant/components/bond/manifest.json

PR suggestion

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

* Update requirements_test_all.txt

PR suggestion

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

* add Bond hub integration (remove friendly name from config per PR suggestion)

* Update homeassistant/components/bond/__init__.py

add per PR review feedback

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

* Update homeassistant/components/bond/__init__.py

remove per PR review feedback

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

* Update tests/components/bond/test_init.py

fix unit test

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

Co-authored-by: Chris Talkington <chris@talkingtontech.com>
2020-07-05 20:17:53 -05:00
Robbie Trencheny
b859be8cea
Remove my codeownership over things I dont use anymore (#37401) 2020-07-03 09:41:23 +02:00
Franck Nijhof
235298a1b2
Add Hue manual bridge config flow + options flow (#37268)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-07-02 14:12:24 +02:00
Gage Benne
bcabf6da91
Add Dexcom Integration (#33852)
* Initial commit for Dexcom integration

* Dexcom config flow testing

* Clarify errors during setup

* Resolve minor test issues

* Update sensor availability, resolve linting issues

* Add sensor tests

* Remove title due to 0.109, add abort

* >94.97% codecov/patch

* Move .translations/ to translations/

* Add constants for servers and unit of measurements

* Bump pydexcom version

* Updated domain schema, Dexcom creation

* Support for different units of measurement

* Update tests

* Remove empty items from manifest

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

* Raise UpdateFailed if fetching new session fails

* Switch everything over to required

* Simplify state information

* Simplify async_on_remove

* Pydexcom package now handles fetching new session

* Only allow config flow

* Remove ternary operator

* Bump version, pydexcom handling session refresh

* Using common strings

* Import from test.async_mock

* Shorten variable names

* Resolve tests after removing yaml support

* Return false if credentials are invalid

* Available seems to handle if data is empty

* Now using option flow, remove handling import

* Add fixture for JSON returned from API

* Overhaul testing

* Revise update options

* Bump pydexcom version

* Combat listener repetition

* Undo update listener using callback

* Change sensor availability to use last_update_success

* Update sensor availability and tests

* Rename test

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-07-02 02:14:54 +02: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
mdegat01
b0e2f5f375
Add mdegat01 as code owner for InfluxDB (#37227) 2020-06-29 20:21:21 +02:00
Eugene Prystupa
e3b90ea3f7
Add Plum Lightpad config flow (#36802)
* add support for config flow for Plum Lightpad integration

* add support for config flow for Plum Lightpad integration (remove unintended change to requirements_test_all.txt)

* add support for config flow for Plum Lightpad integration (fix lint issues)

* add support for config flow for Plum Lightpad integration (PR feedback)

* add support for config flow for Plum Lightpad integration (fix lint)

* Update homeassistant/components/plum_lightpad/__init__.py

use debug instead of info for logging

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* Update homeassistant/components/plum_lightpad/strings.json

switch to use generated references instead of hard-coded strings

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* Update homeassistant/components/plum_lightpad/strings.json

switch to use references instead of hard-coded string

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* Update homeassistant/components/plum_lightpad/strings.json

removing translated title per suggestion

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* Update homeassistant/components/plum_lightpad/strings.json

removing per suggestion

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* remove unnecessary deepcopy

* remove unnecessary logging warning, since ignoring is expected for configuration.yaml scenario

* switch to hass.loop.create_task per PR feedback

* show login errors when configuring integration via UI (PR feedback)

* disable wrongly flag pylint violation

* add except handler to handle connection errors when setting up config flow entry

* address PR feedback regarding exception handling

* Update homeassistant/components/plum_lightpad/config_flow.py

use helper instead of custom code/message-id

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-06-23 20:40:11 -07:00
Thomas Le Gentil
2af961513d
Remove fortigate integration (#34586) 2020-06-24 00:21:51 +02:00
Shulyaka
c28493098a
Add new humidifier entity integration (#28693)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-06-22 17:59:16 -07:00
Franck Nijhof
b47be05efc
Add new Remote Python Debugger integration (#36960) 2020-06-22 15:17:59 +02:00
Gerard
5cd85f9f00
Upgrade to bimmer_connected 0.7.7 (#36985) 2020-06-22 13:06:18 +02:00
David Ryan
29adc6a27b
Support Hydrawise API v1.4 (#34448)
* Now supports Hydrawise API v1.4

* Removed dependency and codeowners name.

* Update CODEOWNERS to include hydrawise

* Changes made from review comments.

* Clean up update.

* Added device class for timestamp and switch. Consolodate methods to parent class.

* Cap next_cycle at 2 years to prevent time overflow.

* Addressed review comments.

* Updated DEVICE_MAP and icon() based on review comments.
2020-06-21 16:55:47 -05:00
Andrew Hayworth
fed6625324
Refactor / update Awair integration (#34394)
* Refactor / update Awair integration

This commit does a few things, all in service of making the Awair
integration more modern and reliable. Specifically we do the following:

- Update to python_awair 0.1.1
- Begin using config entries / flow for setting up the integration.
  - YAML support is completely removed.
  - The integration now allows adding multiple Awair accounts, should a
    user wish to do so (I found it _very_ useful in development).
- Group various Awair sensors into devices, using the device registry.
- Renames various sensors and treats the "dust" sensor as a particulate sensor.
- Device update rate-limits are no longer dynamically calculated; the
  Awair API now separates rate-limits on a per-device basis.
- Supports sound pressure and illuminance sensors found on some Awair devices.
- We report the "awair index" for certain sensors as part of device_state_attributes.
  The "index" is a subjective measure of whether or not a sensor reading
  is "good" or "bad" (and to what extent). It's a component of the Awair
  score, and it is useful on its own as an input for those who wish to
  do things like "display this color if the value is 'bad'".

This is a breaking change, and requires updates to documentation and a
warning in the README. The breaking changes in detail, are:

- Support for all YAML configuration is removed, and users will need to
  re-add the integration via the UI.
- We no longer support overriding device discovery via manual
  configuration of device UUIDs. This was previously supported because
  the Awair API had severe limits on the device list endpoints; however
  those have since been removed.
- Gen 1 devices no longer show a "dust" sensor; rather we create a PM2.5
  sensor and a PM10 sensor and just keep the values in sync. This better
  reflects the sensor capabilities: it can detect particles in a range
  from 2.5 -> 10, but cannot differentiate between sizes.
- Sensors are renamed as follows:
  - "sensor.devicename_co2"   -> "sensor.devicename_carbon_dioxide"
  - "sensor.devicename_voc"   -> "sensor.devicename_volatile_organic_compounds"
  - "sensor.devicename_score" -> "sensor.devicename_air_quality_index"
  - I've chosen to call the "Awair Score" an "air quality index" sensor,
    because fundamentally the "Awair Score" and other air quality indices
    (such as CAQI) do the same thing: they calculate a value based on a
    variety of other inputs.

Under the hood, the integration has seen some improvements:

- We use the DataUpdateCoordinator class to handle updates, rather than
  rolling our own update class.
- The code no longer tracks availability based on a timestamp returned
  from the Awair service; we assert that if we have received a response
  and the response has data for our device, then we are available (and
  otherwise, not available). We don't need to test the actual Awair API
  so heavily.
- Test coverage has been expanded to handle a variety of products that
  Awair produces, not just the one I happen to own.
- Test coverage no longer concerns itself with testing behavior that is
  now handled by the DataUpdateCoordinator; nor is it concerned with
  ensuring that the overall component sets up and registers properly.
  These are assumed to be well-tested functionaity of the core and not
  things we need to re-test ourselves.

Finally - between library updates and integration updates, this
integration is well-positioned to support future updates. I have a
proof-of-concept patch for device automations, and the underlying
library now supports subclassing authentication (which clears the way
for us to use OAuth authentication for Awair).

* Wrap test fixture in mock_coro

Truthfully I'm not sure why this was passing on my local dev
environment, but I was developing with python 3.8 before. After
installing python 3.7, I was able to reproduce the CI failures and fix
them.

* Fix broken tests after #34901 and/or #34989

* Do not rename sensors so broadly

We're going to keep the sensors named as they were before, pending the
outcome of any decisions around the air_quality component and what names
should be standardized for air-quality-like devices.

If standardized names are selected (which does seem likely), then we
will update this integration to match them - at which point, it would be
a breaking change.

But for now, we'll keep names mostly identical to what users had before.

Notable in this commit is that we generate the entity_id ourselves,
rather than just allowing it to be auto-generated from the name
attribute. This allows us to provide more human friendly names, while
keeping the old format for entity ids. For example, given an Awair
device called "Living Room", we'll generate an entity id of
"sensor.living_room_voc" but show set the name of the device to "Living
Room Volatile organic compounds".

* Support import from config.yaml

We'll create a config entry from config.yaml the first time we're
loaded, and then defer to it from then on.

We ignore all keys other than the access_token, since we no longer need
to deal with per-account rate-limits (rather, everything is per-device
now).

* Add myself to CODEOWNERS

Since I wrote the initial integration, and now this re-write, it feels
appropriate for me to take care of the integration along with `danielsjf`.

* Remove name mangling

* Update homeassistant/components/awair/manifest.json

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

* Update homeassistant/components/awair/config_flow.py

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

* Update homeassistant/components/awair/sensor.py

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

* Update homeassistant/components/awair/sensor.py

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

* Address some review feedback

* Set up reauth flow in a job, rather than awaiting

* Remove unnecessary title string

* Remove unnecessary config schema checking

As pointed out in review, because this comes in via import from
`configuration.yaml`, we can rely on the `PLATFORM_SCHEMA` validation instead.

* Fix tests

* Set unique_id appropriately for legacy devices

For users who have had this integration already installed (and who have
updated their home assistant installation sometime in recent history),
we want to ensure that unique_id's are set to the same thing as before,
to facilitate the upgrade process.

To do that, we add an additional property to the `SENSOR_TYPES` dict
(`ATTR_UNIQUE_ID`) which allows us to map modern sensor names from
python_awair to what older versions called them - ie: `humidity` ->
`HUMID`. We then use that value when constructing the unique ID. This
should allow users to upgrade and not lose configuration even if entity
IDs would otherwise change (because we have changed the name format that
generates entity IDs).

One note is that for the gen1 `DUST` sensor, we have to treat it
differently. This integration used to call that a "PM2.5" sensor, but
the unique_id generated would be something like `awair_12345_DUST`. So
we special-case that sensor, and do the same thing. We do not need to
special-case the PM10 sensor for gen1 devices, because we didn't create
a PM10 sensor in the past (we do now, because the "DUST" sensor is
really a hybrid PM2.5/PM10 sensor).

* Patch async_setup_entry for two tests

* Update awair config_flow to require / use an email address for unique_id

Also, only start one re-auth flow.

* Add a few more tests, try to get coverage up.

* Add another test

* Move attribution to device_state_attributes

* Don't require email

* Switch from Union[dict, None] to Optional[dict]

* Use a mock where requested

* Fix missing constant rename

* Use async_create_task

* Bump test coverage a bit for config_flow

* s/CONF_UNIQUE_ID/UNIQUE_ID/g

* Add warning about deprecated platform config

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-06-21 21:46:07 +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
Adam Belebczuk
fe03c9da68
Update Wemo state when changing state (#36647) 2020-06-16 21:14:04 +02:00
Ian Harcombe
c96458c7e4
Convert MetOffice to use UI for configuration (#34900)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-06-15 12:02:25 +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
Rami Mosleh
2c1a76cf92
Add Speedtestdotnet config_flow (#36254) 2020-06-10 18:33:48 +02:00
Anton Tolchanov
0bf64e9a2c
Add @knyar as a codeowner for prometheus integration (#36487) 2020-06-05 21:29:06 +02: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
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
Fabian Peter Hammerle
8ccdaf2927
Add huawei_lte sensor for number of unread sms (#35665) 2020-06-03 11:59:06 +02:00
Franck Nijhof
e5d81aeb2a
Remove gearbest integration (ADR-0004) (#36347) 2020-06-01 17:43:20 +02:00
Emilv2
0ae23fa166
Remove duplicate information in delijn sensor (#36276) 2020-05-31 10:02:56 -05: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
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
Anders Melchiorsen
275c8b6982
Update sonos codeowners (#36016) 2020-05-23 11:08:01 +02:00
John Hollowell
f74e2f8abb
Update proxmoxer to 1.1.0 (#35951) 2020-05-22 22:53:17 +02:00
Tom Harris
dbd821a564
Change Insteon backend module to pyinsteon from insteonplm (#35198)
* Migrate to pyinsteon from insteonplm

* Rename devices entities

* Print ALDB even if not loaded

* Add relay to name map

* Change insteonplm to pyinsteon

* Update requirements_all correctly

* Code review updates

* async_set_speed receive std speed value

* default speed to std medium value

* Call async methods for fan on/off

* Comment await required in loop

* Remove emtpy and add codeowner

* Make services async and remove async_add_job call

* Remove extra logging

* New device as async task and aldb load in loop

* Place lock in context bloxk

* Limiting lock to min

* Remove .env file
2020-05-17 15:27:38 +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
Aaron Bach
c9b702c4c2
Remove Automatic integration (#35029) 2020-05-14 11:24:22 +02:00
Xiaonan Shen
ce99fa8c02
Add config flow to pi_hole integration (#35442)
* Add config flow to pi-hole

* Add config flow tests

* Change PlatformNotReady to ConfigEntryNotReady

* Improve config flow

* Add @shenxn as codeowner

* Use entity_id as unique id

* Remove .get with [] for required fields

* Remove unique id from config flow

* Replace some strings with references

* Fix api_key string

* Fix service api_key check

* Remove unused DuplicatedNameException
2020-05-13 09:25:06 -04:00
uvjustin
c41fb2a21f
Add forked_daapd integration (#31953)
* New forked_daapd component

* Bunch of changes

Add config flow and zeroconf
Add zones on callback when added by server
Add password auth
Add async_play_media for TTS
Add media_image_url
Add support for pipe control/input from librespot-java
Improve update callbacks

* Refactor as per code review suggestions

Move config_flow connection testing to pypi library (v0.1.4)
Remove use of ForkedDaapdData class
Decouple Master and Zone data and functions
Add updater class to manage websocket and entity updates

* More changes as per code review

Avoid direct access to entities in tests
Bump pypi version
Mark entities unavailable when websocket disconnected
Move config tests to test_config_flow
Move full url creation from media_image_url to library
Move updater entity from master to hass.data
Remove default unmute volume option
Remove name from config_flow
Remove storage of entities in hass.data
Use async_write_ha_state
Use signal to trigger update_options
Use unittest.mock instead of asynctest.mock

* Yet more changes as per code review

Add more assertions in tests
Avoid patching asyncio
Make off state require player state stopped
Only send update to existing zones
Split up some tests
Use events instead of async_block_till_done
Use sets instead of lists where applicable
Wait for pause callback before continuing TTS

* Remove unnecessary use of Future()

* Add pipes and playlists as sources

* Add support for multiple servers

Change config options to add max_playlists+remove use_pipe_control
Create Machine ID in test_connection and also get from zeroconf
Modify hass.data storage
Update host for known configurations
Use Machine ID in unique_ids, entity names, config title, signals

* Use entry_id as basis for multiple entries

* Use f-strings and str.format, abort for same host

* Clean up check for same host
2020-05-13 09:13:41 -04: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
Emily Mills
306f15723d
Add Zerproc integration (#35477) 2020-05-13 00:26:44 +02:00
ollo69
b3ee54b124
Add config flow for Tuya (#35422)
* Added Tuya config flow

* Added test config_flow

* Fixed log error message

* Add test requirements

* Lint Fix

* Fix Black formatting

* Added pylint directive

Added pylint:disable=unused-import in config_flow.py

* Implementation requested changes

* Update CodeOwners

* Removed device registry cleanup

* Force checks

* Force checks

* Fix implemetation

- Set config schema "deprecated"
- Removed async from update_callback

* Updating test

* Fix formatting

* Config Flow test fix

- mock out async_setup and async_setup_entry

* Fix formatting
2020-05-10 22:01:00 -05:00
Daniel Høyer Iversen
e4263afd64
Open garage, move code to an external library. (#35462)
* Move opengarage code to separate library

* Move opengarage code to separate library

* Move opengarage code to separate library

* remove unique_id

* style
2020-05-10 14:30:16 -05: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
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
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
Robert Svensson
ddd6b9cff1
Capitalize kane610 in codeowners since scripts are case sensitive (#35375) 2020-05-08 14:14:10 +02:00
Markus Bong
5e33842ce0
Add devolo home control (#33181) 2020-05-07 16:08:51 +02: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
gadgetmobile
8e071b69f4
Add BleBox integration (#32664)
Co-Authored-By: J. Nick Koston <nick@koston.org>
2020-05-05 11:29:58 +02:00
David Straub
86d410d863
Add Home Connect integration (#29214) 2020-05-05 11:26:14 +02:00
shbatm
4be1006b71
ISY994 migration to PyISY v2 (Structure Changes to enable upgrade, Part 1) (#35212)
* ISY994 Structure updates in prep for PyISYv2 (Part 1)

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

* Update categorize_programs per review

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

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

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

* Refactor numato configuration due to PR finding

* Resolve minor review findings

* Bump numato-gpio requirement

* Load numato platforms during domain setup

According to review finding

* Guard from platform setup without discovery_info

According to review finding

* Move numato API state into hass.data

According to review finding.

* Avoid side effects in numato entity constructors

According to review finding

* Keep only first line of numato module docstrings

Removed reference to the documentation. Requested by reviewer.

* Minor improvements inspired by review findings

* Fix async tests

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

* Improve test coverage

* Configure GPIO ports early

Review finding

* Move read_gpio callback to outside the loop

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

* Bump numato-gpio requirement

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

* Call services directly

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

* Assert something in every test

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

* Clarify scope of notification tests

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

* Test for hass.states after operating switches

Resolves a review finding.

* Check for wrong port directions

* WIP: Split numato tests to multiple files

test_hass_binary_sensor_notification still fails.

* Remove pytest asyncio decorator

Apears to be redundant. Resolves a review finding.

* Call switch services directly.

Resolves a review finding.

* Remove obsolete inline pylint config

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

* Improve the numato_gpio module mockup

Resolves a review finding.

* Remove needless explicit conversions to str

Resolves review findings.

* Test setup of binary_sensor callbacks

* Fix test_hass_binary_sensor_notification

* Add forgotten await

Review finding.

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

* ignore

* generated

* Update .gitignore

* requirements update

* update coveragerc

* Revert "update coveragerc"

* make entity_types more readable

* add DOMAIN to listener

* entity name

* Use DataUpdateCoordinator

* fix translations

* enable preset_modes

* fix water_heater

* update coveragerc

* remove scan_interval

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

* Apply suggestions from code review

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

* fixes review remarks

* fix flake8 errors

* ensure correct HVACmode

* add away mode

* use write_ha_state instead of refresh

* remove OFF support, add Fahrenheit

* rename test_config_flow.py

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

* Add Islamic Prayer Times config_flow

* handle options update and fix tests

* fix sensor update handling

* fix pylint

* fix scheduled update and add test

* update test_init

* update flow options to show drop list

* clean up code

* async scheduling and revert state to timestamp

* fix update retry method

* update strings

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

* Replace async_add_job with async_add_executor_job in roomba

* Improve readability in roomba

* Improve error handling in roomba

* Cleanup async_update in roomba

* Split into multiple files in roomba

* Hide protocal details in braava

* Switch to push in braava

* Bump roombapy version to 1.5.1

* Add roomba files to .coveragerc

* Fix typo

* Remove side effects from init in roomba

* Implement StateVacuumDevice in Roomba

* Add IRobotEntity base class to braava

* Fix state in roomba

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

* Updating .coveragerc

* Removing testplatform

* Updating strings.json

* Commit before rebase

* Commit before rebase

* Commit before rebase

* Commit before rebase

* Commit before rebase

* Adding tests and stuff

* Fixing permission issues

* Ignoring Pylint warnings

* Fixing one more Pylint warning

* Refactoring

* Commiting changes - part 1

* Commiting changes: part 2

* Turning unknown error logs into exception logs

* Update strings.json

* Rebasing

* Updating the panasonic_viera component

* Removing testplatform

* Updating strings.json

* Commit before rebase

* Commit before rebase

* Commit before rebase

* Commit before rebase

* Commit before rebase

* Adding tests and stuff

* Fixing permission issues

* Ignoring Pylint warnings

* Fixing one more Pylint warning

* Refactoring

* Commiting changes - part 1

* Commiting changes: part 2

* Turning unknown error logs into exception logs

* Adding pt-BR translation

* Removing Brazilian Portugues translations

* Modifying error handling

* Adding SOAPError to except handling

* Updating translation

* Refactoring async_step_import

* Fixing indentation

* Fixing requirements after rebase

* Fixing translations

* Fixing issues after rebase

* Routing import step to user step

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

* Return name of device and update version of arris_tg2492lg

* Update CODEOWNERS, requirements_all.txt and .coveragerc

* Change default url to host

* Use f-strings

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

* Clean up

* Fix formatting

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

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

* Improvement strings

* Fix FlowOptions update listener

* Update .ceveragerc

* Add tests

* Better strings

* Add test for OptionsFlow

* Run gen_requirements_all.py once again

* Fix pylint errors

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

* Improvement strings

* Use braviarc object from hass.data in options flow

* Use async_add_executor_job for IO

* Fix options flow test

* Fix tests

* Remove host_reachable method

* Remove dependencies

* Change setup_platform method to async

* Remove calling system_info

* Save mac in the config entry

* Fix get ignore sources

* Fix read config from file

* Remove the side effect from init

* Fix user_input for user step

* Switch OrderedDict to dict

* New config_entry instance for each test

* Revert change

* Patch async_setup_entry in test_import

* Change a way to create source list

* Consolidate repeated block of code

* Update tests

* Suggested change

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

* Suggested channge

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

* Suggested change

* Patch async_setup_entry

* Remove unnecesary if

* suggested change

* Suggested change

* Fix tests

* Fix pylint error

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

* Increase instant_power precision to 3

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

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

* remove excess debug

* Fix lock and light tests

* Ensure all code for Thermostats has coverage

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

* Make lock notifications reliable

* Update homeassistant/components/homekit/type_lights.py

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

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

* Get options to connect

* Fix options in config flow

* Fix syntax in config_flow

* Remove name (not necessary)

* Add bin sensor

* Add Battery sensor

* Add async_connect

* Fix typo

* Add Model and Software version

* Update Roombapy 1.5.0

* Add validate_input

* Add connect and disconnect functions

* Remove test config flow

* Add variables after loop

* Fix translate

* Fix typo

* Fix state of bin

* Update homeassistant/components/roomba/__init__.py

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

* Update homeassistant/components/roomba/config_flow.py

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

* Update homeassistant/components/roomba/config_flow.py

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

* Update homeassistant/components/roomba/config_flow.py

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

* Update homeassistant/components/roomba/config_flow.py

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

* Update homeassistant/components/roomba/config_flow.py

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

* Update homeassistant/components/roomba/__init__.py

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

* Update homeassistant/components/roomba/__init__.py

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

* Update homeassistant/components/roomba/__init__.py

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

* Update homeassistant/components/roomba/config_flow.py

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

* Remove invalid auth

* Add call function reported_state

* Add options reload

* Fix tracelog

* Set entry_id for config_entry

* Fix DOMAIN unsed-import

* Update homeassistant/components/roomba/config_flow.py

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

* Update homeassistant/components/roomba/config_flow.py

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

* Add unique_id for entry

* Fix device info

* Add config_flow for roomba

* Get options to connect

* Fix options in config flow

* Fix syntax in config_flow

* Remove name (not necessary)

* Add bin sensor

* Add Battery sensor

* Add async_connect

* Fix typo

* Add Model and Software version

* Update Roombapy 1.5.0

* Add validate_input

* Add connect and disconnect functions

* Remove test config flow

* Add variables after loop

* Fix translate

* Fix typo

* Fix state of bin

* Update homeassistant/components/roomba/__init__.py

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

* Update homeassistant/components/roomba/config_flow.py

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

* Update homeassistant/components/roomba/config_flow.py

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

* Update homeassistant/components/roomba/config_flow.py

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

* Update homeassistant/components/roomba/config_flow.py

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

* Update homeassistant/components/roomba/config_flow.py

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

* Update homeassistant/components/roomba/__init__.py

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

* Update homeassistant/components/roomba/__init__.py

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

* Update homeassistant/components/roomba/__init__.py

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

* Update homeassistant/components/roomba/config_flow.py

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

* Remove invalid auth

* Add call function reported_state

* Add options reload

* Fix tracelog

* Set entry_id for config_entry

* Fix DOMAIN unsed-import

* Update homeassistant/components/roomba/config_flow.py

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

* Update homeassistant/components/roomba/config_flow.py

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

* Add unique_id for entry

* Fix device info

* syntax for mac (pyupgrade)

* Change single key to BLID

* Resolve dict conflict

* Update homeassistant/components/roomba/binary_sensor.py

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

* Update homeassistant/components/roomba/sensor.py

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

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

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

* Update homeassistant/components/roomba/strings.json

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

* Add description

* Revert "Remove test config flow"

This reverts commit 26a89422e8.

* Add tests

* Remove check if user none

* Replace CONF_USERNAME to CONF_BLID (breaking change)

* Update test_config_flow.py

* Add code owners

* Remove CONF_USERNAME (unused)

* Add multiple vacuum

* Add multiple vacuum

* Update homeassistant/components/roomba/__init__.py

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

* Update homeassistant/components/roomba/__init__.py

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

* Update homeassistant/components/roomba/__init__.py

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

* Update homeassistant/components/roomba/__init__.py

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

* Update homeassistant/components/roomba/__init__.py

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

* Fix syntax name

* Update homeassistant/components/roomba/__init__.py

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

* Update homeassistant/components/roomba/__init__.py

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

* Update homeassistant/components/roomba/__init__.py

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

* Update homeassistant/components/roomba/__init__.py

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

* Remove CONF_PREFIX (unused)

* Update homeassistant/components/roomba/sensor.py

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

* Add import UNIT_PERCENTAGE

* Update homeassistant/components/roomba/__init__.py

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

* Update homeassistant/components/roomba/__init__.py

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

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

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

* Update to 0.4.0 to resolve the blocking startup issue

* Missed conversion to FlumeAuth

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

* workaround async_add_entities updating disabled entities

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

* Correction for black failure

* Correction for black failure

* Fix for manifest.json

* Fix for flake8 fault missing a period

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

* WIP virtual thermostat

* WIP virtual thermostat

* WIP

* 100% tests coverage

* Manifest, codeowners, typo fix

* Lint problem

* Test file blacked

* Add a test case for b4dpxl's question

* Update CODEOWNERS

* Replacement of generic thermostat

* Cleaning

* Lint

* More lint

* Using external PyPI package, removed get()

* Fix flake8 checks

* removed virtual thermostat

* Re-fix black & isort

* Re-fix isort 2

* Update homeassistant/components/pi4ioe5v9xxxx/binary_sensor.py

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

* Update homeassistant/components/pi4ioe5v9xxxx/binary_sensor.py

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

* Update homeassistant/components/pi4ioe5v9xxxx/switch.py

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

* Update homeassistant/components/pi4ioe5v9xxxx/switch.py

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

* Update homeassistant/components/pi4ioe5v9xxxx/switch.py

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

* Update homeassistant/components/pi4ioe5v9xxxx/switch.py

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

* black for switch

* update to latest version manual merge

* Delete test_generic_thermostat.py

* Delete .gitignore

* Delete climate.py

* Delete manifest.json

* Delete test_climate.py

* Delete test_climate.py

* fix thermostat interference

* fix thermostat interference 2

* Fix pylint

* Update .pre-commit-config.yaml

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

* Use proper sensor unique ID from flow + sensor name

* Add description to api_version

* Add authentication flow check

* Add device_info

* Add test_login_failed test

* Bump python-synology to 0.5.0

* 0.5.0 test updates

* Use NAS S/N as config_flow unique_id

* Add missed conf disks + volumes

* Review: async_unload the async_track_time_interval

* Fix NoneType for disks or volumes

* Keep all disks and volumes forever

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

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

* Update homeassistant/components/synology_dsm/strings.json

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

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

* Fix prettier

* Remove useless LOGGER in config flow

* Fix Synology DSM tests doing I/O

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

* Added unit tests

* Linter fixes, better friendly_name handling

* Increase coverage

* Review fixes

* fixup! Review fixes

* Refactor to use external openerz-api library

* fixup! Refactor to use external openerz-api library

* fixup! Refactor to use external openerz-api library

* fixup! Refactor to use external openerz-api library

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

* Fixing lint error.

* Applying minimal changes necessary to get config entries working.

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

* Addressing PR feedback.

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

* Updating code owners file.

* Small fixes.

* Adding a user config flow step.

* Adding optional configs for user config flow.

* Updating strings to be more clear to the user.

* Adding options flow.
Fixing some PR feedback.

* Better handling of options.
PR feedback changes.

* Using config registry to update config options.

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

* Address PR feedback.

* Fixing test, merging with master.

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

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

* Rebasing off dev.
Addressing feedback.

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

* Add a test for importing

* lint

* Address review items (part 1)

* Address review items (part 1)

* Cleanup unique id handling

* Update tests for new naming scheme

* No unique id, no device_info

* Remove sensor types

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

* Create manifest.json

* Update zeroconf.py

* more work on integration

* more work on integration.

* add more sensor tests.

* Update const.py

* Update sensor.py

* more work on ipp.

* Update test_config_flow.py

* more work on ipp.

* Update config_flow.py

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

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

* Write state instead of calling for an update

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

* stale string

* add missing undos to dispachers

* remove unneeded hass

* naming

* rearrange

* fix water heater, add test

* fix water heater, add test

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

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

updated core/requirement*txt

* updated core/CODEOWNERS

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

* modbus: change core connection to async

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

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

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

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

* modbus: move setup of pymodbus into modbushub

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

Delay construction of pymodbus client until event
EVENT_HOMEASSISTANT_START arrives.

* modbus: use pymodbus async library

convert pymodbus calls to refer to the async library.

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

* modbus: use async update for read/write

Use async functions for read/write from pymodbus.

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

* Modbus: patch for slow tcp equipment

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

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

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

* Modbus: silence pylint false positive

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

* Modbus: move constants to const.py

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

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

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

Also correct the tests.

* Modbus: move connection error handling to ModbusHub

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

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

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

* Modbus: CI cleanup

Solve CI problems.

* Modbus: remove close of client

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

* Modbus: correct review comments

Adjust code based on review comments.

* Modbus: remove twister dependency

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

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

* Modbus: review, remove comments.

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

* Renamed `_glowIntensity` to `_glow_intensity`

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

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

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

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

* restore _has_all_unique_prefixes

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

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

* Fix for manifest issue on build
Removed unnecessary configurator logic

* Flake8 & ISort issues fixed

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

* Work started on Update Coordinator

* Further Coordinator work

* Update to DataUpdateCoordinator complete

* Flake8 fix

* Removal of unnecessary SchluterPlatformData
Coordinator also now using SCAN_INTERVAL

* Disable polling, use coordinator listeners

* Isort on climate.py

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

* Switch to HVAC action for showing current heating status

* Isort fix

* HVAC Mode return list, set_hvac_mode function added

* __init__.py modifications from code review

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

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

* Linting

* Update homeassistant/components/schluter/climate.py

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

* Update homeassistant/components/schluter/climate.py

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

* Changed timeout from config, load platform discover to None

* Proposed change for discover info issue

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

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

* bring up to date

* add codeowner

* update requirements

* overhaul data imports from api & sensor discovery

* remove print statement

* delete requirements_test_all

* add requrements_test_all.txt

* Update homeassistant/components/nextcloud/sensor.py

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

* Update homeassistant/components/nextcloud/sensor.py

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

* describe recursive function

* clarify that dict is returned

* remove requirements from requirements_test_all

* improve and simplify sensor naming

* add basic tests

* restore pre-commit config

* update requirements_test_all

* remove codespell requirement

* update pre-commit-config

* add-back codespell

* rename class variables as suggested by @springstan

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

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

* move config logic to __init__.py

* restore .pre-commit-config.yaml

* remove tests

* remove nextcloud test requirement

* remove debugging code

* implement binary sensors

* restore .pre-commit-config.yaml

* bump dependency version

* bump requirements files

* bump nextcloud reqirement to latest

* update possible exceptions, use fstrings

* add list of sensors & fix inconsistency in get_data_points

* use domain for config

* fix guard clause

* repair pre-commit-config

* Remove period from logging

* include url in unique_id

* update requirements_all.txt

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

* Fixed linting errors

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

* Update homeassistant/components/bmp280/manifest.json

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

* Update homeassistant/components/bmp280/sensor.py

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

* Fix linting errors

* Implemented changes suggested by code review

* Fixed incomplete refactoring

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

* Discoverable via zeroconf

* Fix zeroconf test

* add missing return

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

* Update homeassistant/components/doorbird/__init__.py

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

* without getting the hooks its not so useful

* Update homeassistant/components/doorbird/config_flow.py

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

* fix copy pasta

* remove identifiers since its in connections

* self review fixes

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

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

* black formatting

* Update requirements_all.txt

* Apply black formatting

* Resolve some review comments

* serial -> unique_id

* Black formatting

* Resolve linting errors

* Add code owner...

* Fix isort complaint

* Fix remaining isort complaints

* Update codeowners

* Resolve outstanding review comments

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

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

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

* Implement missing set_hvac_mode for nuheat

* Now shows as unavailable when offline

* Add a unique id (serial number)

* Fix hvac_mode as it was really implementing hvac_action

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

* ThermostatModel: scheduleMode

* Revert test cleanup as it leaves files behind.

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

* Config flow for nuheat

* codeowners

* Add an import test as well

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

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

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

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

* Update requirements and add to codeowners

* Avoid passing in hass as a parameter to the entity

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

* Fix lint issues

* Add tests for config & options flow

* Add tests for manual yaml config

with entity definition as integration and also as a sensor platform

* Fix placement of PLATFORM_SCHEMA and update generated config_flows

* Store prices internally linked to UTC timestamps

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

* Add availability to sensor

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

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

* Add more tests

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

* fix linter

* Better handling of sensor availability and minor enhancements

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

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

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

* Change API endpoint to retrieve JSON data

and remove xmltodict from reqs.

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

* Adapt tests to new API endpoint

* Translate tariff labels to plain English

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

* Relax logging levels to meet silver requirements

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

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

* Fix requirements

* Mod tests to work with timezone Atlantic/Canary

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

* Try to fix CI tests

* Externalize pvpc data and simplify sensor.py

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

* Simplify tests for pvpc_hourly_pricing

* Fix updater for options flow

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

* Fix lint

* Bump aiopvpc

* Remove options flow and platform setup

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

* Fix docstring on test

and rename SENSOR_SCHEMA to SINGLE_SENSOR_SCHEMA to avoid confusion

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

* Simplify tests

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

* Fix possible duplicated update

when source is not available.

* Do not access State last_changed for log messages

* Do not update until entity is added to hass

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

* minor changes

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

* Discovered by homekit

* Fix gates being treated as garage doors

* Offline devices now show as unavailable

* Homekit flow

* strip out icon

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

* Restore original work

* Merge cleanups

* config flow

* Add config flow

* Add missing files

* Fix import of old yaml config

* More cleanups from self review

* Additional self review

* Update homeassistant/components/nexia/services.yaml

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

* fix io in event loop

* Update homeassistant/components/nexia/climate.py

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

* avoid using ternary statements if they span multiple

* Cleanup strings and remove unneeded attributes

* more cleanup

* more cleanup of yaml

* remove coordinator boiler plate

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

* remove copy pasta

* this can be reduced more

* Update homeassistant/components/nexia/config_flow.py

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

* Update homeassistant/components/nexia/config_flow.py

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

* Update homeassistant/components/nexia/__init__.py

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

* Update homeassistant/components/nexia/__init__.py

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

* Update homeassistant/components/nexia/__init__.py

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

* Update homeassistant/components/nexia/__init__.py

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

* review

* comments

* Update homeassistant/components/nexia/climate.py

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

* Update homeassistant/components/nexia/climate.py

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

* Update homeassistant/components/nexia/climate.py

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

* more review adjustments

* nuke unused constants

* Update homeassistant/components/nexia/config_flow.py

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

* map states

* add update

* zone id is unique

* Fix humidfy check

* target_humidity should be a property instead of in attributes

* remove aux heat as its already there

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

* Fixes unique ids when using XMPP

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

* Find the unique id for the config flow

* move shutdown to init

* Add test for ssdp (still failing)

* Fix ssdp test

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

* more cleanups

* use unique id for the config file

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

* Self review :: remove unused code

* Remove debug

* Update homeassistant/components/powerwall/__init__.py

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

* _call_site_info to module level

* Update homeassistant/components/powerwall/binary_sensor.py

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

* Update homeassistant/components/powerwall/sensor.py

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

* Update homeassistant/components/powerwall/binary_sensor.py

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

* Update homeassistant/components/powerwall/binary_sensor.py

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

* Update tests/components/powerwall/test_binary_sensor.py

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

* Update homeassistant/components/powerwall/binary_sensor.py

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

* Update homeassistant/components/powerwall/binary_sensor.py

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

* remove sensors that I added tests for from the comment

* Update homeassistant/components/powerwall/config_flow.py

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

* Update homeassistant/components/powerwall/sensor.py

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

* Update homeassistant/components/powerwall/sensor.py

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

* Update homeassistant/components/powerwall/sensor.py

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

* Switch to UNIT_PERCENTAGE

* reduce code

* Add test for import

* Adjust tests

* Add missing file

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

* rm unnecessary f strings

* add code_arm_required config option

* add self as codeowner :-)

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

* Throttle updates to max once per 30s

* Change code owner

* Fix CODEOWNERS + linting

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

* Add config flow for rachio

Also discoverable via homekit

* Update homeassistant/components/rachio/switch.py

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

* Split setting the default run time to an options flow

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

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

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

Breakout the slew of exceptions rachiopy can throw into RachioAPIExceptions

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

Switch identifer for device_info to serial number

Add connections to device_info (mac address)

* rename to make pylint happy

* Fix import of custom_url

* claim rachio

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

* Add manufacturer in device_tracker info

* Add device_info to sensor + switch

* Add device_info: connections

* Add config_flow test + update .coveragerc

* Typing

* Add device_type icon

* Remove one error log

* Fix pylint

* Add myself as CODEOWNER

* Handle sync in one place

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

* Add link step to config flow

* Make temperature sensors auto-discovered

* Use device activity instead of reachablility for device_tracker

* Store token file in .storage

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

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

* Add sensor should_poll=False

* Test typing

* Handle devices with no name

* None is the default for data

* Fix comment

* Use config_entry.unique_id

* Add async_unload_entry with asyncio

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

* Review

* Remove useless "already_configured" error string

* Review : merge 2 device & 2 sensor classes

* Entities from platforms

* Fix unload + add device after setup + clean loggers

* async_add_entities True

* Review

* Use pathlib + refactor get_api

* device_tracker set + tests with CoroutineMock()

* Removing active & reachable from tracker attrs

* Review

* Fix pipeline

* typing

* typing

* typing

* Raise ConfigEntryNotReady when HttpRequestError at setup

* Review

* Multiple Freebox s

* Review: store sensors in router

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

* Griddy is a wholesale power provider in Texas

* Supports all four load zones in Texas

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

* Update homeassistant/components/griddy/sensor.py

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

* Update homeassistant/components/griddy/config_flow.py

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

* Add ability request updated via entity update service.

* Improve error message about already configured

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

* remove setdefault that was left from previous refactor

* More detail on data naming

* Bump translation for testing

* git add the config flow tests

* s/PlatformNotReady/ConfigEntryNotReady/

* Review items

* git add the other missing file

* Patch griddypower

* reduce

* adjust target

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

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

* Fix home and away presets

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

* Write state instead of calling for an update

* adjust codeowners

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

* Guards are much cleaner

* Adjust per review

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

* Update requirements_all.txt

* Create manifest.json

* Add files via upload

* add codeowner

* add codeowner.

* Update sensor.py

* Update sensor.py

* remove unused import.

* Update manifest.json

* Update sensor.py

* modify requirements_all.txt.

* order imports.

* Update sensor.py

* Use DataUpdateCoordinator rewrite code

* set should_poll to False

* remove unused code 'serial'.

* add available prop

* Update homeassistant/components/iammeter/sensor.py

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

* Update homeassistant/components/iammeter/sensor.py

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

* Update homeassistant/components/iammeter/sensor.py

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

* Update homeassistant/components/iammeter/sensor.py

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

* Update homeassistant/components/iammeter/sensor.py

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

* Update homeassistant/components/iammeter/sensor.py

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

* Update sensor.py

* Update sensor.py

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

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

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

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

* Update sensor.py

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

* Modified approach with new configuration item

* Removed new config item

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

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

If approved, documentation will be updated.

* Update homeassistant/components/emoncms/sensor.py

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

* Update homeassistant/components/emoncms/sensor.py

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

* Apply suggestions from code review

* Apply suggestions from code review v2

* Update homeassistant/components/emoncms/sensor.py

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

* Update sensor.py

Update `config_unit`

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

* edl21: Remove unused variable

* [edl21] Add 1 minute throttle to the sensor

* Update homeassistant/components/edl21/manifest.json

Fix documentation URL

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

* edl21: Move imports to top

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

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

* edl21: Make blacklist global

* edl21: Add filter to issues URL

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

* edl21: Rename device to entity

* edl21: Don't schedule async_add_entities

* edl21: Use dispatcher, implement own throttling mechanism

* edl21: Simplify keeping track of known obis

* edl21: Use whitelist for state attributes

* edl21: Remove dispatcher on shutdown

* edl21: Convert state attributes to snakecase

* edl21: Annotate handle_telegram with @callback

* edl21: Call async_write_ha_state instead of schedule_update_ha_state

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

* Create const file.  Load camera from component.

* Handle failed authentication.  Bump library version.

* Remove line break

* Camera attributes and recording services

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

* Update codeowners

* Update coveragerc

* Remove codeowners line

* Update codeowners again from python3 -m script.hassfest

* Update homeassistant/components/qvrpro/__init__.py

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

* Requested changes

* Fix typo

* Update to use exception. Bump library version.

* Support stream component

* Update module header

* Missing property wrapper

* Partial requested changes

* Update coveragerc and codeowners

* Move constants to const file.  Add SHORT_NAME

* Add conf variable

* Use camera domain

* More requested changes

* Requested changes

* Requested changes

* Update prefix

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

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

* Move auth string to library to prevent private member access

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

* Update homeassistant/components/coronavirus/manifest.json

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

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

Parse configuration, but return a fixed value

* Add basic functionality

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

* Update values regularly

The tankerkoenig values get updated regularly with real data.

* Move base functionality for the sensor to a base class

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

* Reduce calls to tankerkoenig api

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

* Update requirements files

* Update all gas stations at once

* Remove tests directory

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

* Fix slaves not being updated

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

* Refactor entity creation

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

* Add possibility to manually add stations

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

* Fix style issues

Make the code more pythonic

* Remove redundant code

Implement suggestions from the code review

* Change to platform component

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

* Rename ATTR_STATE

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

* Minor updates

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

* Separate address into different fields

* Style updates

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

* Implement review comments

Fix style issues
Improve error messages
Remove redundant options

* Refactor using DataUpdateCoordinator

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

* Implement PR comments

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

* Apply black formatting

* Update manifest

* Add requirements

* Add sensor to coverage

* Update import order

* Bump dependency to include todays pickup

* Bump avri version in requirements_all.txt

* Code review comments

* Reduce scan interval to 4 hours

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

* Better logging

* Made scan interval a timedelta

* Fix import order

* Update homeassistant/components/avri/sensor.py

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

* Update homeassistant/components/avri/sensor.py

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

* Use filter instead of break statement

* Use positive int for house number extension

* Switch voluptuous types for house number and house number extension

* Update homeassistant/components/avri/sensor.py

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

* Implement `available`

* Bump avri api

* Code review comments

* Replace `postcode` with `zip_code`

* Update logic for `available`

* Remove variable for delimiter

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

* New platform: Ezviz

* updated CODEOWNERS for ezviz

* proper test requirements

* resolved conflict

* regenerated requirements

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

* setup is sync, not async. Removed stale comments

* Compatible with pyezviz 0.1.4

* pyezviz 0.1.4 is now requiredf

* Added PTZ + switch management

* added services.yaml

* proper requirement

* PTZ working in async mode

* Now updates the entity

* Compatible with pyezviz 0.1.5.1

* Fixed switch ir service registering

* now requires pyezviz 0.1.5.2

* now requires pyezviz 0.1.5.2

* Revert "regenerated requirements"

This reverts commit 848b317cf9.

* Rollbacked to a simpler version

* snake_case names everywhere, logging sanatizing, voluptuous proper check

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

* no need for services.yaml for now

* proper voluptuous validation

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

* regenerated requirements

* stale

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

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

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

* added mdns resultion via zeroconf

* Added requirements to requirements_all.txt

* Fixed model determination bug

* Fixed formatting issue for Eagle-200 responses.

* Remove mDNS resolution, IP now required.

* added pypi deps, fixed handling of optional params

manifest updates

* Fixed import order per isort.

* Two pylint fixes.

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

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

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

* Updates to Vilfo Router integration based on feedback

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

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

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

This commit consists of:

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

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

* Refactored based on feedback during review.

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

* Removed unused exception class.

* Various changes to Vilfo Router integration.

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

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

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

* Updated signature with hass first

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

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

This resolves issue #23788

* Make refresh_access_token_if_needed private since we do not want additional callers

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

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

* clean up formatting comments from PR

* use standard interfaces in tests

* migrate config flow to use options

* address latest pr feedback

* format for import as part of config schema validation

* address pr feedback

* lint fix

* simplify check based on pr feedback

* clarify default schema validation

* fix other schema checks

* fix translations

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

* ran hassfest and gen_requirements_all scripts

* fixes per request from Paulus Schoutsen

* ran gen_requirements_all

* updated library version - removed some debug leftover

* get_requirements again...

* added documentation URL

* ran isort

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

* adopted unit tests to latest fix

* Update const.py

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

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

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

* Run isort

* Fix pylint errors

* Run black

* Increase coverage

* Update pymelcloud dependency

* Add HVAC_MODE_OFF emulation

* Remove print

* Update pymelcloud to enable device type filtering

* Collapse except blocks and chain ClientNotReadys

* Add preliminary documentation URL

* Use list comp for creating model info

Filters out empty model names form units.

* f-string galore

Dropped 'HVAC' from AtaDevice name template.

* Delegate fan mode mapping to pymelcloud

* Fix type annotation

* Access AtaDevice through self._device

* Prefer list comprehension

* Update pymelcloud to leverage device type grouping

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

* Remove DOMAIN presence check

This does not seem to make much sense after all.

* Fix async_setup_entry

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

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

* Simplify empty model name check

* Improve config validation

* Use config_validation strings.

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

* Use dict[key] to access required properties.

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

* Remove unused manifest properties

* Remove redundant ClimateDevice property override

* Add __init__.py to coverage exclusion

* Use CONF_USERNAME instead of CONF_EMAIL

* Use asyncio.gather instead of asyncio.wait

* Misc fixes

* any -> Any

* Better names for dict iterations

* Proper dict access with mandatory/known keys

* Remove unused 'name' argument

* Remove unnecessary platform info from unique_ids

* Remove redundant methods from climate platform

* Remove redundant default value from dict get

* Update ConfigFlow sub-classing

* Define sensors in a dict instead of a list

* Use _abort_if_unique_id_configured to update token

* Fix them tests

* Remove current state guards

* Fix that gather call

* Implement sensor definitions without str manipulation

* Use relative intra-package imports

* Update homeassistant/components/melcloud/config_flow.py

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

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

* Add unit test for config flow

* Fixed some review findings and increased unit test coverage

* Fixed docstrings of new test cases

* Removed unnecessary debug log messages

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

* Attempt to fix unit test on CI

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

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

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

* Improved periodic update, speeded up unit tests

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

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

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

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

* Updated requirements_test_pre_commit.txt, fixed codespell findings

* Use localhost as default host

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

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

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

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

* Removed double assignment

* Call get_mac_address async safe

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

* updated translations

* generated files

* added abbreviation

* bumped library version

* small feed entry attribute fixes

* add unit tests

* need to use original mdi name

* bumped library version

* improved entity name for earthquakes

* round vulnerability number

* typo

* support for categories

* testing support for categories

* tie longitude and latitude together

* validating categories

* simplifying setup

* passing domain as parameter

* simplified test setup

* moved test code

* simplified test code

* removed superfluous code

* changed approach to unique identifier

* changed code structure

* simplified unit system handling

* made schema a constant

* comment added

* simplifying code

* added message if location already configured

* removed unnecessary code

* simplified test code

* avoid mocking __init__

* pylint

* simplified code

* fetch categories from integration library

* setting PARALLEL_UPDATES

* setting PARALLEL_UPDATES to zero/unlimited

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

* Review 1

* Use config_entry.unique_id

* Fix config_flow _show_setup_form + init

* Remove empty *_setup_platform()

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

- when multiple district in one city

* Review + abort when API error

* Fix I/O

* Remove monitored_conditions

* Add async_unload_entry

* Review 3

* Fix pipe

* alert_watcher is already None

* Review 4

* Better fix for "Entity id already exists"

* Whoops, fix tests

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

* Update files from development checklist

* Use warning log level when data cannot be retrieved

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

* Remove empty fields from manifest.json

* Remove default arguments for host and username

* Bump saltbox library version

* Refactor and improve error handling

* Dev checklist

* Fix linting errors

* Check for None and return empty list

* Log on debug level instead of info

* More compact None checks

* Remove redundant None check

* Return None on exception but store as empty list

* More compact syntax

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

* Bump skybellpy to 0.4.0 in requirements_all.txt

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

* Fix const import

* Fix const import

* Fix const imports

* Bump total-connect-client to 0.26.

* Catch details of alarm trigger in state attributes.

Also bumps total_connect_client to 0.27.

* Change state_attributes() to device_state_attributes()

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

* add missing total-connect alarm state mappings

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

* Update __init__.py

* Updates per MartinHjelmare comments

* flake8/pydocstyle fixes

* removed . at end of log message

* added blank line between logging and voluptuous

* more fixes

* Adding totalconnect zones as HA binary_sensors

* fix manifest.json

* flake8/pydocstyle fixes.  Added codeowner.

* Update formatting per @springstan guidance.

* Fixed pylint

* Add zone ID to log message for easier troubleshooting

* Account for bypassed zones in update()

* More status handling fixes.

* Fixed flake8 error

* Another attempt at black/isort fixes.

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

* Fix manifest file

* Another manifest fix

* one more manifest fix

* more manifest changes.

* sync up

* fix indent

* one more pylint fix

* Hopefully the last pylint fix

* make variable names understandable

* create and fill dict in one step

* Fix name and attributes

* rename to logical variable in alarm_control_panel

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

* Multiple fixes to improve code per @springstan suggestions

* Update homeassistant/components/totalconnect/binary_sensor.py

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

* Multiple changes per @MartinHjelmare review

* simplify alarm adding

* Fix binary_sensor.py is_on

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

* update requirements and coverage

* fix description comments

* update tests, fix disabled entity updates

* rework device scanning, add tests

* update requirements and coverage

* fix description comments

* update tests, fix disabled entity updates

* update librouteros to 3.0.0

* fix sorting

* fix sorting 2

* revert to 2.3.0 as 3.0.0 requires code update

* fix requirements

* apply fixes

* fix tests

* update hub.py and fix tests

* fix test_hub_setup_failed

* rebased on dev and update librouteros to 3.0.0

* fixed test_config_flow

* fixed tests

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

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

* Run black formatting locally to appease azure

* Apply suggestions from code review

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

* Fix issues identified during code review

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

* Update homeassistant/components/opnsense/__init__.py

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

* Update CODEOWNERS for recent changes

* Fix lint

* Apply suggestions from code review

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

* More fixes from review comments

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

* Revert tests to previous format

* Add device detection to opnsense device_tracker test

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

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

* Rerun black

* Fix lint

* Move import back to module level

* Return false on configuration errors in setup

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

* Update tests

* Add pyopnsense to test requirements

* Rerun gen_requirements script

* Fix failing isort lint job step

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

* Fix comment

* Update manifest.json

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

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

Committer: ocalvo <oscar@calvonet.com>

* Fix PyLint

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

* Correctly name init file

* Update codeowners

* Update requirements

* Added code files

* Correctly name init file

* Update codeowners

* Update requirements

* Black changes, added to coveragerc

* Removed documentation location for now

* Added documentation url

* Fixed merge

* Fixed flake8 syntax

* Fixed isort

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

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

* Async and ConfigFlow code

* Fixes

* Added device_class and misc fixes

* isort and pylint fixes

* Removed from test requirements

* Fixed isort checkblack

* Removed host field

* Fixed coveragerc

* Start working test file

* Added more config_flow tests

* Enable only most used sensors by default

* Added more default enabled sensors, fixed tests

* Fixed isort

* Test config_flow  improvements

* Remove unused import

* Removed redundant patch calls

* Fixed mock return value

* Updated to garmin_connect 0.1.8 fixed exceptions

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

* Fixed mock routine

* Code improvements from PR feedback

* Fix entity indentifier

* Reverted device identifier

* Fixed abort message

* Test fix

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

* Update python-velbus lib

* flake8 and black fixes

* Fix comments

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

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

* Update homeassistant/components/spotify/config_flow.py

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

* Remove configurator dependency

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

* Ensure domain dict exists in hass data on setup entry

* Simply config validation for client id and secret

* Abort flow on any exception from spotipy

* Add tests for config flow

* Gen requirements all

* Add test package __init__

* Remove Spotify from coveragerc

* Made alias handling more robuust

* Fix supported_features for Spotify free and open accounts

* Improve error message in the logs

* Re-implement Spotify media_player

* Change media content type when play a playlist

* Process review suggestions

* Move Spotify init, static current user and supported_features

* Remove unneeded me call

* Remove playlist content type due to frontend issues

* Improve playlist handling, when context is missing

* Handle entity disabled correctly

* Handle being offline/unavailable correctly

* Bump Spotipy to 2.7.1

* Update coverage RC, mark integration silver

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

* Final cleanup

* Addresses Pylint error

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

* Add test state

* Adds person detected event

* Update CODEOWNERS

* Updates requirements

* remove unused datetime

* Bump sighthound version

* Update CODEOWNERS

* Update CODEOWNERS

* Create requirements_test_all.txt

* Address reviewer comments

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

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

* fix wind speed; refactor forecast

* update requirements*.txt

* fix tests; update CODEOWNERS; update pyipma to 2.0.1

* minor changes as suggested in PR

* make lint happy

* fix mocking coroutines

* restore old unique id

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

based on integration component
remove left and right

* Update test

(was'n saved)

* add some functionnal point test

* Change derivation to derivative

* Continue migration from derivation to derivative

* Add codeowners info

* fix tests typo and values

* Improve code from reviewer

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

* create derivation component

based on integration component
remove left and right

* Update test

(was'n saved)

* add some functionnal point test

* Change derivation to derivative

* Continue migration from derivation to derivative

* Add codeowners info

* fix tests typo and values

* Improve code from reviewer

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

* Update homeassistant/components/derivative/sensor.py

Fix test issue with unit of measurement

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

* Fix review

Move ValueError to SyntaxError

* precise state test

* un comment original tests and remove error tests

* Fix isort issue

* Fix review

- update doc link
- migrate to general const import

* Rollback import conf_unit, just defined localy

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

* Add safe mode

* Fix tests

* Add cloud to safe mode

* Update logging text

* Fix camera tests leaving files behind

* Make emulated_hue tests not leave files behind

* Make logbook tests not leave files behind

* Make tts tests not leave files behind

* Make image_processing tests not leave files behind

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

* Update sensor tests

* update -> async_update

* Delete temp files

* Address comments

* Final tweaks

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

* Fixed code style error

* Restructured API access

* Improved construction of attributes

* Fixed handling of API output

* Added @YarmoM as code owner

* Updated CODEOWNERS

* Reverted changes for full backwards compatibility

* Fixed bad conditional

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

* Use station_id

* Refactor Netatmo to use oauth

* Remove old code

* Clean up

* Clean up

* Clean up

* Refactor binary sensor

* Add initial light implementation

* Add discovery

* Add set schedule service back in

* Add discovery via homekit

* More work on the light

* Fix set schedule service

* Clean up

* Remove unnecessary code

* Add support for multiple entities/accounts

* Fix MANUFACTURER typo

* Remove multiline inline if statement

* Only add tags when camera type is welcome

* Remove on/off as it's currently broken

* Fix camera turn_on/off

* Fix debug message

* Refactor some camera code

* Refactor camera methods

* Remove old code

* Rename method

* Update persons regularly

* Remove unused code

* Refactor method

* Fix isort

* Add english strings

* Catch NoDevice exception

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

* Address comments

* Remove ToDo comment

* Add set_light_auto back in

* Add debug info

* Fix multiple camera issue

* Move camera light service to camera

* Only allow camera entities

* Make test pass

* Upgrade pyatmo module to 3.2.0

* Update requirements

* Remove list comprehension

* Remove guideline violating code

* Remove stale code

* Rename devices to entities

* Remove light platform

* Remove commented code

* Exclude files from coverage

* Remove unused code

* Fix unique id

* Address comments

* Fix comments

* Exclude sensor as well

* Add another test

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

* update manifest.json

* update CODEOWNERS

* remove unnecessary else

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

* Add scenes and config entry support

* Update comments

* Add support for groups

* Allow querying config entry

* Update manifest

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

* Added Stookalert integration

* Added Stookalert integration

* Solved comments

* Flake8 change

* Bump stookalert to version 1.1.2

* Fixed attributes and state

* Get method for private variables

*  Update to stookalert 0.1.4

* Code optimization

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

* Use pytest parameters to avoid duplicate code

* Fix UnboundLocalError

* Test error rendering for template state

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

* Raise exception if HTTP error

* Addressed comments

* Fixed format

* Fixed format

* Addressed comments

* Remove guard before add_entities method

* Remove unauthorized exception

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

* fix CI errors

* fix missing new lines

* improve formatting and addresses comments of @springstan

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

* import only used constants of the pilight component

* Add myself to the code owners

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

* Initial commit

* Fix CODEOWNERS

* CODEOWNERS

* Run script.hassfest

* Add initial test

* Bump library

* More tests

* Tests

* Add new sensors and fix KeyError

* Fix unique_id and device_info

* Fix check for configured device

* More tests

* Bump library version

* Add uptime sensor

* Use config entry unique ID

* Run python3 -m script.gen_requirements_all

* Fix pylint error

* Remove pysnmp dependency

* Raise ConfigEntryNotReady when device offline at HA start

* Remove period from logging message

* Generator simplification

* Change raise_on_progress

* Rename data to printer

* Move update state to async_update

* Remove unused _unit_of_measurement

* Remove update of device_info

* Suggested change for tests

* Remove unnecessary argument

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

* cleanup

* remove unused imports and comments

* remove comment

* fix bug which prevented updating the sensors

* improve config validation

* fix voluptuous usage

* fix format & credential storage

* various fixes to hass-conform

* small format fixes

* change False to None

* still trying to be hass-conform

* remove unused class

* fix imports

* fix f-string

* add guard clause?!

* central data fetch

* do not pass in hass, will be provided automatically

* make the linters happy

* disable constant-test warning and add commas

* worksforme

* fix link in manifest

* remove icon

* bump surepy to 0.1.5

* worksforme

* small doc fixes

* add discovery_info guard

* result of another awesome review

* and again :)

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

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

* rename DATA_KEF -> DOMAIN

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

* sort imports

* fix @MartinHjelmare's suggestions

* remove _CONFIGURING

* change STATE_UNKNOWN to None

* use lat and long for unique_id

* bump aiokef to v0.2.2

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

* use getmac

* fix case when MAC is None

* use host as instance lifetime id

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

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

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

* Tweak docstring

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

* Initial support for config entries

* Rename localip to local_ip (1/2)

* Rename localip to local_ip (2/2)

* Add test for config_flow

* Split and rename tests

* Remove unneeded code from config_flow

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

* Fix tests

* minor code review fixes

* remove unneeded code

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

* Add gios to requirements

* Add tests

* Update .coveragerc file

* Run gen_requirements_all.py

* Change DEFAULT_SCAN_INTERVAL

* Better strings

* Bump library version

* run script.hassfest

* run isort

* Add icons mapping

* Remove unnecessary f-string

* Remove unnecessary listener

* Refactoring config_flow

* Add unique_id to config entry

* Change AQI states to consts in English

* Remove unused init

* Remove unused exception

* Remove private instance attribute

* Remove overwrite state property

* Fix pylint error

* Add SCAN_INTERVAL for air_quality entity

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

* Cleanup and fixes for style/etc

* Forgot to convert to f-strings.

* Update with changes requested by @MartinHjelmare

* Pylint

* Fix to None

* Reverse logic for hobbyboard test to eliminate pylint complaint

* Modified manifest to list myself as codeowner

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

* Oops, missed some decode()'s

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

* Remove tests

* feat: add config flow

* feat: add async

* perf: convert unnecessary async calls to sync

* feat: add charger voltage and current sensor

* feat: add options flow

* build: bump teslajsonpy to 0.2.0

* Remove icon property

* Revert climate mode change

* Remove charger sensor

* Simplify async_setup_platform

* Update homeassistant/components/tesla/sensor.py

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

* Update homeassistant/components/tesla/binary_sensor.py

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

* Address requested changes

* Fix pylint error

* Address requested changes

* Update codeowners

* Fix pylint error

* Address requested changes

* Address requested change

* Remove unnecessary check for existing config entry

* Load scan_interval in async_setup_entry

* Include coverage of config_flow

* Add tests for full coverage

* Address requested test changes

* Remove unnecessary init lines

* Remove unnecessary init

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

This reverts commit df74272ba6.

* Revert "Cleanup removed component (#29788)"

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

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

* Review : not copy account conf

* Review: Safer test patch

* Review: remove reset_account

* Review: Use executor_job while IO

* Review: Use executor_job while IO 2

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

* Review: no IO in tests

* Remove reset from services.yaml

* Review: remove authenticate.return_value = Mock()

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

* isort

* Review: @MartinHjelmare Test config flow with all steps

* Review: Fix failed tests names

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

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

* added signalmessenger documentation to manifest file

* remove debug logging from signalmessenger integration

* add signalmessenger to .coveragerc

* fixed typo in signalmessenger manifes

* moved service specific code to own pypi library

* updated pysignalclirestapi dependeny in manifest.json

* added pysignalclirestapi requirement for signalmessenger component

* fixed typo in codeowners

* reworked signalmessenger integration based on code review input

* updated requirements for signalmessenger

* small code improvements in signalmessenger integration

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

* small changes in signalmessenger integration

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

* changed import order in signalmessenger integration according to PEP 8

* used isort to order includes in signalmessenger integration

* renamed signalmessenger to signal_messenger

* renamed signalmessenger to signal_messenger in CODEOWNERS file

* changed documentation url in signal_messenger integration to new name

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

* Add support for IntesisHome and Airconwithme devices

* Implement requested changes from PR review

* Improve error handling for IntesisHome component

* Fix snake-case naming style

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

* Remove passing in of hass loop

* Tweaks a comment

* Tweaks a function name

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

* Add myself to CODEOWNERS

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

* Fixing heatmiser component

* Updated codeowners and heatmiserV3 version

* Updating files as part of PR process

* Removed extra _LOGGER statements.

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

* Handling PR comments

* Removed legacy tests

* fixing pylint errors

* Update homeassistant/components/heatmiser/climate.py

Removed .get from config

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

* Update homeassistant/components/heatmiser/climate.py

Removed .get from config

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

* Update homeassistant/components/heatmiser/climate.py

Removed .get from config

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

* Updated climate based on latest feedback

* Removed cast to int and update requirements

* Update requirements

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

* Fix order of the imports

* Add remote.py to .coveragerc

* Optimize MAC address validation

* Use storage helper class and improve code readability

* Add me to the manifest as a code owner

* Fix dosctring

* Add me to the code owners

* Remove storage schemas, rename storage keys and improve readability
2019-12-02 13:20:36 -08:00
NobleKangaroo
67498595e4 Add Emulated Hue code owner (#29319) 2019-12-02 21:29:31 +01:00