Significantly reduce code in august integration (#32030)

* Significantly reduce code in august integration

* Activity updates can now be processed by py-august
  this allows us to eliminate the activity sync
  code for the door sensors and locks

* Lock and door state can now be consumed from
  the lock detail api which allows us to
  remove the status call apis and reduce
  the number of API calls to august

* Refactor the testing method for locks (part #1)

* Update homeassistant/components/august/binary_sensor.py

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

* Switch to asynctest instead of unittest for mock.patch

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
This commit is contained in:
J. Nick Koston 2020-02-20 23:06:24 -06:00 committed by GitHub
parent a12c4da0ca
commit d4075fb262
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 579 additions and 429 deletions

View file

@ -128,7 +128,6 @@ def _create_august_data_with_lock_details(lock_details):
authenticator = _mock_august_authenticator()
token_refresh_lock = MagicMock()
api = MagicMock()
api.get_lock_status = MagicMock(return_value=(MagicMock(), MagicMock()))
api.get_lock_detail = MagicMock(side_effect=lock_details)
api.get_operable_locks = MagicMock(return_value=locks)
api.get_doorbells = MagicMock(return_value=[])