Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add Homebox widget #3095

Merged
merged 4 commits into from
Mar 10, 2024
Merged

Conversation

cadeluca
Copy link
Contributor

Proposed change

Adds a Homebox service widget. Returns statistics (options are number of items, items with a warranty, locations, labels, users, and total value of items) for the user's group. Default values are set as ["items", "locations", "totalValue"]. Available fields, defaults, and config are noted in the added documentation.

Example:
image

This widget required implementation of a custom proxy to login, which it does by hitting the /users/login API endpoint. Then the /groups/statistics endpoint is used for the actual data and the /groups endpoint is used to retrieve the currency the user has configued in Homebox. This currency value is used for formatting the totalValue field.

Example API responses:
image
image
image

Closes #1389

Type of change

  • New service widget
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Documentation only
  • Other (please explain)

Checklist:

  • If applicable, I have added corresponding documentation changes.
  • If applicable, I have reviewed the feature and / or service widget guidelines.
    • As noted above, Homebox's API requires logging in to get a token for auth on requests, so it was necessary to add a custom proxy. I understand if the preference to avoid more custom proxies causes this to be rejected.
  • I have checked that all code style checks pass using pre-commit hooks and linting checks.
  • If applicable, I have tested my code for new features & regressions on both mobile & desktop devices, using the latest version of major browsers.

Copy link
Collaborator

@shamoon shamoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of having a custom proxy (that needs to be maintained) couldn’t we just use the token directly, ie ask users to supply that

Copy link
Collaborator

@shamoon shamoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m going to go ahead and request that the above change be made to accept this PR. It seems trivial to get the token with the bundled swagger ui and I think that’s all this proxy does.

Let us know if you need info/help

@cadeluca
Copy link
Contributor Author

cadeluca commented Mar 10, 2024

We cannot use the token directly, Homebox does not currently support long-lived API tokens. The auth token that gets retrieved expires in a week after fetch.

@shamoon shamoon enabled auto-merge (squash) March 10, 2024 20:23
Copy link
Collaborator

@shamoon shamoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh gotcha, I see that by testing it out (their docs are a bit slim). Thats certainly not your fault, so in that case what I meant to say instead was "Thanks" 😊

I added the token expiration for the cache, as you may have noticed.

Screenshot 2024-03-10 at 1 11 09 PM

@shamoon shamoon merged commit 2d5f936 into gethomepage:main Mar 10, 2024
5 checks passed
truecharts-admin added a commit to truecharts/charts that referenced this pull request Mar 11, 2024
…0.8.9@869c800 by renovate (#19065)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
|
[ghcr.io/gethomepage/homepage](https://togithub.com/gethomepage/homepage)
| patch | `v0.8.8` -> `v0.8.9` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>gethomepage/homepage (ghcr.io/gethomepage/homepage)</summary>

###
[`v0.8.9`](https://togithub.com/gethomepage/homepage/releases/tag/v0.8.9)

[Compare
Source](https://togithub.com/gethomepage/homepage/compare/v0.8.8...v0.8.9)

#### What's Changed

- Feature: Add list view for custom api by
[@&#8203;sgrtye](https://togithub.com/sgrtye) and
[@&#8203;shamoon](https://togithub.com/shamoon) in
[gethomepage/homepage#2891
- Change: use Script component instead of async script for custom.js by
[@&#8203;Cyberbeni](https://togithub.com/Cyberbeni) in
[gethomepage/homepage#2901
- Change: move custom.css linking to head to avoid FOUC by
[@&#8203;Cyberbeni](https://togithub.com/Cyberbeni) and
[@&#8203;shamoon](https://togithub.com/shamoon) in
[gethomepage/homepage#2916
- Enhancement: Add enablePools option to TrueNAS service widget by
[@&#8203;dstotz](https://togithub.com/dstotz) and
[@&#8203;shamoon](https://togithub.com/shamoon) in
[gethomepage/homepage#2908
- Enhancement: Add requestBody as option for customapi widget by
[@&#8203;dstotz](https://togithub.com/dstotz) in
[gethomepage/homepage#2921
- Enhancement: allow api auth with moonraker service by
[@&#8203;stevendejongnl](https://togithub.com/stevendejongnl) and
[@&#8203;shamoon](https://togithub.com/shamoon) in
[gethomepage/homepage#2934
- Add Plant-it widget by
[@&#8203;MDeLuise](https://togithub.com/MDeLuise) and
[@&#8203;shamoon](https://togithub.com/shamoon) in
[gethomepage/homepage#2941
- Chore(deps): Bump systeminformation from 5.21.24 to 5.22.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[gethomepage/homepage#2999
- Chore(deps-dev): Bump eslint from 8.56.0 to 8.57.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[gethomepage/homepage#3000
- Chore(deps-dev): Bump postcss from 8.4.33 to 8.4.35 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[gethomepage/homepage#3001
- Chore(deps): Bump recharts from 2.11.0 to 2.12.1 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[gethomepage/homepage#3002
- Fix: support cyrillic characters in quicklaunch by
[@&#8203;shamoon](https://togithub.com/shamoon) in
[gethomepage/homepage#3020
- Fix: docker status labels colors by
[@&#8203;RoboMagus](https://togithub.com/RoboMagus) and
[@&#8203;shamoon](https://togithub.com/shamoon) in
[gethomepage/homepage#3028
- Enhancement: Add formatting options to weather widgets by
[@&#8203;benphelps](https://togithub.com/benphelps) in
[gethomepage/homepage#3093
- Feature: Add Homebox widget by
[@&#8203;cadeluca](https://togithub.com/cadeluca) in
[gethomepage/homepage#3095

#### New Contributors

- [@&#8203;Cyberbeni](https://togithub.com/Cyberbeni) made their first
contribution in
[gethomepage/homepage#2901
- [@&#8203;dstotz](https://togithub.com/dstotz) made their first
contribution in
[gethomepage/homepage#2908
- [@&#8203;stevendejongnl](https://togithub.com/stevendejongnl) made
their first contribution in
[gethomepage/homepage#2934
- [@&#8203;MDeLuise](https://togithub.com/MDeLuise) made their first
contribution in
[gethomepage/homepage#2941
- [@&#8203;cadeluca](https://togithub.com/cadeluca) made their first
contribution in
[gethomepage/homepage#3095

**Full Changelog**:
gethomepage/homepage@v0.8.8...v0.8.9

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 10pm on monday" in timezone
Europe/Amsterdam, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yMzUuMSIsInVwZGF0ZWRJblZlciI6IjM3LjIzNS4xIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIn0=-->
denispapec pushed a commit to denispapec/homepage that referenced this pull request Mar 17, 2024
Copy link
Contributor

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion for related concerns. See our contributing guidelines for more details.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants