Commit Graph

26 Commits (bc1dac80b643ee590e6c28a49a4eb790e2dc597e)

Author SHA1 Message Date
J. Nick Koston 7dd42bc32d
Separate august keypads into their own device (#33665)
The keypad has its own unique id so its better
represented as its own device.  This fixes
showing the keypad battery state for the lock
in the UI.
2020-04-08 12:57:27 -07:00
springstan fca90a8ddc
Improve string formatting v5 (#33697)
* Improve string formatting v5

* Address review comments
2020-04-05 17:48:55 +02:00
Franck Nijhof 7d3c974747
Use set & dict literals (#33636)
Co-authored-by: Daniel Høyer Iversen <mail@dahoiv.net>
2020-04-04 20:05:15 +02:00
J. Nick Koston 048f9e7daa
Throw ConfigEntryNotReady when august servers are offline or u… (#32635)
* Throw ConfigEntryNotReady when august servers are offline

* august has tests now and its nearing 100%

* Adjust per review

* define in init
2020-03-10 17:10:00 -07:00
J. Nick Koston 3318e65948
Convert august to async (#32586)
* Convert august to async

Async io was added to py-august 0.24

* Fix lint
2020-03-09 13:54:05 -07:00
J. Nick Koston 223c01d842
Coordinate all august detail and activity updates (#32249)
* Removing polling from august

* Now using subscribers to the detail and activity

* Fix hash to list keys

* continue to the next house if one fails

* Add async_signal_device_id_update

* Fix double initial update

* Handle self.hass not being available until after async_added_to_hass

* Remove not needed await

* Fix regression with device name
2020-02-27 19:44:22 -08:00
J. Nick Koston 4c5e364d90
Centralize august activity updates (#32197)
* Reduce August doorbell detail updates

* Doorbell images now get updates from the activity feed

* Tests for activity updates

* py-august now provides bridge_is_online for available state

* py-august now provides is_standby for available state

* py-august now provides get_doorbell_image (eliminate requests)

* remove debug

* black after merge conflict

* Centralize august activity updates

* Updates appear significantly more responsive

* Should address the community complaints about "lag"

* Reduce detail updates (device end points) to one hour interval

* Signal entities to update via dispatcher when new activity arrives

* Resolves out of sync state (skipped test is now unskipped)

* pylint

* fix merge conflict

* review comments

* Remove stray

* Address review items that can be done without refactor
2020-02-26 18:48:44 -08:00
J. Nick Koston 638a3025df
Reduce August doorbell detail updates (#32193)
* Reduce August doorbell detail updates

* Doorbell images now get updates from the activity feed

* Tests for activity updates

* py-august now provides bridge_is_online for available state

* py-august now provides is_standby for available state

* py-august now provides get_doorbell_image (eliminate requests)

* remove debug

* black after merge conflict
2020-02-26 08:43:41 +01:00
J. Nick Koston 2925e0617c
Add Config flow to august (#32133)
* Add battery sensors for August devices

* Additional tests and cleanup in prep for config flow
  and device registry

* pylint

* update name for new style guidelines - https://developers.home-assistant.io/docs/development_guidelines/#use-new-style-string-formatting

* Config Flow for august push

* Update homeassistant/components/august/__init__.py

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

* Address review items

* Update tests

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-02-25 10:18:15 -08:00
J. Nick Koston 693441e56f
Deduplicate code in the august integration (#32101)
* Deduplicate code in the august integration

* Add additional tests for august (more coming)

* Door state is now updated when a lock or unlock call returns
  as the state is contained in the response which avoids
  the confusing out of sync state

* revert

* document known issue with doorsense and lock getting out of sync (pre-existing)

* Address review comments

* Additional review comments
2020-02-23 13:54:34 -08:00
springstan 524a1a7587
Use f-strings in integrations starting with "A" (#32110)
* Use f-strings in integrations starting with A

* Use f-strings in tests for integrations starting with A

* Fix pylint by renaming variable

* Fix nested for loop in f-string for aprs device_tracker

* Break long lines into multiple short lines

* Break long lines into multiple short lines v2
2020-02-23 13:38:05 -08:00
J. Nick Koston d4075fb262
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>
2020-02-20 21:06:24 -08:00
J. Nick Koston 17f3332c89
Audit state handling off august bridges and sensors (#31935)
* Audit state handling of august bridges and sensors

This addresses issue #29980

* Prevent setting up august locks that do not have a bridge as they will never work

* Prevent locks showing available when their bridge is offline

* Prevent door sensors from showing available when their bridge is offline

* Prevent creating door sensors for locks that do not have them

* Prevent doorbells showing unavailable when they are in standby mode

* Set SCAN_INTERVAL for binary_sensors to 5 seconds as
  data comes in from the activity endpoint more frequently

* Update homeassistant/components/august/__init__.py

raise if the detail is missing when checking doorsense

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

* Handle another place where the lock detail could not exist

* Address review comments

* Handle lock detail update failing and add test

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-02-18 12:11:05 -08:00
J. Nick Koston 00ac7a7d70
Provide user consumable errors when lock operations fail (#31864)
* Provide user consumable errors when lock operations fail

This resolves issue #26672

* include from in raise

* pylint

* Cleanup of mocking.
2020-02-17 10:30:14 -08:00
J. Nick Koston f6d9e6b6c5
Convert august to async so a token refresh lock can be used (#31848)
* Convert august to async so a token refresh lock can be used

* Update comment since we now have a lock

* Do not mock the lock

* Address review items
2020-02-15 21:08:52 -08: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
J. Nick Koston 54eb740ff6
Read door open/close events from the activity log. (#31732)
As polling for lock status is every 15 minutes,
we read lock and unlock events from the activity log.

An upstream update of py-august was needed to
expose the door open and close events.

Door open and close events are now seen within
a few seconds instead of delayed 15+ minutes.
2020-02-11 17:43:56 -08:00
J. Nick Koston ecd7ec385d
Significantly reduce the number of API calls that the august integration (#31685)
* Significantly reduce the number of API calls that the august integration
makes.

The poll interval for the lock status API is now 15 minutes
instead of every 10 seconds because we can use the activity
API to see changes in lock state.  The interval for the
activity API is 10 seconds which allows for the same
frequency of state monitoring without all the additional API calls.
With four locks, this change results in an ~80% reduction in the number
of API calls.

The result of the lock and unlock APIs now update the lock state instead
of waiting for the next poll.  This change also has the added benefit of
making the UI appear far more responsive.

* Convert to using UTC times
2020-02-11 17:57:26 +01:00
J. Nick Koston 0dd151c1c3
Resolve August integration makes too many requests and hits rate limits (#31558) 2020-02-08 20:22:48 +01:00
Ville Skyttä 5216477353
Be consistent with Home Assistant and Hass.io spelling (#30500)
* Be consistent with Home Assistant spelling

* Be consistent with Hass.io spelling
2020-01-05 14:09:17 +02:00
Ville Skyttä e6388e186c
Remove unnecessary string literal concatenations (#30360) 2020-01-02 21:17:10 +02:00
bouni bb80d9bd16 Move imports in august component (#27810) 2019-10-17 17:06:41 -07:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07:00
cgtobi 2c07bfb9e0 Remove dependencies and requirements (#23024)
* Remove dependencies and requirements

* Revert "Remove dependencies and requirements"

This reverts commit fe7171b4cd.

* Remove dependencies and requirements

* Revert "Remove dependencies and requirements"

This reverts commit 391355ee2c.

* Remove dependencies and requirements

* Fix flake8 complaints

* Fix more flake8 complaints

* Revert non-component removals
2019-04-12 10:13:30 -07:00
Fabian Affolter 127c55e0c1
Update file header (#21023)
* Update file header

* Update file header

* Update file header

* Update file header

* Update file header

* Fix lint issues
2019-02-13 21:21:14 +01:00
Paulus Schoutsen e2d3c27e85
Embed all platforms into components (#20677)
* Consolidate all components with platforms

* Organize tests

* Fix more tests

* Fix Verisure tests

* one final test fix

* Add change

* Fix coverage
2019-02-02 07:13:16 -08:00