Commit Graph

5030 Commits (a4c9446b8d75d1b36b1ca97c9f62e005a091ca45)

Author SHA1 Message Date
J. Nick Koston b855177fe6
Make homekit aware of STATE_STANDBY (#33679) 2020-04-05 08:47:44 -05:00
J. Nick Koston de317fb2f6
Map dry and fan only states for homekit thermostats (#33682)
Homekit only has Off/Heat/Cool/Auto at this time, but
at least we can prevent the device from erroring
by mapping dry and fan to cool so it continues
to function.
2020-04-05 08:47:32 -05:00
Paulus Schoutsen 5bf7e0fcc0
List dir when test fails (#33685) 2020-04-05 12:15:29 +02:00
Franck Nijhof 7653dc947a
Enable pylint unnecessary-pass (#33650)
* Enable pylint unnecessary-pass

* Process review suggestions

* Fix smhi tests
2020-04-05 10:33:07 +02:00
J. Nick Koston 000ad256fb
Handle float values for homekit lightning (#33683)
* Handle float values for homekit lightning

* Empty commit to rerun CI
2020-04-04 23:21:44 -07:00
jjlawren d3a4270312
Plex logging additions & cleanup (#33681) 2020-04-04 23:21:20 -07: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
Franck Nijhof 528c7f4871
Removal of extraneous parenthesis in tests (#33670)
* Removal of extraneous parenthesis

* Process review suggestions

* Apply suggestions from code review

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-04-05 03:50:30 +02:00
Franck Nijhof b00b8ea0c1
Use byte literals instead of encode in tests (#33672) 2020-04-05 02:39:44 +02:00
Franck Nijhof 59f1a1be93
Replace OSError aliases with OSError in UVC test (#33673) 2020-04-05 02:21:47 +02:00
Franck Nijhof 262b01d632
Removal of old style class definitions in tests (#33671) 2020-04-05 02:21:07 +02:00
Franck Nijhof 03dd92d51b
Use set literals in tests (#33669) 2020-04-05 02:20:09 +02:00
Phil Bruckner bf1b408038
Handle cancellation in ServiceRegistry.async_call (#33644) 2020-04-04 15:36:33 -07:00
Franck Nijhof d7e9959442
String formatting improvements for tests (2) (#33666) 2020-04-05 00:33:07 +02:00
Franck Nijhof 906385172a
String formatting improvements for tests (#33663) 2020-04-05 00:26:08 +02:00
Ziv c3c7b68cac
Fix unhandled exceptions in dsmr (#33601)
* reordered the clearing of the closed Event so it can stay set at the end and not
leave a task waiting on close

* fixed the side effect so it returns one TimeoutError and after that success
Previously it reached the end of the single item list and threw an exception

* fixed the error. it doesn't happen on python 3.7.5 but CI is on 3.7.0

* fixed comment
2020-04-04 14:38:20 -07:00
Paulus Schoutsen 0a3ec6fea1
Correct Hue mireds for lights (#33597) 2020-04-04 14:29:03 -07:00
springstan dde93304d3
Improve string formatting v2 (#33645)
* Improve string formatting v2

* Improve string formatting v3

* Address review comments
2020-04-04 23:09:34 +02:00
springstan 0d95eff21d
Use dict literals (#33658) 2020-04-04 22:31:56 +02:00
springstan ed71683488
Improve string formatting (#33643) 2020-04-04 20:17:11 +02:00
Franck Nijhof 46fa20411e
Bump twentemilieu to 0.3.0 (#33622)
* Bump twentemilieu to 0.3.0

* Fix tests
2020-04-04 14:51:12 +02:00
Ziv 0d05bd309a
Fix uncaught exceptions in upnp (#33604)
removed also the yr tests that are already successful
2020-04-03 22:44:57 -07:00
Paulus Schoutsen c6ba607c8c
Use IP addresses instead of mDNS names when wled discovered (#33608) 2020-04-03 22:41:08 -07:00
Chris Talkington 07ae3f9ee9
Use IP addresses instead of mDNS names when IPP discovered (#33610)
* use discovery resolved host rather than mdns host.

* Update __init__.py

* Update test_config_flow.py

* Update __init__.py

* Update test_init.py

* Update test_config_flow.py

* Update test_config_flow.py

* Update __init__.py

* Update __init__.py

* Update __init__.py

* Update test_init.py

* Update test_config_flow.py
2020-04-03 22:36:46 -07:00
jjlawren 42353282d4
Debounce calls to Plex server (#33560)
* Debounce calls to Plex server

* Simplify debounce by recommendation

* Update tests to handle debounce

* Test debouncer, fix & optimize tests

* Use property instead
2020-04-03 22:34:42 -07:00
Paulus Schoutsen dc7127aacf
Data Coordinator to return unsub func (#33588) 2020-04-03 20:15:42 +02:00
Erik Montnemery 4e6fd19624
Improve MQTT test coverage and remove dead code (#33584)
* Improve MQTT tests and remove dead code

* Remove useless test.

* Add more test
2020-04-03 09:05:58 -07:00
ollo69 62835f0536
Fix asuswrt network failure startup (#33485)
* Fix network failure startup

Fix for issue ##33284 - Asuswrt component fail at startup after power failure

* Removed comment

* Removed bare except

* is_connected moved out try-catch

* Removed pointless-string-statement

* Raise PlatformNotReady on "not is_connected"

* Removed unnecessary check

* Revert "Removed unnecessary check"

This reverts commit a2ccddab2c4b1ba441f1d7482d802d9774527a26.

* Implemented custom retry mechanism

* Fix new line missing

* Fix formatting

* Fix indent

* Reviewed check

* Recoded based on tibber implementation

* Formatting review

* Changes requested

* Fix tests for setup retry

* Updated missing test

* Fixed check on Tests

* Return false if not exception

* Format correction
2020-04-03 15:02:48 +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
Paulus Schoutsen aef06a3544
Directly call write state 2 (#33513)
* Directly call async_write_ha_state pt2

* Directly call async_write_ha_state pt2

* Fix mock

* Address comments
2020-04-03 09:34:50 +02:00
akasma74 83cc871edf
Add force_update to timer integration (#31646)
* force_update added

As per this discussion we need to update last_changed when active timer restarted.
One way to do that is to force HA update the state on each request even if it remains the same.
More details here - https://github.com/home-assistant/architecture/issues/345

* add test for force_update

make sure state_change event fired every time timer (re)started

* remove whitespaces

* remove whitespace

* Update tests/components/timer/test_init.py

Co-Authored-By: Alexei Chetroi <lexoid@gmail.com>

* fix lint

* fix isort

Co-authored-by: Alexei Chetroi <lexoid@gmail.com>
2020-04-02 23:48:41 -07:00
Raman Gupta 081b822d25
Add support for Vizio sound mode (#33200)
* add sound mode support for devices that support it

* make setting and unsetting flag better

* move eq and audio settings into constants

* fix missed statement to use constant instead of hardcoded string

* further fixes based on review

* bump pyvizio version to include newly identified app
2020-04-02 22:48:19 -04:00
J. Nick Koston f25321e010
Use homekit service callbacks for lights to resolve out of sync states (#32348)
* Switch homekit lights to use service callbacks

Service callbacks allow us to get the on/off, brightness, etc
all in one call so we remove all the complexity that was
previously needed to handle the out of sync states

We now get the on event and brightness event at the same time
which allows us to prevent lights from flashing up to 100%
before the requested brightness.

* Fix STATE_OFF -> STATE_ON,brightness:0
2020-04-02 20:06:13 -05:00
Teemu R e64104300f
Use backend-provided fan speed presets for Xiaomi vacuums, bum… (#32850)
* Use backend-provided fan speed presets for Xiaomi vacuums

This needs input from Xiaomi vacuum owners to verify that it does not break anything.
I have personally tested this on rockrobo v1 (old mapping).

Related issues/PRs:
home-assistant/core#32821
home-assistant/core#31268
home-assistant/core#27268

This is a WIP as it requires a new upstream release.
The PR is https://github.com/rytilahti/python-miio/pull/643

* Bump version requirement for 0.5.0

* Bump requirements_test_all.txt, too

* Fix linting; missing setup.cfg on local checkout caused wrong settings for black..

* Add tests for both fan speed types

* Remove useless else..

* bump python-miio to 0.5.0.1 due to broken 0.5.0 packaging
2020-04-02 16:55:44 -07:00
Aaron Bach cb058ff6c0
Add config entry for Flu Near You (#32858)
* Add config flow for Flu Near You

* Cleanup

* Cleanup

* Add tests

* Add test requirements

* Code review

* Reduce unnecessary async-ness

* Handle API registration

* Cleanup

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

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

* Code review

* Ensure config schema allows additional keys

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-04-02 16:54:11 -07:00
Ziv f2dad7905d
fixed uncaught exceptions for tradfri (#33550)
was caused by device_info being mocks, so write to storage failed
2020-04-03 00:55:04 +02:00
Alistair Galbraith 3db9d6a6aa
Fix template light returning NULL in color or temperature (#33498)
* Support for returning NULL in color or temperature. Fixes #33469

* Added further support for ‘None’ returns in level template

* Removed assumption that template render may not be a string

* Streamlined code per cloud pylint

* Updates per code review suggestions

* Added improved error handling and logging for brightness

* Additional exception handling for temperature
2020-04-02 17:41:19 -05:00
Ziv 8fbdc703e0
Fix uncaught exceptions for mqtt (#33547)
now all mqtt tests pass
2020-04-02 15:18:30 -07:00
David F. Mulcahey 201e958854
Use mock storage for MQTT tests (#33553)
* mock storage for MQTT

* more mqtt storage mocks
2020-04-02 17:13:44 -05:00
Paulus Schoutsen 6afe6acb6c
Mark new gate device class as 2FA (#33541) 2020-04-02 22:02:59 +02:00
Ziv 39408ab240
Add cover platform to Dynalite (#32594)
* lib version

* unit-test refactoring

* added type hints

* added cover

* added test to see that consts have the same value as library consts

* Update tests/components/dynalite/test_init.py

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

* removed trigger template

* Update homeassistant/components/dynalite/__init__.py

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

* Update homeassistant/components/dynalite/const.py

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

* removed CONF_TRIGGER from const
corrected type hints - not clear why mypy didn't catch it

* conversion of the config to library CONFs

* moved to use the value since it should come from the library

* taking CONF_HOST from homeassistant.const instead of module const

* use dict.get
removed leftover log

* force device_class to be from homeassistant consts

* move dict.get to inline

* removed CONF from values
changed "channelcover" to "channel_cover"

* moved some CONF values out of const.py and taking them from homeassistant.const

* verifying that device class is a valid HA device class

* moved shutter to home assistant const

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-04-02 20:26:36 +02:00
mvn23 1d89d22a38
Update pyotgw to 0.6b1 (#33529) 2020-04-02 10:29:41 -07:00
David F. Mulcahey 8b0a0ee521
Don't write storage to disk while stopping (#33456)
* Don't write storage to disk while stopping

* rework change

* lint

* remove delay save and schedule final write at stop

* update tests

* fix test component using private methods

* cleanup

* always listen

* use stop in restore state again

* whitelist JSON exceptions for later

* review comment

* make zwave tests use mock storage
2020-04-02 10:25:28 -07:00
Chris Talkington 30fd9950e2
Add remote platform to directv (#32790)
* add remote platform to directv.

* Update __init__.py

* Update .coveragerc

* Rename remote py to remote.py

* Update remote.py

* squash.

* Update remote.py

* squash.

* Update remote.py
2020-04-02 10:18:53 -07:00
Paulus Schoutsen b10319f69e
Convert TTS tests to async (#33517)
* Convert TTS tests to async

* Address comments
2020-04-02 18:55:34 +02:00
Martin Hjelmare 1d2713b0ea
Clarify light reproduce state deprecation warning (#33531) 2020-04-02 09:52:46 -07:00
Erik Montnemery 457d439e24
Fix MQTT cleanup regression from #32184. (#33532) 2020-04-02 09:52:05 -07:00
J. Nick Koston 590e714021
Ensure harmony hub is ready before importing (#33537)
If the harmony hub was not ready for connection or
was busy when importing from yaml, the import validation
would fail would not be retried.

To mitigate this scenario we now do the validation in
async_setup_platform which allows us to raise
PlatformNotReady so we can retry later.
2020-04-02 09:46:10 -07:00
Robert Svensson 314bc07cee
UniFi - Make POE control switches configurable (#32781)
* Allow control whether POE switches are to be created or not

* Fix options flow and test
2020-04-02 17:53:33 +02:00
Maciej Bieniek 5a55d50879
Bump brother to 0.1.11 (#33526) 2020-04-02 13:52:03 +02:00
Paulus Schoutsen 7ae802bb0d
Cloud do checks during setup (#33507)
* Update cloud to do more tasks during async_setup

* Upgrade hass_nabucasa to 0.33
2020-04-01 15:25:04 -07:00
Paulus Schoutsen aaa1d06809
Directly call async_write_ha_state (#33508)
* Directly call async_write_ha_state

* Address comments

* Fix tests
2020-04-01 14:19:51 -07:00
Erik Montnemery fbd197146a
Add MQTT debug info for remaining MQTT integrations (#33506) 2020-04-01 11:48:32 -07:00
Eugenio Panadero 71aaf2d809
Add device triggers for Hue remotes (#33476)
* Store device_registry entry id in HueEvent

so it can be retrieved with that key when using device triggers

* Add device_trigger for hue_event from hue remotes

* supporting Hue dimmer switch & Hue Tap
* State mapping and strings are copied from deCONZ

* refactor mock_bridge for hue tests

and also share `setup_bridge_for_sensors`
for test_sensor_base and test_device_trigger.

* Add tests for device triggers with hue remotes

* Remove some triggers
2020-04-01 11:42:22 -07:00
J. Nick Koston 4a32a0f1da
Expand network util to check for link local addresses (#33499) 2020-04-01 11:24:30 -07:00
springstan 0cf9268ca8
Fix invalid directory for dnsmasq files in asuswrt (#33503) 2020-04-01 11:04:44 -07:00
Erik Montnemery fb93b79b12
Add MQTT debug info (#33461)
* Add MQTT debug info

* Tweaks

* Tweaks
2020-04-01 10:00:40 -07:00
Ziv 4dbbf93af9
Replace asyncio.wait with asyncio.gather since wait ignores exceptions (#33380)
* replace asyncio.wait with asyncio.gather since wait ignores exceptions
fix for test_entity_platform so it expects the exception

* changed to log on failed domains

* discovered that this fix actually removes other uncaught exceptions

* fix in the list of ignored exceptions

* replaced a few ignores on dyson tests that work locally but fail in the CI

* two more tests that are failing on the CI and not locally

* removed assertion on multiple entries with same unique_id - replaced with log and return
reverted test_entity_platform to its original since now there is no exception thrown

* entered all the dyson tests. they all pass locally and probabilistically fail in the CI

* removed unnecessary str() for exception

* added log message for duplicate entity_id / unique_id

* removed log in case of False return value

* added exc_info

* change the use of exc_info
2020-04-01 07:09:13 -07: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 83fb5e5071
Apply recommendations from IPP review (#33477)
* Update test_config_flow.py

* Update test_config_flow.py

* lint.
2020-03-31 16:40:07 -07:00
Kit Klein 955c94e313
allow overriding host api url in config flow (#33481)
* allow overriding host api url in config flow

* fix typo

* capitalize URL
2020-03-31 15:50:37 -07:00
Chris Talkington b892dbc6ea
Refactor DirecTV Integration to Async (#33114)
* switch to directv==0.1.1

* work on directv async.

* Update const.py

* Update __init__.py

* Update media_player.py

* Update __init__.py

* Update __init__.py

* Update __init__.py

* Update media_player.py

* Update test_config_flow.py

* Update media_player.py

* Update media_player.py

* work on tests and coverage.

* Update __init__.py

* Update __init__.py

* squash.
2020-03-31 15:35:32 -07:00
J. Nick Koston 3566803d2e
Fix setting zone overlays for tados that support swing (#33439)
* Fix setting zone overlays for tados that support swing

* Support for changing swing mode will come at a later
time as another upstream update is required.

* remove debug

* style
2020-03-31 17:29:45 -05:00
J. Nick Koston a473ae6711
Ignore link local addresses during doorbird ssdp config flow (#33401) 2020-03-31 14:20:29 -07:00
J. Nick Koston e6ed2f0377
Add version and device type to powerwall device_info (#33453)
* Add version and device type to powerwall device_info

* Upstream powerwall now supports a http_session
2020-03-31 12:55:50 -07:00
Paulus Schoutsen 06216a8a45
Google Assistant: parallize as many requests as possible (#33472)
* Google Assistant: parallize as many requests as possible

* Fix double comment
2020-03-31 12:01:31 -07:00
J. Nick Koston b783aab41b
Add binary sensor for myq gateway connectivity (#33423) 2020-03-31 11:58:44 -07:00
J. Nick Koston 12b408219e
Improve handling of nuheat switching states (#33410)
* The api reports success before the state change
takes effect

* We now set state optimistically and followup with
an update 4 seconds in the future after any state change to
verify it actually happens.

* When hvac_mode is passed to the set_temperature service
we now switch to the desired mode.
2020-03-31 11:55:13 -07:00
J. Nick Koston 6cafc9aaef
Add humidity support to homekit thermostats (#33367) 2020-03-31 11:45:33 -07:00
Eugenio Panadero f5cbc9d208
Fire events for hue remote buttons pressed (#33277)
* Add remote platform to hue integration

supporting ZGPSwitch, ZLLSwitch and ZLLRotary switches.

* Ported from custom component Hue-remotes-HASS from @robmarkcole

* Add options flow for hue, to toggle handling of sensors and remotes

* Sensors are enabled by default, and remotes are disabled,
  to not generate any breaking change for existent users.
  Also, when linking a new bridge these defaults are used,
  so unless going explicitly to the Options menu,
  the old behavior is preserved.
* SensorManager stores the enabled platforms and ignores everything else.
* Bridge is created with flags for `add_sensors` and `add_remotes`,
  and uses them to forward entry setup to only the enabled platforms.
* Update listener removes disabled kinds of devices when options are changed,
  so device list is in sync with options, and disabled kinds disappear from HA,
  leaving the enable/disable entity option for individual devices.

* Fix hue bridge mock with new parameters

* Revert changes in hue bridge mock

* Remove OptionsFlow and platform flags

* Extract `GenericHueDevice` from `GenericHueSensor`

to use it as base class for all hue devices, including those without any entity,
like remotes without battery.

* Add `HueBattery` sensor for battery powered remotes

and generate entities for TYPE_ZLL_ROTARY and TYPE_ZLL_SWITCH remotes.

* Remove remote platform

* Add HueEvent class to fire events for button presses

* Use `sensor.lastupdated` string to control state changes
* Event data includes:
  - "id", as pretty name of the remote
  - "unique_id" of the remote device
  - "event", with the raw code of the pressed button
    ('buttonevent' or 'rotaryevent' property)
  - "last_updated", with the bridge timestamp for the button press
* Register ZGP_SWITCH, ZLL_SWITCH, ZLL_ROTARY remotes

* fix removal

* Exclude W0611

* Extract GenericHueDevice to its own module

and solve import tree, also fixing lint in CI

* Store registered events to do not repeat device reg

* Minor cleaning

* Add tests for hue_event and battery entities for hue remotes
2020-03-31 10:27:30 -07:00
Jeff McGehee dd1608db0d
Best effort state initialization of bayesian binary sensor (#30962)
* Best effort state initialization of bayesian binary sensor.

Why:

* https://github.com/home-assistant/home-assistant/issues/30119

This change addresses the need by:

* Running the main update logic eagerly for each entity being observed
  on `async_added_to_hass`.
* Test of the new behavior.

* Refactor in order to reduce number of methods with side effects that
mutate instance attributes.

* Improve test coverage

Why:

* Because for some reason my commits decreased test coverage.

This change addresses the need by:

* Adding coverage for the case where a device returns `STATE_UNKNOWN`
* Adding coverage for configurations with templates

* rebase and ensure upstream tests passed

* Delete commented code from addressing merge conflict.
2020-03-31 10:41:29 -06:00
Eugenio Panadero f2f03cf552
Fix deconz tests that have uncaught exceptions (#33462) 2020-03-31 11:19:34 -05:00
Eugenio Panadero 977f1a6916
Fix hue tests that have uncaught exceptions (#33443) 2020-03-31 10:17:09 -05:00
Marcel Steinbach 6208d8c911
Add HomeKit support for slat tilting (#33388)
* Add HomeKit support for slat tilting

* Reset tilt-specific attribute, not position attribute

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

* Add explanation why we fix HomeKit's targets

We have to assume that the device has worse precision than HomeKit. If it
reports back a state that is only _close_ to HK's requested state, we'll
"fix" what HomeKit requested so that it won't appear out of sync.

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-03-30 19:47:03 -05:00
David F. Mulcahey d0dad4bfd6
Fix uncaught exceptions in ZHA tests (#33442) 2020-03-30 20:34:23 -04: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
Erik Montnemery 9508c51403
Fix change of entity_id for discovered MQTT entities (#33444) 2020-03-30 14:26:59 -07:00
Bram Kragten 952aa02e37
Add ability to specify group when creating user (#33373)
* Add abbility to specify group when creating user

* Fix tests

* Not default admin and tests
2020-03-30 20:33:43 +02:00
David F. Mulcahey bcd1eb952c
RFC - Add a 3rd state to the HA shutdown sequence for writing… (#33358)
* add third stage to hass shutdown

* use 3rd stage in storage

* update core state

* add writing data to multi stop ignore

* update core test

* review comment

* update name based on feedback
2020-03-30 10:18:39 -07:00
da-anda 01bf4daf37
Fix detection of zone master in soundtouch media_player (#33157) 2020-03-30 17:27:02 +02:00
Santobert 0186ce7896
Filter the history of device_tracker by location attributes (#33356)
* Add include_location_attributes

* Add check for different state

* Fix things

* Drop filter

* significant changes only

* Change default behavior

* Remove trailing commas
2020-03-30 08:13:22 -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
Kit Klein 0e6b905cdf
Add konnected multi output (#33412)
* add test to for importing multiple output settings

* provide option to set multiple output states

* tweaks after testing

* Update homeassistant/components/konnected/config_flow.py

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

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-03-29 20:05:59 -07:00
Malte Franken de54659097
Fix GeoNet NZ Quakes tests (#33383)
* enable tests

* only remove entity if exists
2020-03-29 22:40:09 +02:00
SukramJ 1cd0e764b6
Use new HMIP labels for HomematicIP Cloud multi devices (#32925)
* Use new labels for HomematicIP Cloud multi devices

* Update homeassistant/components/homematicip_cloud/device.py

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

* Update name composition

Co-authored-by: springstan <46536646+springstan@users.noreply.github.com>
2020-03-29 21:38:59 +02: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
David F. Mulcahey 188ca630de
Miscellaneous ZHA code cleanup (#33395)
* cleanup state change listener

* update group id handling and unique id

* update test

* add guards for last_seen updates
2020-03-29 13:26:48 -04:00
jjlawren ffafcf27a8
plexwebsocket bump 0.0.7 to fix ignored tests (#33398)
* Bump plexwebsocket to 0.0.7

* Remove unnecessary test ignores
2020-03-29 12:14:42 -04:00
jjlawren 312af53935
Handle Plex certificate updates (#33230)
* Handle Plex certificate updates

* Use exception in place

* Add test
2020-03-28 21:02:29 -07:00
SukramJ 3c2df7f8f2
Fix homematicip_cloud tests that have uncaught exceptions (#33371) 2020-03-28 21:01:53 -07:00
David F. Mulcahey f7ae78f78e
Update ZHA group entity when Zigbee group membership changes (#33378)
* cleanup group entities

* add test

* appease pylint

* fix order
2020-03-28 20:38:48 -04:00
Ziv dd232a3507
Fix uncaught exceptions in dynalite (#33374) 2020-03-28 22:19:43 +01:00
Malte Franken c08ca8a439
Fix GDACS tests (#33357)
* enable tests

* only remove entity if exists
2020-03-28 21:18:15 +01:00
shred86 bf16b50679
Fix Abode tests uncaught exceptions (#33365) 2020-03-28 18:54:07 +01:00
J. Nick Koston 5a1b0edd96
Add inline comments to elkm1 about how config is updated from… (#33361) 2020-03-28 17:23:39 +01:00
Bram Kragten 1477087c71
Fix Lovelace resources health info (#33309)
* Fix Lovelace resources health info

* Fix tests
2020-03-28 13:57:36 +01:00
Ziv ff391e538a
Fail tests with uncaught exceptions (#33312)
* initial implementation and ignore file

* updated ignore list for the tests in the most recent dev branch
2020-03-27 21:36:06 -07:00
ochlocracy 28a2c9c653
Implement Alexa.CameraStreamController in Alexa (#32772)
* Implement Alexa.CameraStreamController.

* Add dependencies.

* Add camera helpers for image url, and mjpeg url.

* Remove unsupported AlexaPowerController from cameras.

* Refactor camera_stream_url to hass_url

* Declare HLS instead of RTSP.

* Add test for async_get_image_url() and async_get_mpeg_stream_url().

* Sort imports.

* Fix camera.options to camera.stream_options. (#32767)


(cherry picked from commit 9af95e8577)

* Remove URL configuration option for AlexaCameraStreamController.

* Update test_initialize_camera_stream.

* Optimize camera stream configuration.

* Update Tests for optimized camera stream configuration.

* Sort imports.

* Add check for Stream integration.

* Checks and Balances.

* Remove unnecessary camera helpers.

* Return None instead of empty list for camera_stream_configurations().
2020-03-27 21:19:11 -07:00
J. Nick Koston 369ffe2288
Fix setting HomeKit temperatures with imperial units (#33315)
In PR#24804 the step size was changed to match the step size
of the device that HomeKit is controlling. Since HomeKit
is always working in TEMP_CELSIUS and the step size is based on
the Home Assistant units setting, we were mixing data with different
units of measure when Home Assistant was using imperial units.

This regression presented the symptom that setting the
temperature to 73F would result in 74F.  Other values are affected
where the math doesn't happen to work out.

HomeKit currently has a default of 0.1 in the spec and the override
of this value has been removed.
2020-03-27 21:02:51 -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