Skip to content

Commit

Permalink
fix(hass): 🚨 fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuar committed Dec 21, 2024
1 parent e4ca6e7 commit 92b82d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/hass/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,14 @@ func Send[T any](ctx context.Context, url string, details Request) (T, error) {
if details.Retry() {
// If request needs to be retried, retry the request on any error.
logging.FromContext(ctx).Debug("Will retry requests.", slog.Any("body", details))

requestClient = requestClient.AddRetryCondition(
func(r *resty.Response, err error) bool {
func(_ *resty.Response, err error) bool {
if err != nil {
logging.FromContext(ctx).Debug("Retrying request.", slog.Any("body", details))
return true
}

return false
},
)
Expand Down
1 change: 1 addition & 0 deletions internal/hass/registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ func (r *registrationRequest) RequestBody() any {
return r.Device
}

// revive:disable:unused-receiver
func (r *registrationRequest) Retry() bool {
return true
}
Expand Down

0 comments on commit 92b82d0

Please sign in to comment.