Commit Graph

30 Commits (148a7ff50cd2fbd9b05c2e8928459b546eeb98ef)

Author SHA1 Message Date
Ville Skyttä 5e90a4d000
Use more state attribute name constants (#40428) 2020-09-21 23:03:39 +02:00
J. Nick Koston 5ea04d64f6
Prompt to reauth when the august password is changed or token expires (#40103)
* Prompt to reauth when the august password is changed or token expires

* augment missing config flow coverage

* augment test coverage

* Adjust test

* Update homeassistant/components/august/__init__.py

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

* block until patch complete

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-09-16 17:35:01 +02:00
springstan d2b1918e9c
Drop UNIT_ prefix for percentage constant (#39383) 2020-09-05 21:09:14 +02:00
Franck Nijhof 1c2ebdf307
Upgrade black to 20.8b1 (#39287) 2020-08-27 13:56:20 +02:00
J. Nick Koston bf72e3c965
Update august manufacturer name (#37867)
* Update august manufacturer name

This allows homekit to link the accessories to the august app

* yeah.. update the test
2020-07-14 18:03:24 -10:00
Paulus Schoutsen 2af984917e
Use asynctest-mock in most places (#35109)
* Use asynctest-mock in most places

* Fix broken patch in pilight
2020-05-03 11:27:19 -07:00
J. Nick Koston 963236916c
Fix another race in august tests (#35054) 2020-05-01 21:01:15 -07:00
J. Nick Koston af62660b14
Attempt to fix flapping august lock test (#34998) 2020-04-30 22:35:23 -07:00
Paulus Schoutsen ec47216388
Use built-in test helpers on 3.8 (#34901) 2020-04-30 13:29:50 -07:00
J. Nick Koston 592f316b3f
Fix race condition in august test under py38 (#34775) 2020-04-28 23:22:33 -05:00
springstan 9f713dac7f
Use UNIT_PERCENTAGE constant (#34054) 2020-04-11 22:53:48 +02:00
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 eae21be5b9
Improve string formatting v6 (#33698) 2020-04-07 23:14:28 +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 ae147fd9c7
Lock operation sensors for August (#32593)
* adkj

* reduce

* Convert august to async

Async io was added to py-august 0.24

* Fix lint

* Lock operation sensors for august

* Tracking lock operation method allows user presence detection at the lock

* revert lock changes

* fix activity count merge conflict reversion

* Fix revert that come back with the conflict
2020-03-10 17:09:49 -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 7ca4665711
Move keypad battery implementation details into py-august (#32349)
* Move keypad battery implementation details into py-august

* Upgrade to py-august 0.22.0 which also adds gen2 doorbell battery data

* remove cruft from previous refactor
2020-03-01 23:22:28 -08:00
J. Nick Koston be14b94705
Restore august lock changed_by state on restart (#32340)
* Various code review items from previous PRs

* Add a test for fetching the doorbell camera image

* Switch to using UNIT_PERCENTAGE for battery charge unit

* Add tests for changed_by
2020-02-29 12:12:50 +01: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 4c33a9d732
Add model to august device_info (#32187)
* Add model to august device_info

* Address review comments from PR#32125

* Fix test name
2020-02-25 18:34:31 -08: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
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 6879105b14
Cleanup August activity processing and add tests (#31774)
* Update py-august to 0.12.0

* Upstream update also resolves issue #28960
2020-02-12 15:35:07 -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