homebridge-plugins / homebridge-august

The Homebridge August plugin allows you to access your August/Yale Locks from HomeKit with Homebridge.
ISC License
36 stars 9 forks source link

Feature Request: Reduce the number of calls to the August API. #67

Closed dacarson closed 1 year ago

dacarson commented 1 year ago

Problem

Every time the status of the lock is requested, two calls are made to the August API. I see homebridge-august making these calls to august-api when it refreshes the state of the lock: lockStatus: const lockStatus = await this.platform.august.status(this.device.lockId); which calls through to the august-api status object, which then does this: let { body } = await this.put(/remoteoperate/${lockId}/status) and lockDetails: const lockDetails = await this.platform.august.details(this.device.lockId); which calls through to august-api details object, which then does this: let { body } = await this.get(/locks/${lockId})

Solution

Almost all the data is available in the lockDetails call, except for if the lock is jammed (retryCount > 1). We should just use lockDetails and work out another way to handle a jammed lock.

Alternatives

No response

Additional context

Calls to the August API is rate limited, so reducing the number of calls to the API is a good thing in general. Also some people are running into issues when they have multiple locks, they hit the rate limit.

donavanbecker commented 1 year ago

Thanks for the fix!

donavanbecker commented 1 year ago

v1.2.0 has been released