Compare commits

...

55 commits

Author SHA1 Message Date
Stefan Agner
5059ff133e
Add Supervisor country (#165) 2025-04-29 11:37:24 +02:00
Stefan Agner
445707a903
Avoid caching when API call fails (#164) 2025-04-22 12:28:35 +02:00
Franck Nijhof
d70505aada
🎆 Updates maintenance/license year to 2025 (#161) 2025-02-16 12:09:54 +01:00
dependabot[bot]
e297fa5c2c
Bump release-drafter/release-drafter from 6.0.0 to 6.1.0 (#160) 2025-01-20 07:55:54 +01:00
dependabot[bot]
c6de3e5756
Bump frenck/action-yamllint from 1.4 to 1.5 (#156) 2024-02-19 07:50:29 +01:00
dependabot[bot]
b0219ef6f1
Bump release-drafter/release-drafter from 5.25.0 to 6.0.0 (#153) 2024-02-02 07:34:51 +01:00
hrzlgnm
2b21846d28
Fix typo in var.true() and var.false() documentation (#151) 2024-01-17 10:18:35 +01:00
hrzlgnm
dc3e044064
Fix duplicated bashio::network.enabled() function (#152) 2024-01-17 08:24:43 +01:00
Franck Nijhof
f3bd57130c
🎆 Updates maintenance/license year to 2024 (#150) 2024-01-06 22:41:28 +01:00
Bao
324f46b5c4
Fix exit code when calling supervisor api with raw=true (#148) 2023-12-08 10:14:39 +01:00
Bao
8b96a704cc
Fix arguments for sourced script (#147) 2023-12-08 10:13:11 +01:00
dependabot[bot]
68464b7655
Bump actions/stale from 8 to 9 (#149)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-08 08:51:27 +01:00
Bao
2de0c2304a
Properly quote replacment string in param expansion (#146) 2023-12-07 10:54:46 +01:00
dependabot[bot]
fe0f961efc
Bump dessant/lock-threads from 5.0.0 to 5.0.1 (#145)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-23 08:56:39 +01:00
dependabot[bot]
e98156103b
Bump dessant/lock-threads from 4.0.1 to 5.0.0 (#144)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-14 08:24:05 +01:00
Laszlo Magyar
52d3a9b40c
Fix comment/docs typo in info.state (#143) 2023-10-23 12:20:23 +02:00
Franck Nijhof
93e00b593e
Add method to request the state of Core (#142) 2023-10-22 17:07:55 +02:00
Dave T
2f86c63e60
Add error message for 403 error on API access (#139)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-10-22 17:01:30 +02:00
dependabot[bot]
30897c753a
Bump release-drafter/release-drafter from 5.24.0 to 5.25.0 (#141)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-17 17:07:51 +02:00
dependabot[bot]
818a04b905
Bump actionshub/markdownlint from 3.1.3 to 3.1.4 (#140)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-02 08:44:58 +02:00
dependabot[bot]
6644179728
Bump actions/checkout from 3 to 4 (#138)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-10 20:56:49 +02:00
dependabot[bot]
2860658149
Bump release-drafter/release-drafter from 5.23.0 to 5.24.0 (#137)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-29 08:49:02 +02:00
dependabot[bot]
726d3dc511
Bump dessant/lock-threads from 4.0.0 to 4.0.1 (#136)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-13 10:33:54 +02:00
Ville Skyttä
8861097209
Spelling and grammar fixes (#135) 2023-05-20 13:53:39 +02:00
Franck Nijhof
8114de4bbd
🎆 Updates maintenance/license year to 2023 (#134) 2023-05-12 08:23:10 +02:00
Franck Nijhof
239a59a2ca
Adjust shellcheck warnings (#133) 2023-05-12 08:20:36 +02:00
Felipe Santos
d3e2077093
Allow multiple lines in var.json (#104) 2023-05-12 08:09:14 +02:00
dependabot[bot]
854f8d646c
Bump actions/stale from 7 to 8 (#132)Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/stale](https://github.com/actions/stale) from 7 to 8.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v7...v8)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-26 13:23:01 +02:00
dependabot[bot]
efe813a251
Bump release-drafter/release-drafter from 5.22.0 to 5.23.0 (#130)Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5.22.0 to 5.23.0.
- [Release notes](https://github.com/release-drafter/release-drafter/releases)
- [Commits](https://github.com/release-drafter/release-drafter/compare/v5.22.0...v5.23.0)

---
updated-dependencies:
- dependency-name: release-drafter/release-drafter
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-22 07:55:53 +01:00
dependabot[bot]
848e6f88c1
Bump creyD/prettier_action from 4.2 to 4.3 (#129)Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [creyD/prettier_action](https://github.com/creyD/prettier_action) from 4.2 to 4.3.
- [Release notes](https://github.com/creyD/prettier_action/releases)
- [Commits](https://github.com/creyD/prettier_action/compare/v4.2...v4.3)

---
updated-dependencies:
- dependency-name: creyD/prettier_action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-20 11:55:43 +01:00
dependabot[bot]
b31320da4f
Bump actionshub/markdownlint from 3.0.2 to 3.1.3 (#128)Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actionshub/markdownlint](https://github.com/actionshub/markdownlint) from 3.0.2 to 3.1.3.
- [Release notes](https://github.com/actionshub/markdownlint/releases)
- [Commits](https://github.com/actionshub/markdownlint/compare/v3.0.2...v3.1.3)

---
updated-dependencies:
- dependency-name: actionshub/markdownlint
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-15 10:32:09 +01:00
dependabot[bot]
1430aaa8eb
⬆️ Bump actionshub/markdownlint from 2.1.2 to 3.0.2 (#126)
Bumps [actionshub/markdownlint](https://github.com/actionshub/markdownlint) from 2.1.2 to 3.0.2.
- [Release notes](https://github.com/actionshub/markdownlint/releases)
- [Commits](https://github.com/actionshub/markdownlint/compare/v2.1.2...v3.0.2)

---
updated-dependencies:
- dependency-name: actionshub/markdownlint
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-11 13:00:00 +01:00
dependabot[bot]
dd15a1e41d
⬆️ Bump frenck/action-yamllint from 1.3 to 1.4 (#123)
Bumps [frenck/action-yamllint](https://github.com/frenck/action-yamllint) from 1.3 to 1.4.
- [Release notes](https://github.com/frenck/action-yamllint/releases)
- [Commits](https://github.com/frenck/action-yamllint/compare/v1.3...v1.4)

---
updated-dependencies:
- dependency-name: frenck/action-yamllint
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-13 09:48:45 +01:00
dependabot[bot]
8c88a67db9
⬆️ Bump release-drafter/release-drafter from 5.21.1 to 5.22.0 (#122)
Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5.21.1 to 5.22.0.
- [Release notes](https://github.com/release-drafter/release-drafter/releases)
- [Commits](https://github.com/release-drafter/release-drafter/compare/v5.21.1...v5.22.0)

---
updated-dependencies:
- dependency-name: release-drafter/release-drafter
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-03 10:53:51 +01:00
dependabot[bot]
780232345e
⬆️ Bump actions/stale from 6 to 7 (#121)
Bumps [actions/stale](https://github.com/actions/stale) from 6 to 7.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-21 08:29:56 +01:00
dependabot[bot]
6548123dad
⬆️ Bump actionshub/markdownlint from 2.0.2 to 2.1.2 (#120)
Bumps [actionshub/markdownlint](https://github.com/actionshub/markdownlint) from 2.0.2 to 2.1.2.
- [Release notes](https://github.com/actionshub/markdownlint/releases)
- [Commits](https://github.com/actionshub/markdownlint/compare/2.0.2...v2.1.2)

---
updated-dependencies:
- dependency-name: actionshub/markdownlint
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-19 09:09:08 +01:00
dependabot[bot]
30c4b35fa2
⬆️ Bump dessant/lock-threads from 3.0.0 to 4.0.0 (#118)
Bumps [dessant/lock-threads](https://github.com/dessant/lock-threads) from 3.0.0 to 4.0.0.
- [Release notes](https://github.com/dessant/lock-threads/releases)
- [Changelog](https://github.com/dessant/lock-threads/blob/master/CHANGELOG.md)
- [Commits](https://github.com/dessant/lock-threads/compare/v3.0.0...v4.0.0)

---
updated-dependencies:
- dependency-name: dessant/lock-threads
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-05 09:22:21 +01:00
dependabot[bot]
5338104d2a
⬆️ Bump release-drafter/release-drafter from 5.21.0 to 5.21.1 (#117)
Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5.21.0 to 5.21.1.
- [Release notes](https://github.com/release-drafter/release-drafter/releases)
- [Commits](https://github.com/release-drafter/release-drafter/compare/v5.21.0...v5.21.1)

---
updated-dependencies:
- dependency-name: release-drafter/release-drafter
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-18 17:39:04 +02:00
dependabot[bot]
f8fc8555b9
⬆️ Bump actions/stale from 5 to 6 (#116)
Bumps [actions/stale](https://github.com/actions/stale) from 5 to 6.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-22 09:15:12 +02:00
dependabot[bot]
04c052828d
⬆️ Bump release-drafter/release-drafter from 5.20.1 to 5.21.0 (#115)
Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5.20.1 to 5.21.0.
- [Release notes](https://github.com/release-drafter/release-drafter/releases)
- [Commits](https://github.com/release-drafter/release-drafter/compare/v5.20.1...v5.21.0)

---
updated-dependencies:
- dependency-name: release-drafter/release-drafter
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-16 08:17:14 +02:00
dependabot[bot]
b4522f150d
⬆️ Bump frenck/action-yamllint from 1.2 to 1.3 (#114)
Bumps [frenck/action-yamllint](https://github.com/frenck/action-yamllint) from 1.2 to 1.3.
- [Release notes](https://github.com/frenck/action-yamllint/releases)
- [Commits](https://github.com/frenck/action-yamllint/compare/v1.2...v1.3)

---
updated-dependencies:
- dependency-name: frenck/action-yamllint
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-15 10:01:58 +02:00
dependabot[bot]
5a1278193e
⬆️ Bump release-drafter/release-drafter from 5.20.0 to 5.20.1 (#112)
Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5.20.0 to 5.20.1.
- [Release notes](https://github.com/release-drafter/release-drafter/releases)
- [Commits](https://github.com/release-drafter/release-drafter/compare/v5.20.0...v5.20.1)

---
updated-dependencies:
- dependency-name: release-drafter/release-drafter
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-17 08:43:53 +02:00
dependabot[bot]
167216925b
⬆️ Bump frenck/action-yamllint from 1.1 to 1.2 (#110)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-12 08:45:38 +02:00
dependabot[bot]
38bed6bc6b
⬆️ Bump release-drafter/release-drafter from 5.19.0 to 5.20.0 (#107)
Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5.19.0 to 5.20.0.
- [Release notes](https://github.com/release-drafter/release-drafter/releases)
- [Commits](https://github.com/release-drafter/release-drafter/compare/v5.19.0...v5.20.0)

---
updated-dependencies:
- dependency-name: release-drafter/release-drafter
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-12 09:50:16 +02:00
dependabot[bot]
60cabe22b7
⬆️ Bump actions/stale from 4 to 5 (#106)
Bumps [actions/stale](https://github.com/actions/stale) from 4 to 5.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-11 13:01:34 +02:00
dependabot[bot]
4e7c05b062
⬆️ Bump release-drafter/release-drafter from 5.18.1 to 5.19.0 (#105)
Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5.18.1 to 5.19.0.
- [Release notes](https://github.com/release-drafter/release-drafter/releases)
- [Commits](https://github.com/release-drafter/release-drafter/compare/v5.18.1...v5.19.0)

---
updated-dependencies:
- dependency-name: release-drafter/release-drafter
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-08 08:27:22 +01:00
dependabot[bot]
77a233097e
⬆️ Bump actions/checkout from 2.4.0 to 3 (#102)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2.4.0 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2.4.0...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-02 09:24:29 +01:00
dependabot[bot]
9e2fc434ed
⬆️ Bump release-drafter/release-drafter from 5.18.0 to 5.18.1 (#100)
Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5.18.0 to 5.18.1.
- [Release notes](https://github.com/release-drafter/release-drafter/releases)
- [Commits](https://github.com/release-drafter/release-drafter/compare/v5.18.0...v5.18.1)

---
updated-dependencies:
- dependency-name: release-drafter/release-drafter
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-07 08:52:15 +01:00
dependabot[bot]
7ffe92b5af
⬆️ Bump release-drafter/release-drafter from 5.17.6 to 5.18.0 (#99)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-04 08:58:15 +01:00
dependabot[bot]
440e332cb1
⬆️ Bump release-drafter/release-drafter from 5.17.5 to 5.17.6 (#98)
Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5.17.5 to 5.17.6.
- [Release notes](https://github.com/release-drafter/release-drafter/releases)
- [Commits](https://github.com/release-drafter/release-drafter/compare/v5.17.5...v5.17.6)

---
updated-dependencies:
- dependency-name: release-drafter/release-drafter
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-20 08:54:54 +01:00
dependabot[bot]
c07f6d51d1
⬆️ Bump creyD/prettier_action from 4.1.1 to 4.2 (#96)
Bumps [creyD/prettier_action](https://github.com/creyD/prettier_action) from 4.1.1 to 4.2.
- [Release notes](https://github.com/creyD/prettier_action/releases)
- [Commits](https://github.com/creyD/prettier_action/compare/v4.1.1...v4.2)

---
updated-dependencies:
- dependency-name: creyD/prettier_action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-17 11:19:11 +01:00
dependabot[bot]
8b59f043a0
⬆️ Bump release-drafter/release-drafter from 5.16.1 to 5.17.5 (#97)
Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5.16.1 to 5.17.5.
- [Release notes](https://github.com/release-drafter/release-drafter/releases)
- [Commits](https://github.com/release-drafter/release-drafter/compare/v5.16.1...v5.17.5)

---
updated-dependencies:
- dependency-name: release-drafter/release-drafter
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-17 10:53:35 +01:00
dependabot[bot]
8b304f8d25
⬆️ Bump release-drafter/release-drafter from 5.15.0 to 5.16.1 (#95)
Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5.15.0 to 5.16.1.
- [Release notes](https://github.com/release-drafter/release-drafter/releases)
- [Commits](https://github.com/release-drafter/release-drafter/compare/v5.15.0...v5.16.1)

---
updated-dependencies:
- dependency-name: release-drafter/release-drafter
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-13 09:29:31 +01:00
dependabot[bot]
4b8587093e
⬆️ Bump creyD/prettier_action from 4.0 to 4.1.1 (#93)
Bumps [creyD/prettier_action](https://github.com/creyD/prettier_action) from 4.0 to 4.1.1.
- [Release notes](https://github.com/creyD/prettier_action/releases)
- [Commits](https://github.com/creyD/prettier_action/compare/v4.0...v4.1.1)

---
updated-dependencies:
- dependency-name: creyD/prettier_action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-07 08:24:42 +01:00
Franck Nijhof
69608c0d12
Fix processing of empty add-on config (#91) 2021-11-10 11:39:31 +01:00
39 changed files with 248 additions and 77 deletions

View file

@ -17,16 +17,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v2.4.0
uses: actions/checkout@v4
- name: 🚀 Run mdl
uses: actionshub/markdownlint@2.0.2
uses: actionshub/markdownlint@v3.1.4
lint-shellcheck:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v2.4.0
uses: actions/checkout@v4
- name: 🚀 Run Shellcheck
uses: ludeeus/action-shellcheck@1.1.0
env:
@ -37,18 +37,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v2.4.0
uses: actions/checkout@v4
- name: 🚀 Run YAMLLint
uses: frenck/action-yamllint@v1.1
uses: frenck/action-yamllint@v1.5
lint-prettier:
name: Prettier
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v2.4.0
uses: actions/checkout@v4
- name: 🚀 Run Prettier
uses: creyD/prettier_action@v4.0
uses: creyD/prettier_action@v4.3
with:
prettier_options: --write **/*.{json,js,md,yaml}
env:

View file

@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v2.4.0
uses: actions/checkout@v4
- name: 🚀 Run Label Syncer
uses: micnncim/action-label-syncer@v1.3.0
env:

View file

@ -12,7 +12,7 @@ jobs:
name: 🔒 Lock closed issues and PRs
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v3.0.0
- uses: dessant/lock-threads@v5.0.1
with:
github-token: ${{ github.token }}
issue-inactive-days: "30"

View file

@ -13,6 +13,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 🚀 Run Release Drafter
uses: release-drafter/release-drafter@v5.15.0
uses: release-drafter/release-drafter@v6.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View file

@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 🚀 Run stale
uses: actions/stale@v4
uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 30

View file

@ -1,6 +1,6 @@
# MIT License
Copyright (c) 2019-2021 Franck Nijhof
Copyright (c) 2019-2025 Franck Nijhof
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View file

@ -147,7 +147,7 @@ check [the contributor's page][contributors].
MIT License
Copyright (c) 2019-2021 Franck Nijhof
Copyright (c) 2019-2025 Franck Nijhof
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@ -185,7 +185,7 @@ SOFTWARE.
[issue]: https://github.com/hassio-addons/bashio/issues
[keepchangelog]: http://keepachangelog.com/en/1.0.0/
[license-shield]: https://img.shields.io/github/license/hassio-addons/bashio.svg
[maintenance-shield]: https://img.shields.io/maintenance/yes/2021.svg
[maintenance-shield]: https://img.shields.io/maintenance/yes/2025.svg
[patreon-shield]: https://frenck.dev/wp-content/uploads/2019/12/patreon.png
[patreon]: https://www.patreon.com/frenck
[project-stage-shield]: https://img.shields.io/badge/project%20stage-experimental-yellow.svg

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# ==============================================================================
# Home Assistant Community Add-ons: Bashio
# Bashio is an bash function library for use with Home Assistant add-ons.
# Bashio is a bash function library for use with Home Assistant add-ons.
#
# It contains a set of commonly used operations and can be used
# to be included in add-on scripts to reduce code duplication across add-ons.
@ -164,6 +164,10 @@ function bashio::addons() {
info=$(bashio::cache.get 'addons.list')
else
info=$(bashio::api.supervisor GET "/addons" false)
if [ "$?" -ne "${__BASHIO_EXIT_OK}" ]; then
bashio::log.error "Failed to get addons from Supervisor API"
return "${__BASHIO_EXIT_NOK}"
fi
bashio::cache.set "addons.list" "${info}"
fi
else
@ -171,6 +175,10 @@ function bashio::addons() {
info=$(bashio::cache.get "addons.${slug}.info")
else
info=$(bashio::api.supervisor GET "/addons/${slug}/info" false)
if [ "$?" -ne "${__BASHIO_EXIT_OK}" ]; then
bashio::log.error "Failed to get addon info from Supervisor API"
return "${__BASHIO_EXIT_NOK}"
fi
bashio::cache.set "addons.${slug}.info" "${info}"
fi
fi
@ -311,7 +319,7 @@ function bashio::addon.url() {
}
# ------------------------------------------------------------------------------
# Returns the deatched state of an add-on.
# Returns the detached state of an add-on.
#
# Arguments:
# $1 Add-on slug (optional, default: self)
@ -562,6 +570,14 @@ function bashio::addon.config() {
response=$(bashio::api.supervisor GET "/addons/self/options/config" false)
# If the add-on has no configuration, it returns an empty string.
# This is Bashio logic, that is problematic in this case, so make it a
# emtpty JSON object instead.
if bashio::var.is_empty "${response}";
then
response="{}"
fi
bashio::cache.set "${cache_key}" "${response}"
printf "%s" "${response}"
@ -595,7 +611,7 @@ function bashio::addon.network_description() {
}
# ------------------------------------------------------------------------------
# Returns a user configured port number for a original port number.
# Returns a user configured port number for an original port number.
#
# Arguments:
# $1 Original port number
@ -775,7 +791,7 @@ function bashio::addon.usb() {
}
# ------------------------------------------------------------------------------
# Returns whether or not this add-on has a icon available.
# Returns whether or not this add-on has an icon available.
#
# Arguments:
# $1 Add-on slug
@ -1194,6 +1210,10 @@ function bashio::addon.stats() {
info=$(bashio::cache.get "addons.${slug}.stats")
else
info=$(bashio::api.supervisor GET "/addons/${slug}/stats" false)
if [ "$?" -ne "${__BASHIO_EXIT_OK}" ]; then
bashio::log.error "Failed to get addon stats from Supervisor API"
return "${__BASHIO_EXIT_NOK}"
fi
bashio::cache.set "addons.${slug}.stats" "${info}"
fi

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# ==============================================================================
# Home Assistant Community Add-ons: Bashio
# Bashio is an bash function library for use with Home Assistant add-ons.
# Bashio is a bash function library for use with Home Assistant add-ons.
#
# It contains a set of commonly used operations and can be used
# to be included in add-on scripts to reduce code duplication across add-ons.
@ -64,6 +64,11 @@ function bashio::api.supervisor() {
return "${__BASHIO_EXIT_NOK}"
fi
if [[ "${status}" -eq 403 ]]; then
bashio::log.error "Unable to access the API, forbidden"
return "${__BASHIO_EXIT_NOK}"
fi
if [[ "${status}" -eq 404 ]]; then
bashio::log.error "Requested resource ${resource} was not found"
return "${__BASHIO_EXIT_NOK}"
@ -82,13 +87,13 @@ function bashio::api.supervisor() {
fi
if [[ "${status}" -ne 200 ]]; then
bashio::log.error "Unknown HTTP error occured"
bashio::log.error "Unknown HTTP error occurred"
return "${__BASHIO_EXIT_NOK}"
fi
if bashio::var.true "${raw}"; then
echo "${response}"
return "${__BASHIO_EXIT_NOK}"
return "${__BASHIO_EXIT_OK}"
fi
result=$(bashio::jq "${response}" 'if .data == {} then empty else .data end')

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# ==============================================================================
# Home Assistant Community Add-ons: Bashio
# Bashio is an bash function library for use with Home Assistant add-ons.
# Bashio is a bash function library for use with Home Assistant add-ons.
#
# It contains a set of commonly used operations and can be used
# to be included in add-on scripts to reduce code duplication across add-ons.
@ -77,6 +77,10 @@ function bashio::audio() {
info=$(bashio::cache.get 'audio.info')
else
info=$(bashio::api.supervisor GET /audio/info false)
if [ "$?" -ne "${__BASHIO_EXIT_OK}" ]; then
bashio::log.error "Failed to get audio info from Supervisor API"
return "${__BASHIO_EXIT_NOK}"
fi
bashio::cache.set 'audio.info' "${info}"
fi
@ -147,6 +151,10 @@ function bashio::audio.stats() {
info=$(bashio::cache.get 'audio.stats')
else
info=$(bashio::api.supervisor GET /audio/stats false)
if [ "$?" -ne "${__BASHIO_EXIT_OK}" ]; then
bashio::log.error "Failed to get audio stats from Supervisor API"
return "${__BASHIO_EXIT_NOK}"
fi
bashio::cache.set 'audio.stats' "${info}"
fi

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# ==============================================================================
# Home Assistant Community Add-ons: Bashio
# Bashio is an bash function library for use with Home Assistant add-ons.
# Bashio is a bash function library for use with Home Assistant add-ons.
#
# It contains a set of commonly used operations and can be used
# to be included in add-on scripts to reduce code duplication across add-ons.
@ -22,5 +22,7 @@ __BASHIO_LIB_DIR=$(dirname "${__BASHIO_BIN}")
source "${__BASHIO_LIB_DIR}/bashio.sh"
# Execute source
BASH_ARGV0=${1:?script to source must be provided}
shift
# shellcheck source=/dev/null
source "$@"
source "$0" "$@"

View file

@ -2,7 +2,7 @@
# shellcheck disable=SC2034,SC2155
# ==============================================================================
# Home Assistant Community Add-ons: Bashio
# Bashio is an bash function library for use with Home Assistant add-ons.
# Bashio is a bash function library for use with Home Assistant add-ons.
#
# It contains a set of commonly used operations and can be used
# to be included in add-on scripts to reduce code duplication across add-ons.

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# ==============================================================================
# Home Assistant Community Add-ons: Bashio
# Bashio is an bash function library for use with Home Assistant add-ons.
# Bashio is a bash function library for use with Home Assistant add-ons.
#
# It contains a set of commonly used operations and can be used
# to be included in add-on scripts to reduce code duplication across add-ons.

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# ==============================================================================
# Home Assistant Community Add-ons: Bashio
# Bashio is an bash function library for use with Home Assistant add-ons.
# Bashio is a bash function library for use with Home Assistant add-ons.
#
# It contains a set of commonly used operations and can be used
# to be included in add-on scripts to reduce code duplication across add-ons.
@ -51,6 +51,10 @@ function bashio::cli() {
info=$(bashio::cache.get 'cli.info')
else
info=$(bashio::api.supervisor GET /cli/info false)
if [ "$?" -ne "${__BASHIO_EXIT_OK}" ]; then
bashio::log.error "Failed to get cli info from Supervisor API"
return "${__BASHIO_EXIT_NOK}"
fi
bashio::cache.set 'cli.info' "${info}"
fi
@ -113,6 +117,10 @@ function bashio::cli.stats() {
info=$(bashio::cache.get 'cli.stats')
else
info=$(bashio::api.supervisor GET /cli/stats false)
if [ "$?" -ne "${__BASHIO_EXIT_OK}" ]; then
bashio::log.error "Failed to get cli stats from Supervisor API"
return "${__BASHIO_EXIT_NOK}"
fi
bashio::cache.set 'cli.stats' "${info}"
fi

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# ==============================================================================
# Home Assistant Community Add-ons: Bashio
# Bashio is an bash function library for use with Home Assistant add-ons.
# Bashio is a bash function library for use with Home Assistant add-ons.
#
# It contains a set of commonly used operations and can be used
# to be included in add-on scripts to reduce code duplication across add-ons.

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# ==============================================================================
# Home Assistant Community Add-ons: Bashio
# Bashio is an bash function library for use with Home Assistant add-ons.
# Bashio is a bash function library for use with Home Assistant add-ons.
#
# It contains a set of commonly used operations and can be used
# to be included in add-on scripts to reduce code duplication across add-ons.
@ -544,13 +544,13 @@ function bashio::config.require.ssl() {
if bashio::config.is_empty "${certfile}"; then
bashio::log.fatal
bashio::log.fatal "SSL has been enabled using the '${key}' option,"
bashio::log.fatal "this requires a SSL certificate file which is"
bashio::log.fatal "this requires an SSL certificate file which is"
bashio::log.fatal "configured using the '${certfile}' option in the"
bashio::log.fatal "add-on configuration."
bashio::log.fatal
bashio::log.fatal "Unfortunately, the '${certfile}' option is empty."
bashio::log.fatal
bashio::log.fatal "Consider configuring or getting a SSL certificate"
bashio::log.fatal "Consider configuring or getting an SSL certificate"
bashio::log.fatal "or setting the '${key}' option to 'false' in case"
bashio::log.fatal "you are not planning on using SSL with this add-on."
bashio::log.fatal
@ -563,13 +563,13 @@ function bashio::config.require.ssl() {
if bashio::config.is_empty "${keyfile}"; then
bashio::log.fatal
bashio::log.fatal "SSL has been enabled using the '${key}' option,"
bashio::log.fatal "this requires a SSL certificate key file which is"
bashio::log.fatal "this requires an SSL certificate key file which is"
bashio::log.fatal "configured using the '${keyfile}' option in the"
bashio::log.fatal "add-on configuration."
bashio::log.fatal
bashio::log.fatal "Unfortunately, the '${keyfile}' option is empty."
bashio::log.fatal
bashio::log.fatal "Consider configuring or getting a SSL certificate"
bashio::log.fatal "Consider configuring or getting an SSL certificate"
bashio::log.fatal "or setting the '${key}' option to 'false' in case"
bashio::log.fatal "you are not planning on using SSL with this add-on."
bashio::log.fatal
@ -582,18 +582,18 @@ function bashio::config.require.ssl() {
if ! bashio::fs.file_exists "/ssl/$(bashio::config "${certfile}")"; then
bashio::log.fatal
bashio::log.fatal "SSL has been enabled using the '${key}' option,"
bashio::log.fatal "this requires a SSL certificate file which is"
bashio::log.fatal "this requires an SSL certificate file which is"
bashio::log.fatal "configured using the '${certfile}' option in the"
bashio::log.fatal "add-on configuration."
bashio::log.fatal
bashio::log.fatal "Unfortunately, the file specified in the"
bashio::log.fatal "'${certfile}' option does not exists."
bashio::log.fatal "'${certfile}' option does not exist."
bashio::log.fatal
bashio::log.fatal "Please ensure the certificate file exists and"
bashio::log.fatal "is placed in the '/ssl/' directory."
bashio::log.fatal
bashio::log.fatal "In case you don't have SSL yet, consider getting"
bashio::log.fatal "a SSL certificate or setting the '${key}' option"
bashio::log.fatal "an SSL certificate or setting the '${key}' option"
bashio::log.fatal "to 'false' in case you are not planning on using"
bashio::log.fatal "SSL with this add-on."
bashio::log.fatal
@ -606,18 +606,18 @@ function bashio::config.require.ssl() {
if ! bashio::fs.file_exists "/ssl/$(bashio::config "${keyfile}")"; then
bashio::log.fatal
bashio::log.fatal "SSL has been enabled using the '${key}' option,"
bashio::log.fatal "this requires a SSL certificate key file which is"
bashio::log.fatal "this requires an SSL certificate key file which is"
bashio::log.fatal "configured using the '${keyfile}' option in the"
bashio::log.fatal "add-on configuration."
bashio::log.fatal
bashio::log.fatal "Unfortunately, the file specified in the"
bashio::log.fatal "'${keyfile}' option does not exists."
bashio::log.fatal "'${keyfile}' option does not exist."
bashio::log.fatal
bashio::log.fatal "Please ensure the certificate key file exists and"
bashio::log.fatal "is placed in the '/ssl/' directory."
bashio::log.fatal
bashio::log.fatal "In case you don't have SSL yet, consider getting"
bashio::log.fatal "a SSL certificate or setting the '${key}' option"
bashio::log.fatal "an SSL certificate or setting the '${key}' option"
bashio::log.fatal "to 'false' in case you are not planning on using"
bashio::log.fatal "SSL with this add-on."
bashio::log.fatal

View file

@ -1,8 +1,8 @@
#!/usr/bin/env bash
# shellcheck disable=SC2034
# shellcheck disable=SC2004,SC2034
# ==============================================================================
# Home Assistant Community Add-ons: Bashio
# Bashio is an bash function library for use with Home Assistant add-ons.
# Bashio is a bash function library for use with Home Assistant add-ons.
#
# It contains a set of commonly used operations and can be used
# to be included in add-on scripts to reduce code duplication across add-ons.

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# ==============================================================================
# Home Assistant Community Add-ons: Bashio
# Bashio is an bash function library for use with Home Assistant add-ons.
# Bashio is a bash function library for use with Home Assistant add-ons.
#
# It contains a set of commonly used operations and can be used
# to be included in add-on scripts to reduce code duplication across add-ons.
@ -99,6 +99,10 @@ function bashio::core() {
info=$(bashio::cache.get 'core.info')
else
info=$(bashio::api.supervisor GET /core/info false)
if [ "$?" -ne "${__BASHIO_EXIT_OK}" ]; then
bashio::log.error "Failed to get core info from Supervisor API"
return "${__BASHIO_EXIT_NOK}"
fi
bashio::cache.set 'core.info' "${info}"
fi
@ -249,6 +253,10 @@ function bashio::core.stats() {
info=$(bashio::cache.get 'core.stats')
else
info=$(bashio::api.supervisor GET /core/stats false)
if [ "$?" -ne "${__BASHIO_EXIT_OK}" ]; then
bashio::log.error "Failed to get core stats from Supervisor API"
return "${__BASHIO_EXIT_NOK}"
fi
bashio::cache.set 'core.stats' "${info}"
fi

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# ==============================================================================
# Home Assistant Community Add-ons: Bashio
# Bashio is an bash function library for use with Home Assistant add-ons.
# Bashio is a bash function library for use with Home Assistant add-ons.
#
# It contains a set of commonly used operations and can be used
# to be included in add-on scripts to reduce code duplication across add-ons.

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# ==============================================================================
# Home Assistant Community Add-ons: Bashio
# Bashio is an bash function library for use with Home Assistant add-ons.
# Bashio is a bash function library for use with Home Assistant add-ons.
#
# It contains a set of commonly used operations and can be used
# to be included in add-on scripts to reduce code duplication across add-ons.

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# ==============================================================================
# Home Assistant Community Add-ons: Bashio
# Bashio is an bash function library for use with Home Assistant add-ons.
# Bashio is a bash function library for use with Home Assistant add-ons.
#
# It contains a set of commonly used operations and can be used
# to be included in add-on scripts to reduce code duplication across add-ons.
@ -77,6 +77,10 @@ function bashio::dns() {
info=$(bashio::cache.get 'dns.info')
else
info=$(bashio::api.supervisor GET /dns/info false)
if [ "$?" -ne "${__BASHIO_EXIT_OK}" ]; then
bashio::log.error "Failed to get dns info from Supervisor API"
return "${__BASHIO_EXIT_NOK}"
fi
bashio::cache.set 'dns.info' "${info}"
fi
@ -163,6 +167,10 @@ function bashio::dns.stats() {
info=$(bashio::cache.get 'dns.stats')
else
info=$(bashio::api.supervisor GET /dns/stats false)
if [ "$?" -ne "${__BASHIO_EXIT_OK}" ]; then
bashio::log.error "Failed to get dns stats from Supervisor API"
return "${__BASHIO_EXIT_NOK}"
fi
bashio::cache.set 'dns.stats' "${info}"
fi

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# ==============================================================================
# Home Assistant Community Add-ons: Bashio
# Bashio is an bash function library for use with Home Assistant add-ons.
# Bashio is a bash function library for use with Home Assistant add-ons.
#
# It contains a set of commonly used operations and can be used
# to be included in add-on scripts to reduce code duplication across add-ons.

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# ==============================================================================
# Home Assistant Community Add-ons: Bashio
# Bashio is an bash function library for use with Home Assistant add-ons.
# Bashio is a bash function library for use with Home Assistant add-ons.
#
# It contains a set of commonly used operations and can be used
# to be included in add-on scripts to reduce code duplication across add-ons.

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# ==============================================================================
# Home Assistant Community Add-ons: Bashio
# Bashio is an bash function library for use with Home Assistant add-ons.
# Bashio is a bash function library for use with Home Assistant add-ons.
#
# It contains a set of commonly used operations and can be used
# to be included in add-on scripts to reduce code duplication across add-ons.
@ -31,6 +31,10 @@ function bashio::hardware() {
info=$(bashio::cache.get 'hardware.info')
else
info=$(bashio::api.supervisor GET /hardware/info false)
if [ "$?" -ne "${__BASHIO_EXIT_OK}" ]; then
bashio::log.error "Failed to get hardware info from Supervisor API"
return "${__BASHIO_EXIT_NOK}"
fi
bashio::cache.set 'hardware.info' "${info}"
fi

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# ==============================================================================
# Home Assistant Community Add-ons: Bashio
# Bashio is an bash function library for use with Home Assistant add-ons.
# Bashio is a bash function library for use with Home Assistant add-ons.
#
# It contains a set of commonly used operations and can be used
# to be included in add-on scripts to reduce code duplication across add-ons.
@ -63,6 +63,10 @@ function bashio::host() {
info=$(bashio::cache.get 'host.info')
else
info=$(bashio::api.supervisor GET /host/info false)
if [ "$?" -ne "${__BASHIO_EXIT_OK}" ]; then
bashio::log.error "Failed to get host info from Supervisor API"
return "${__BASHIO_EXIT_NOK}"
fi
bashio::cache.set 'host.info' "${info}"
fi

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# ==============================================================================
# Home Assistant Community Add-ons: Bashio
# Bashio is an bash function library for use with Home Assistant add-ons.
# Bashio is a bash function library for use with Home Assistant add-ons.
#
# It contains a set of commonly used operations and can be used
# to be included in add-on scripts to reduce code duplication across add-ons.
@ -31,6 +31,10 @@ function bashio::info() {
info=$(bashio::cache.get 'info')
else
info=$(bashio::api.supervisor GET /info false)
if [ "$?" -ne "${__BASHIO_EXIT_OK}" ]; then
bashio::log.error "Failed to get info from Supervisor API"
return "${__BASHIO_EXIT_NOK}"
fi
bashio::cache.set 'info' "${info}"
fi
@ -148,3 +152,11 @@ function bashio::info.operating_system() {
bashio::log.trace "${FUNCNAME[0]}"
bashio::info 'supervisor.info.operating_system' '.operating_system'
}
# ------------------------------------------------------------------------------
# Returns the current state of Home Assistant Supervisor
# ------------------------------------------------------------------------------
function bashio::info.state() {
bashio::log.trace "${FUNCNAME[0]}"
bashio::info 'supervisor.info.running' '.state'
}

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# ==============================================================================
# Home Assistant Community Add-ons: Bashio
# Bashio is an bash function library for use with Home Assistant add-ons.
# Bashio is a bash function library for use with Home Assistant add-ons.
#
# It contains a set of commonly used operations and can be used
# to be included in add-on scripts to reduce code duplication across add-ons.

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# ==============================================================================
# Home Assistant Community Add-ons: Bashio
# Bashio is an bash function library for use with Home Assistant add-ons.
# Bashio is a bash function library for use with Home Assistant add-ons.
#
# It contains a set of commonly used operations and can be used
# to be included in add-on scripts to reduce code duplication across add-ons.
@ -111,9 +111,9 @@ function bashio::log.log() {
timestamp=$(date +"${__BASHIO_LOG_TIMESTAMP}")
output="${__BASHIO_LOG_FORMAT}"
output="${output//\{TIMESTAMP\}/${timestamp}}"
output="${output//\{MESSAGE\}/${message}}"
output="${output//\{LEVEL\}/${__BASHIO_LOG_LEVELS[$level]}}"
output="${output//\{TIMESTAMP\}/"${timestamp}"}"
output="${output//\{MESSAGE\}/"${message}"}"
output="${output//\{LEVEL\}/"${__BASHIO_LOG_LEVELS[$level]}"}"
echo -e "${output}" >&2

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# ==============================================================================
# Home Assistant Community Add-ons: Bashio
# Bashio is an bash function library for use with Home Assistant add-ons.
# Bashio is a bash function library for use with Home Assistant add-ons.
#
# It contains a set of commonly used operations and can be used
# to be included in add-on scripts to reduce code duplication across add-ons.
@ -68,6 +68,10 @@ function bashio::multicast() {
info=$(bashio::cache.get 'multicast.info')
else
info=$(bashio::api.supervisor GET /multicast/info false)
if [ "$?" -ne "${__BASHIO_EXIT_OK}" ]; then
bashio::log.error "Failed to get multicast info from Supervisor API"
return "${__BASHIO_EXIT_NOK}"
fi
bashio::cache.set 'multicast.info' "${info}"
fi
@ -130,6 +134,10 @@ function bashio::multicast.stats() {
info=$(bashio::cache.get 'multicast.stats')
else
info=$(bashio::api.supervisor GET /multicast/stats false)
if [ "$?" -ne "${__BASHIO_EXIT_OK}" ]; then
bashio::log.error "Failed to get multicast stats from Supervisor API"
return "${__BASHIO_EXIT_NOK}"
fi
bashio::cache.set 'multicast.stats' "${info}"
fi

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# ==============================================================================
# Home Assistant Community Add-ons: Bashio
# Bashio is an bash function library for use with Home Assistant add-ons.
# Bashio is a bash function library for use with Home Assistant add-ons.
#
# It contains a set of commonly used operations and can be used
# to be included in add-on scripts to reduce code duplication across add-ons.

View file

@ -1,7 +1,8 @@
#!/usr/bin/env bash
# shellcheck disable=SC2317
# ==============================================================================
# Home Assistant Community Add-ons: Bashio
# Bashio is an bash function library for use with Home Assistant add-ons.
# Bashio is a bash function library for use with Home Assistant add-ons.
#
# It contains a set of commonly used operations and can be used
# to be included in add-on scripts to reduce code duplication across add-ons.
@ -40,6 +41,10 @@ function bashio::network() {
info=$(bashio::cache.get 'network.info')
else
info=$(bashio::api.supervisor GET /network/info false)
if [ "$?" -ne "${__BASHIO_EXIT_OK}" ]; then
bashio::log.error "Failed to get network info from Supervisor API"
return "${__BASHIO_EXIT_NOK}"
fi
bashio::cache.set 'network.info' "${info}"
fi
@ -104,6 +109,10 @@ function bashio::network.interface() {
info=$(bashio::cache.get "network.interface.${interface}.info")
else
info=$(bashio::api.supervisor GET "/network/interface/${interface}/info" false)
if [ "$?" -ne "${__BASHIO_EXIT_OK}" ]; then
bashio::log.error "Failed to get network interface info from Supervisor API"
return "${__BASHIO_EXIT_NOK}"
fi
bashio::cache.set "network.interface.${interface}.info" "${info}"
fi
@ -163,7 +172,7 @@ function bashio::network.enabled() {
# Arguments:
# $1 Interface name for this operation (optional)
# ------------------------------------------------------------------------------
function bashio::network.enabled() {
function bashio::network.connected() {
local interface=${1:-'default'}
bashio::log.trace "${FUNCNAME[0]}"

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# ==============================================================================
# Home Assistant Community Add-ons: Bashio
# Bashio is an bash function library for use with Home Assistant add-ons.
# Bashio is a bash function library for use with Home Assistant add-ons.
#
# It contains a set of commonly used operations and can be used
# to be included in add-on scripts to reduce code duplication across add-ons.
@ -51,6 +51,10 @@ function bashio::observer() {
info=$(bashio::cache.get 'observer.info')
else
info=$(bashio::api.supervisor GET /observer/info false)
if [ "$?" -ne "${__BASHIO_EXIT_OK}" ]; then
bashio::log.error "Failed to get observer info from Supervisor API"
return "${__BASHIO_EXIT_NOK}"
fi
bashio::cache.set 'observer.info' "${info}"
fi
@ -121,6 +125,10 @@ function bashio::observer.stats() {
info=$(bashio::cache.get 'observer.stats')
else
info=$(bashio::api.supervisor GET /observer/stats false)
if [ "$?" -ne "${__BASHIO_EXIT_OK}" ]; then
bashio::log.error "Failed to get observer stats from Supervisor API"
return "${__BASHIO_EXIT_NOK}"
fi
bashio::cache.set 'observer.stats' "${info}"
fi

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# ==============================================================================
# Home Assistant Community Add-ons: Bashio
# Bashio is an bash function library for use with Home Assistant add-ons.
# Bashio is a bash function library for use with Home Assistant add-ons.
#
# It contains a set of commonly used operations and can be used
# to be included in add-on scripts to reduce code duplication across add-ons.
@ -59,6 +59,10 @@ function bashio::os() {
info=$(bashio::cache.get 'os.info')
else
info=$(bashio::api.supervisor GET /os/info false)
if [ "$?" -ne "${__BASHIO_EXIT_OK}" ]; then
bashio::log.error "Failed to get os info from Supervisor API"
return "${__BASHIO_EXIT_NOK}"
fi
bashio::cache.set 'os.info' "${info}"
fi

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# ==============================================================================
# Home Assistant Community Add-ons: Bashio
# Bashio is an bash function library for use with Home Assistant add-ons.
# Bashio is a bash function library for use with Home Assistant add-ons.
#
# It contains a set of commonly used operations and can be used
# to be included in add-on scripts to reduce code duplication across add-ons.
@ -39,15 +39,15 @@ function bashio::pwned.is_safe_password() {
# ------------------------------------------------------------------------------
function bashio::pwned.occurances() {
local password="${1}"
local occurances
local occurrences
bashio::log.trace "${FUNCNAME[0]}" "<REDACTED PASSWORD>"
if ! occurances=$(bashio::pwned "${password}"); then
occurances="0"
if ! occurrences=$(bashio::pwned "${password}"); then
occurrences="0"
fi
echo -n "${occurances}"
echo -n "${occurrences}"
return "${__BASHIO_EXIT_OK}"
}

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# ==============================================================================
# Home Assistant Community Add-ons: Bashio
# Bashio is an bash function library for use with Home Assistant add-ons.
# Bashio is a bash function library for use with Home Assistant add-ons.
#
# It contains a set of commonly used operations and can be used
# to be included in add-on scripts to reduce code duplication across add-ons.
@ -34,6 +34,10 @@ function bashio::repositories() {
info=$(bashio::cache.get 'repositories.list')
else
info=$(bashio::api.supervisor GET "/addons" false)
if [ "$?" -ne "${__BASHIO_EXIT_OK}" ]; then
bashio::log.error "Failed to get addons from Supervisor API"
return "${__BASHIO_EXIT_NOK}"
fi
bashio::cache.set "repositories.list" "${info}"
fi
else
@ -42,6 +46,10 @@ function bashio::repositories() {
else
info=$(bashio::api.supervisor GET "/addons" \
false ".repositories[] | select(.slug==\"${slug}\")")
if [ "$?" -ne "${__BASHIO_EXIT_OK}" ]; then
bashio::log.error "Failed to get repositories info from Supervisor API"
return "${__BASHIO_EXIT_NOK}"
fi
bashio::cache.set "repositories.${slug}.info" "${info}"
fi
fi

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# ==============================================================================
# Home Assistant Community Add-ons: Bashio
# Bashio is an bash function library for use with Home Assistant add-ons.
# Bashio is a bash function library for use with Home Assistant add-ons.
#
# It contains a set of commonly used operations and can be used
# to be included in add-on scripts to reduce code duplication across add-ons.
@ -28,6 +28,10 @@ function bashio::services() {
config=$(bashio::cache.get "${cache_key}")
else
config=$(bashio::api.supervisor GET "/services/${service}" false)
if [ "$?" -ne "${__BASHIO_EXIT_OK}" ]; then
bashio::log.error "Failed to get services from Supervisor API"
return "${__BASHIO_EXIT_NOK}"
fi
bashio::cache.set "${cache_key}" "${config}"
fi

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# ==============================================================================
# Home Assistant Community Add-ons: Bashio
# Bashio is an bash function library for use with Home Assistant add-ons.
# Bashio is a bash function library for use with Home Assistant add-ons.
#
# It contains a set of commonly used operations and can be used
# to be included in add-on scripts to reduce code duplication across add-ons.

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# ==============================================================================
# Home Assistant Community Add-ons: Bashio
# Bashio is an bash function library for use with Home Assistant add-ons.
# Bashio is a bash function library for use with Home Assistant add-ons.
#
# It contains a set of commonly used operations and can be used
# to be included in add-on scripts to reduce code duplication across add-ons.
@ -76,6 +76,10 @@ function bashio::supervisor() {
info=$(bashio::cache.get 'supervisor.info')
else
info=$(bashio::api.supervisor GET /supervisor/info false)
if [ "$?" -ne "${__BASHIO_EXIT_OK}" ]; then
bashio::log.error "Failed to get supervisor info from Supervisor API"
return "${__BASHIO_EXIT_NOK}"
fi
bashio::cache.set 'supervisor.info' "${info}"
fi
@ -178,6 +182,26 @@ function bashio::supervisor.timezone() {
fi
}
# ------------------------------------------------------------------------------
# Returns or sets the current country of the system.
#
# Arguments:
# $1 Country to set (optional).
# ------------------------------------------------------------------------------
function bashio::supervisor.country() {
local country=${1:-}
bashio::log.trace "${FUNCNAME[0]}:" "$@"
if bashio::var.has_value "${country}"; then
channel=$(bashio::var.json country "${country}")
bashio::api.supervisor POST /supervisor/options "${country}"
bashio::cache.flush_all
else
bashio::supervisor 'supervisor.info.country' '.country'
fi
}
# ------------------------------------------------------------------------------
# Returns the current logging level of the Supervisor.
#
@ -314,6 +338,10 @@ function bashio::supervisor.stats() {
info=$(bashio::cache.get 'supervisor.stats')
else
info=$(bashio::api.supervisor GET /supervisor/stats false)
if [ "$?" -ne "${__BASHIO_EXIT_OK}" ]; then
bashio::log.error "Failed to get supervisor stats from Supervisor API"
return "${__BASHIO_EXIT_NOK}"
fi
bashio::cache.set 'supervisor.stats' "${info}"
fi

View file

@ -1,14 +1,14 @@
#!/usr/bin/env bash
# ==============================================================================
# Home Assistant Community Add-ons: Bashio
# Bashio is an bash function library for use with Home Assistant add-ons.
# Bashio is a bash function library for use with Home Assistant add-ons.
#
# It contains a set of commonly used operations and can be used
# to be included in add-on scripts to reduce code duplication across add-ons.
# ==============================================================================
# ------------------------------------------------------------------------------
# Checks if a give value is true.
# Checks if a given value is true.
#
# Arguments:
# $1 value
@ -26,7 +26,7 @@ function bashio::var.true() {
}
# ------------------------------------------------------------------------------
# Checks if a give value is false.
# Checks if a given value is false.
#
# Arguments:
# $1 value
@ -139,14 +139,17 @@ function bashio::var.json() {
counter=0;
for i in "${data[@]}"; do
item="\"$i\""
separator=","
if [ $((++counter%2)) -eq 0 ]; then
separator=":";
fi
item="\"$i\""
if [[ "${i:0:1}" == "^" ]]; then
item="${i:1}"
if [[ "${i:0:1}" == "^" ]]; then
item="${i:1}"
else
item=$(bashio::var.json_string "${i}")
fi
fi
json="$json$separator$item";
@ -156,3 +159,23 @@ function bashio::var.json() {
return "${__BASHIO_EXIT_OK}"
}
# ------------------------------------------------------------------------------
# Escapes a string for use in a JSON object.
#
# Arguments:
# $1 String to escape
# ------------------------------------------------------------------------------
function bashio::var.json_string() {
local string="${1}"
local json_string
# https://stackoverflow.com/a/50380697/12156188
if json_string=$(echo -n "${string}" | jq -Rs .); then
echo "${json_string}"
return "${__BASHIO_EXIT_OK}"
fi
bashio::log.error "Failed to escape string"
return "${__BASHIO_EXIT_NOK}"
}