Compare commits

..

39 Commits

Author SHA1 Message Date
Paulus Schoutsen
ec897081cd Update supervisor/api/__init__.py 2022-01-20 14:58:00 -08:00
Paulus Schoutsen
839361133a Add refresh updates API endpoint 2022-01-20 10:14:37 -08:00
Joakim Sørensen
b651d63758 Add backup size to list API (#3409) 2022-01-19 08:59:30 -08:00
dependabot[bot]
400d3981a2 Bump pre-commit from 2.16.0 to 2.17.0 (#3407)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-19 09:16:13 +01:00
Stefan Agner
69c2517d52 Fix local Add-on restore on blank instance (#3403)
Make sure to not reference version attribute from the DockerAddon
instance since it is not yet populated in case this instance hadn't
installed that Add-on previously.

Use the higher level Images.load() API which returns a list of images
instead of loading with the lower level API and then search for the
image we just imported.
2022-01-11 16:55:19 +01:00
Stefan Agner
c8b49aba42 Avoid sending backup start notification to HA Core 2021.12 (#3400) 2022-01-11 13:20:19 +01:00
Stefan Agner
8071b107e7 Release all pending WebSocket calls on connection close (#3401) 2022-01-11 13:18:49 +01:00
dependabot[bot]
603d19b075 Bump sentry-sdk from 1.5.1 to 1.5.2 (#3398)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-11 09:04:24 +01:00
dependabot[bot]
a5ce2ef7cb Bump gitpython from 3.1.25 to 3.1.26 (#3399)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-11 08:36:23 +01:00
dependabot[bot]
f392dc5492 Bump awesomeversion from 21.12.0 to 22.1.0 (#3397)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-10 09:04:58 +01:00
dependabot[bot]
0c63883269 Bump gitpython from 3.1.24 to 3.1.25 (#3394)
Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.24 to 3.1.25.
- [Release notes](https://github.com/gitpython-developers/GitPython/releases)
- [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES)
- [Commits](https://github.com/gitpython-developers/GitPython/compare/3.1.24...3.1.25)

---
updated-dependencies:
- dependency-name: gitpython
  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-09 21:47:50 +01:00
dependabot[bot]
612d4f950b Bump pyupgrade from 2.30.0 to 2.31.0 (#3390)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2022-01-06 16:14:24 +01:00
Stefan Agner
1799c765b4 Notify HA Core when backup is being executed (#3305)
* Notify HA Core when backup is being executed

Notify Home Assistant Core using the Websocket API when the Home Assistant
config directory is about to get backed up. This makes sure the Core can
prepare the SQLite database (if active) so it safe to make a backup.

* Only close WebSocket connection on connection errors

Let regular WebSocket errors bubble to the caller so they can be handled
explicitly.

* Add version restriction to backup/start/end WS commands

* Restore Home Assistant metadata when Home Assistant is selected
2022-01-05 11:57:41 +01:00
Allen Porter
809ac1ffca Add Add-on discovery schema for rtsp-to-webrtc (#3392) 2022-01-05 11:30:15 +01:00
Allen Porter
fefc99e825 Fix copy/paste issues in tests (#3393) 2022-01-05 10:01:00 +01:00
Allen Porter
d994170a9d Fix copy-paste error in pydoc for test_almond.py (#3389) 2022-01-02 16:09:46 +01:00
Stefan Agner
d8c934365a Exclude old log files from backup (#3307)
Currently log files are excluded from the backup. Core uses a time or
startup based log rotation mechanism, both append a dot and an
additional; string (`.1`, `.{timestamp}`). There is also a fault
mechanism which creates a log file with the ending `.log.fault`. Exclude
all cases from the backup.
2021-12-28 17:40:32 +01:00
Joakim Sørensen
e0fd31c390 Create backup of add-ons and core before update (#3369)
* Create backup of addons and core before update

* Move responsibility
2021-12-28 11:13:54 +01:00
dependabot[bot]
22238c9c0e Bump awesomeversion from 21.11.0 to 21.12.0 (#3379)
Bumps [awesomeversion](https://github.com/ludeeus/awesomeversion) from 21.11.0 to 21.12.0.
- [Release notes](https://github.com/ludeeus/awesomeversion/releases)
- [Commits](https://github.com/ludeeus/awesomeversion/compare/21.11.0...21.12.0)

---
updated-dependencies:
- dependency-name: awesomeversion
  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-28 11:10:36 +01:00
dependabot[bot]
5ff96cfa5e Bump pyupgrade from 2.29.1 to 2.30.0 (#3381)
* Bump pyupgrade from 2.29.1 to 2.30.0

Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.29.1 to 2.30.0.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.29.1...v2.30.0)

---
updated-dependencies:
- dependency-name: pyupgrade
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

* Update .pre-commit-config.yaml

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-12-28 11:09:28 +01:00
dependabot[bot]
e22a19df1a Bump cryptography from 35.0.0 to 36.0.1 (#3365)
Bumps [cryptography](https://github.com/pyca/cryptography) from 35.0.0 to 36.0.1.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/35.0.0...36.0.1)

---
updated-dependencies:
- dependency-name: cryptography
  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>
2021-12-23 14:09:19 +01:00
dependabot[bot]
f57bc0db25 Bump async-timeout from 4.0.1 to 4.0.2 (#3376)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-21 10:57:51 +01:00
dependabot[bot]
6ba6b5ea56 Bump pylint from 2.12.1 to 2.12.2 (#3341)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-21 10:52:58 +01:00
dependabot[bot]
5dc9f9235e Bump docker/login-action from 1.10.0 to 1.12.0 (#3375)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-21 10:51:43 +01:00
Franck Nijhof
323fa2e637 Change CI cache restore policy (#3377) 2021-12-21 10:47:20 +01:00
dependabot[bot]
0986419b2f Bump deepmerge from 0.3.0 to 1.0.1 (#3373)
Bumps [deepmerge](https://github.com/toumorokoshi/deepmerge) from 0.3.0 to 1.0.1.
- [Release notes](https://github.com/toumorokoshi/deepmerge/releases)
- [Commits](https://github.com/toumorokoshi/deepmerge/commits)

---
updated-dependencies:
- dependency-name: deepmerge
  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>
2021-12-20 12:26:03 +01:00
dependabot[bot]
f0bc952269 Bump home-assistant/builder from 2021.11.4 to 2021.12.0 (#3359)
Bumps [home-assistant/builder](https://github.com/home-assistant/builder) from 2021.11.4 to 2021.12.0.
- [Release notes](https://github.com/home-assistant/builder/releases)
- [Commits](https://github.com/home-assistant/builder/compare/2021.11.4...2021.12.0)

---
updated-dependencies:
- dependency-name: home-assistant/builder
  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-20 12:25:20 +01:00
dependabot[bot]
9266997482 Bump sentry-sdk from 1.5.0 to 1.5.1 (#3360)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.5.0 to 1.5.1.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.5.0...1.5.1)

---
updated-dependencies:
- dependency-name: sentry-sdk
  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>
2021-12-20 12:24:54 +01:00
dependabot[bot]
75d252e21a Bump pytest-timeout from 2.0.1 to 2.0.2 (#3361)
Bumps [pytest-timeout](https://github.com/pytest-dev/pytest-timeout) from 2.0.1 to 2.0.2.
- [Release notes](https://github.com/pytest-dev/pytest-timeout/releases)
- [Commits](https://github.com/pytest-dev/pytest-timeout/compare/2.0.1...2.0.2)

---
updated-dependencies:
- dependency-name: pytest-timeout
  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>
2021-12-20 12:24:24 +01:00
Joakim Sørensen
368e94f95f Bump frontend to 2f9c0880 (#3374) 2021-12-20 11:51:31 +01:00
Stefan Agner
3fbecf89db Enable asyncio debug in developer mode (#3348) 2021-12-16 10:50:56 +01:00
dependabot[bot]
54e6ae5fd9 Bump actions/upload-artifact from 2.3.0 to 2.3.1 (#3368)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-16 08:24:10 +01:00
Stefan Agner
5b96074055 Log if board reported by HAOS isn't in version file (#3366)
Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
2021-12-15 16:45:18 +01:00
Joakim Sørensen
5503f93a75 Don't remove add-on repos if add-on is installed (#3364) 2021-12-14 21:04:31 +01:00
Stefan Agner
eadc629cd9 De-duplicate Backup/Restore logic (#3311)
* De-duplicate Backup/Restore logic

Create internal _do_backup()/_do_restore() method which de-duplicates
some of the backup/restore logic previously part of full/partial backup/restore.

* Add Backup/Restore test coverage
2021-12-14 17:21:52 +00:00
Stefan Agner
cde45e2e7a Address pytest warnings (#3347)
* Avoid accessing properties of udevice.parent

The if statement currently causes access of a property of
udevice.parent, leading to:
tests/hardware/test_module.py: 104 warnings
  /workspaces/supervisor/supervisor/hardware/data.py:50: DeprecationWarning: Will be removed in 1.0. Access properties with Device.properties.

Change the if statement to avoid property access and the deprecation
warning.

* Create task before using asyncio.wait()

Avoid deprecation warnings such as:
tests/store/test_custom_repository.py: 5 warnings
  /workspaces/supervisor/supervisor/store/__init__.py:113: DeprecationWarning: The explicit passing of coroutine objects to asyncio.wait() is deprecated since Python 3.8, and scheduled for removal in Python 3.11.
    await asyncio.wait(tasks)
2021-12-14 15:30:22 +00:00
Franck Nijhof
050851a9ac Update ruamel.yaml to 0.17.17 (#3363) 2021-12-14 14:00:46 +01:00
dependabot[bot]
86bd16b2ba Bump black from 21.11b1 to 21.12b0 (#3342)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-12-14 02:14:38 +01:00
Joakim Sørensen
ce9181b05f Bump frontend to a7b558b6 (#3357) 2021-12-13 18:57:47 +01:00
173 changed files with 1041 additions and 574 deletions

View File

@@ -109,14 +109,14 @@ jobs:
- name: Login to DockerHub
if: needs.init.outputs.publish == 'true'
uses: docker/login-action@v1.10.0
uses: docker/login-action@v1.12.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
if: needs.init.outputs.publish == 'true'
uses: docker/login-action@v1.10.0
uses: docker/login-action@v1.12.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
@@ -127,7 +127,7 @@ jobs:
run: echo "BUILD_ARGS=--test" >> $GITHUB_ENV
- name: Build supervisor
uses: home-assistant/builder@2021.11.4
uses: home-assistant/builder@2021.12.0
with:
args: |
$BUILD_ARGS \
@@ -199,7 +199,7 @@ jobs:
- name: Build the Supervisor
if: needs.init.outputs.publish != 'true'
uses: home-assistant/builder@2021.11.4
uses: home-assistant/builder@2021.12.0
with:
args: |
--test \

View File

@@ -36,9 +36,6 @@ jobs:
path: venv
key: |
${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }}
restore-keys: |
${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}
${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-
- name: Create Python virtual environment
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
@@ -395,7 +392,7 @@ jobs:
-o console_output_style=count \
tests
- name: Upload coverage artifact
uses: actions/upload-artifact@v2.3.0
uses: actions/upload-artifact@v2.3.1
with:
name: coverage-${{ matrix.python-version }}
path: .coverage

View File

@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/psf/black
rev: 21.11b1
rev: 21.12b0
hooks:
- id: black
args:
@@ -28,7 +28,7 @@ repos:
hooks:
- id: isort
- repo: https://github.com/asottile/pyupgrade
rev: v2.29.1
rev: v2.31.0
hooks:
- id: pyupgrade
args: [--py39-plus]

View File

@@ -1,22 +1,22 @@
aiohttp==3.8.1
async_timeout==4.0.1
async_timeout==4.0.2
atomicwrites==1.4.0
attrs==21.2.0
awesomeversion==21.11.0
awesomeversion==22.1.0
brotli==1.0.9
cchardet==2.1.7
ciso8601==2.2.0
colorlog==6.6.0
cpe==1.2.1
cryptography==35.0.0
cryptography==36.0.1
debugpy==1.5.1
deepmerge==0.3.0
deepmerge==1.0.1
docker==5.0.3
gitpython==3.1.24
gitpython==3.1.26
jinja2==3.0.3
pulsectl==21.10.5
pyudev==0.22.0
ruamel.yaml==0.15.100
sentry-sdk==1.5.0
ruamel.yaml==0.17.17
sentry-sdk==1.5.2
voluptuous==0.12.2
dbus-next==0.2.3

View File

@@ -1,14 +1,14 @@
black==21.11b1
black==21.12b0
codecov==2.1.12
coverage==6.2
flake8-docstrings==1.6.0
flake8==4.0.1
pre-commit==2.16.0
pre-commit==2.17.0
pydocstyle==6.1.1
pylint==2.12.1
pylint==2.12.2
pytest-aiohttp==0.3.0
pytest-asyncio==0.12.0 # NB!: Versions over 0.12.0 breaks pytest-aiohttp (https://github.com/aio-libs/pytest-aiohttp/issues/16)
pytest-cov==3.0.0
pytest-timeout==2.0.1
pytest-timeout==2.0.2
pytest==6.2.5
pyupgrade==2.29.1
pyupgrade==2.31.0

View File

@@ -39,6 +39,7 @@ if __name__ == "__main__":
_LOGGER.info("Initializing Supervisor setup")
coresys = loop.run_until_complete(bootstrap.initialize_coresys())
loop.set_debug(coresys.config.debug)
loop.run_until_complete(coresys.core.connect())
bootstrap.supervisor_debugger(coresys)

View File

@@ -252,7 +252,7 @@ class AddonManager(CoreSysAttributes):
],
on_condition=AddonsJobError,
)
async def update(self, slug: str) -> None:
async def update(self, slug: str, backup: Optional[bool] = False) -> None:
"""Update add-on."""
if slug not in self.local:
raise AddonsError(f"Add-on {slug} is not installed", _LOGGER.error)
@@ -273,6 +273,13 @@ class AddonManager(CoreSysAttributes):
f"Add-on {slug} not supported on that platform", _LOGGER.error
)
if backup:
await self.sys_backups.do_backup_partial(
name=f"addon_{addon.slug}_{addon.version}",
homeassistant=False,
addons=[addon.slug],
)
# Update instance
last_state: AddonState = addon.state
old_image = addon.image

View File

@@ -622,9 +622,9 @@ class AddonModel(CoreSysAttributes, ABC):
"""Uninstall this add-on."""
return self.sys_addons.uninstall(self.slug)
def update(self) -> Awaitable[None]:
def update(self, backup: Optional[bool] = False) -> Awaitable[None]:
"""Update this add-on."""
return self.sys_addons.update(self.slug)
return self.sys_addons.update(self.slug, backup=backup)
def rebuild(self) -> Awaitable[None]:
"""Rebuild this add-on."""

View File

@@ -287,6 +287,7 @@ class RestAPI(CoreSysAttributes):
web.get(
"/supervisor/available_updates", api_supervisor.available_updates
),
web.post("/refresh_updates", api_supervisor.reload),
web.get("/supervisor/ping", api_supervisor.ping),
web.get("/supervisor/info", api_supervisor.info),
web.get("/supervisor/stats", api_supervisor.stats),

View File

@@ -84,6 +84,7 @@ class APIBackups(CoreSysAttributes):
ATTR_NAME: backup.name,
ATTR_DATE: backup.date,
ATTR_TYPE: backup.sys_type,
ATTR_SIZE: backup.size,
ATTR_PROTECTED: backup.protected,
ATTR_CONTENT: {
ATTR_HOMEASSISTANT: backup.homeassistant_version is not None,

View File

@@ -10,6 +10,7 @@ from ..const import (
ATTR_ARCH,
ATTR_AUDIO_INPUT,
ATTR_AUDIO_OUTPUT,
ATTR_BACKUP,
ATTR_BLK_READ,
ATTR_BLK_WRITE,
ATTR_BOOT,
@@ -54,7 +55,12 @@ SCHEMA_OPTIONS = vol.Schema(
}
)
SCHEMA_VERSION = vol.Schema({vol.Optional(ATTR_VERSION): version_tag})
SCHEMA_UPDATE = vol.Schema(
{
vol.Optional(ATTR_VERSION): version_tag,
vol.Optional(ATTR_BACKUP): bool,
}
)
class APIHomeAssistant(CoreSysAttributes):
@@ -137,10 +143,14 @@ class APIHomeAssistant(CoreSysAttributes):
@api_process
async def update(self, request: web.Request) -> None:
"""Update Home Assistant."""
body = await api_validate(SCHEMA_VERSION, request)
version = body.get(ATTR_VERSION, self.sys_homeassistant.latest_version)
body = await api_validate(SCHEMA_UPDATE, request)
await asyncio.shield(self.sys_homeassistant.core.update(version))
await asyncio.shield(
self.sys_homeassistant.core.update(
version=body.get(ATTR_VERSION, self.sys_homeassistant.latest_version),
backup=body.get(ATTR_BACKUP),
)
)
@api_process
def stop(self, request: web.Request) -> Awaitable[None]:

View File

@@ -1,14 +1,14 @@
function loadES5() {
var el = document.createElement('script');
el.src = '/api/hassio/app/frontend_es5/entrypoint.22ce43b5.js';
el.src = '/api/hassio/app/frontend_es5/entrypoint.5d40ff8b.js';
document.body.appendChild(el);
}
if (/.*Version\/(?:11|12)(?:\.\d+)*.*Safari\//.test(navigator.userAgent)) {
loadES5();
} else {
try {
new Function("import('/api/hassio/app/frontend_latest/entrypoint.510c6a91.js')")();
new Function("import('/api/hassio/app/frontend_latest/entrypoint.f09e9f8e.js')")();
} catch (err) {
loadES5();
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@@ -1,3 +1,3 @@
{
"entrypoint.js": "/api/hassio/app/frontend_es5/entrypoint.22ce43b5.js"
"entrypoint.js": "/api/hassio/app/frontend_es5/entrypoint.5d40ff8b.js"
}

View File

@@ -155,7 +155,7 @@
.sub-header {
margin-top: 8px;
}
`}},{kind:"method",key:"backupDetails",value:function(){var e,t;const r={};if(this.backup||(r.name=this.backupName||(0,o.p6)(new Date,this.hass.locale)),this.backupHasPassword&&(r.password=this.backupPassword,this.backup||(r.confirm_password=this.confirmBackupPassword)),"full"===this.backupType)return r;const i=null===(e=this.addons)||void 0===e?void 0:e.filter((e=>e.checked)).map((e=>e.slug)),n=null===(t=this.folders)||void 0===t?void 0:t.filter((e=>e.checked)).map((e=>e.slug));return null!=i&&i.length&&(r.addons=i),null!=n&&n.length&&(r.folders=n),this.homeAssistant&&(r.homeassistant=this.homeAssistant),r}},{kind:"method",key:"_getSection",value:function(e){var r;const i=[],n="addons"===e?new Map(null===(r=this.supervisor)||void 0===r?void 0:r.addon.addons.map((e=>[e.slug,e]))):void 0;let o=0;this[e].forEach((r=>{var s;i.push(t.dy`<ha-formfield
`}},{kind:"method",key:"backupDetails",value:function(){var e,t;const r={};if(this.backup||(r.name=this.backupName||(0,o.p6)(new Date,this.hass.locale)),this.backupHasPassword&&(r.password=this.backupPassword,this.backup||(r.confirm_password=this.confirmBackupPassword)),"full"===this.backupType)return r;const i=null===(e=this.addons)||void 0===e?void 0:e.filter((e=>e.checked)).map((e=>e.slug)),n=null===(t=this.folders)||void 0===t?void 0:t.filter((e=>e.checked)).map((e=>e.slug));return null!=i&&i.length&&(r.addons=i),null!=n&&n.length&&(r.folders=n),r.homeassistant=this.homeAssistant,r}},{kind:"method",key:"_getSection",value:function(e){var r;const i=[],n="addons"===e?new Map(null===(r=this.supervisor)||void 0===r?void 0:r.addon.addons.map((e=>[e.slug,e]))):void 0;let o=0;this[e].forEach((r=>{var s;i.push(t.dy`<ha-formfield
.label=${t.dy`<supervisor-formfield-label
.label=${r.name}
.iconPath=${"addons"===e?g:b}
@@ -192,4 +192,4 @@
margin-right: 8px;
}
`}}]}}),i.oi)},2198:(e,t,r)=>{r.a(e,(async e=>{r.d(t,{p6:()=>a});var i=r(4516),n=r(4121);n.Xp&&await n.Xp;(0,i.Z)((e=>new Intl.DateTimeFormat(e.language,{weekday:"long",month:"long",day:"numeric"})));const a=(e,t)=>o(t).format(e),o=(0,i.Z)((e=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric"})));(0,i.Z)((e=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"numeric",day:"numeric"}))),(0,i.Z)((e=>new Intl.DateTimeFormat(e.language,{day:"numeric",month:"short"}))),(0,i.Z)((e=>new Intl.DateTimeFormat(e.language,{month:"long",year:"numeric"}))),(0,i.Z)((e=>new Intl.DateTimeFormat(e.language,{month:"long"}))),(0,i.Z)((e=>new Intl.DateTimeFormat(e.language,{year:"numeric"})));e()}),1)},4583:(e,t,r)=>{r.a(e,(async e=>{r.d(t,{o0:()=>o});var i=r(4516),n=r(5810),a=r(4121);a.Xp&&await a.Xp;const o=(e,t)=>s(t).format(e),s=(0,i.Z)((e=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric",hour:(0,n.y)(e)?"numeric":"2-digit",minute:"2-digit",hour12:(0,n.y)(e)})));(0,i.Z)((e=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric",hour:(0,n.y)(e)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hour12:(0,n.y)(e)}))),(0,i.Z)((e=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit",hour12:(0,n.y)(e)})));e()}),1)},5810:(e,t,r)=>{r.d(t,{y:()=>a});var i=r(4516),n=r(6477);const a=(0,i.Z)((e=>{if(e.time_format===n.zt.language||e.time_format===n.zt.system){const t=e.time_format===n.zt.language?e.language:void 0,r=(new Date).toLocaleString(t);return r.includes("AM")||r.includes("PM")}return e.time_format===n.zt.am_pm}))}}]);
//# sourceMappingURL=6c045b3e.js.map
//# sourceMappingURL=126d80e3.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@@ -109,7 +109,9 @@
>
<div class="card-content">
${this._error?i.dy`<ha-alert alert-type="error">${this._error}</ha-alert>`:""}
${null===this._action?i.dy`
${this._version===this._version_latest?i.dy`<p>
${this.supervisor.localize("update_available.no_update",{name:this._name})}
</p>`:null===this._action?i.dy`
${this._changelogContent?i.dy`
<ha-faded>
<ha-markdown .content=${this._changelogContent}>
@@ -134,7 +136,7 @@
${"update"===this._action?this.supervisor.localize("update_available.updating",{name:this._name,version:this._version_latest}):this.supervisor.localize("update_available.creating_backup",{name:this._name})}
</p>`}
</div>
${null===this._action?i.dy`
${this._version!==this._version_latest&&null===this._action?i.dy`
<div class="card-actions">
${t?i.dy`<a .href=${t} target="_blank" rel="noreferrer">
<mwc-button
@@ -153,7 +155,7 @@
</div>
`:""}
</ha-card>
`}},{kind:"method",key:"firstUpdated",value:function(e){var t;ee(te(r.prototype),"firstUpdated",this).call(this,e);const i=null===(t=this.route)||void 0===t?void 0:t.path.substring(1,this.route.path.length),n=["core","os","supervisor"].includes(i)?i:"addon";this._updateType=n,"addon"===n&&(this.addonSlug||(this.addonSlug=i),this._loadAddonData())}},{kind:"get",key:"_shouldCreateBackup",value:function(){var e;const t=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("ha-checkbox");return!t||t.checked}},{kind:"get",key:"_version",value:function(){var e;return this._updateType?"addon"===this._updateType?this._addonInfo.version:(null===(e=this.supervisor[this._updateType])||void 0===e?void 0:e.version)||"":""}},{kind:"get",key:"_version_latest",value:function(){var e;return this._updateType?"addon"===this._updateType?this._addonInfo.version_latest:(null===(e=this.supervisor[this._updateType])||void 0===e?void 0:e.version_latest)||"":""}},{kind:"get",key:"_name",value:function(){return this._updateType?"addon"===this._updateType?this._addonInfo.name:N[this._updateType]:""}},{kind:"method",key:"_loadAddonData",value:async function(){try{this._addonInfo=await(0,b.AD)(this.hass,this.addonSlug)}catch(e){return void(0,S.Ys)(this,{title:this._updateType,text:(0,E.js)(e)})}const e=this._addonInfo.detached||this._addonInfo.available?void 0:this._addonStoreInfo(this._addonInfo.slug,this.supervisor.store.addons);if(this._addonInfo.changelog)try{const e=await(0,b.CH)(this.hass,this.addonSlug);this._changelogContent=(0,Z.H)(this._addonInfo,e)}catch(e){return void(this._error=(0,E.js)(e))}!this._addonInfo.available&&e&&((0,Z.I)(this.supervisor.info.supported_arch,this._addonInfo.arch)?this._error=this.supervisor.localize("addon.dashboard.not_available_version",{core_version_installed:this.supervisor.core.version,core_version_needed:e.homeassistant}):this._error=this.supervisor.localize("addon.dashboard.not_available_arch"))}},{kind:"method",key:"_update",value:async function(){if(this._error=void 0,this._shouldCreateBackup){let e;e="addon"===this._updateType?{name:`addon_${this.addonSlug}_${this._version}`,addons:[this.addonSlug],homeassistant:!1}:{name:`${this._updateType}_${this._version}`,folders:["homeassistant"],homeassistant:!0},this._action="backup";try{await(0,w.zU)(this.hass,e)}catch(e){return this._error=(0,E.js)(e),void(this._action=null)}}this._action="update";try{"addon"===this._updateType?await(0,b.V_)(this.hass,this.addonSlug):"core"===this._updateType?await(0,P.y)(this.hass):"os"===this._updateType?await(0,_.Fu)(this.hass):"supervisor"===this._updateType&&await(0,C.CG)(this.hass)}catch(e){if(this.hass.connection.connected&&!(0,E.yz)(e))return this._error=(0,E.js)(e),void(this._action=null)}(0,l.B)(this,"update-complete")}},{kind:"get",static:!0,key:"styles",value:function(){return i.iv`
`}},{kind:"method",key:"firstUpdated",value:function(e){var t;ee(te(r.prototype),"firstUpdated",this).call(this,e);const i=null===(t=this.route)||void 0===t?void 0:t.path.substring(1,this.route.path.length),n=["core","os","supervisor"].includes(i)?i:"addon";this._updateType=n,"addon"===n&&(this.addonSlug||(this.addonSlug=i),this._loadAddonData())}},{kind:"get",key:"_shouldCreateBackup",value:function(){var e;if(this._updateType&&!["core","addon"].includes(this._updateType))return!1;const t=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("ha-checkbox");return!t||t.checked}},{kind:"get",key:"_version",value:function(){var e;return this._updateType?"addon"===this._updateType?this._addonInfo.version:(null===(e=this.supervisor[this._updateType])||void 0===e?void 0:e.version)||"":""}},{kind:"get",key:"_version_latest",value:function(){var e;return this._updateType?"addon"===this._updateType?this._addonInfo.version_latest:(null===(e=this.supervisor[this._updateType])||void 0===e?void 0:e.version_latest)||"":""}},{kind:"get",key:"_name",value:function(){return this._updateType?"addon"===this._updateType?this._addonInfo.name:N[this._updateType]:""}},{kind:"method",key:"_loadAddonData",value:async function(){try{this._addonInfo=await(0,b.AD)(this.hass,this.addonSlug)}catch(e){return void(0,S.Ys)(this,{title:this._updateType,text:(0,E.js)(e)})}const e=this._addonInfo.detached||this._addonInfo.available?void 0:this._addonStoreInfo(this._addonInfo.slug,this.supervisor.store.addons);if(this._addonInfo.changelog)try{const e=await(0,b.CH)(this.hass,this.addonSlug);this._changelogContent=(0,Z.H)(this._addonInfo,e)}catch(e){return void(this._error=(0,E.js)(e))}!this._addonInfo.available&&e&&((0,Z.I)(this.supervisor.info.supported_arch,this._addonInfo.arch)?this._error=this.supervisor.localize("addon.dashboard.not_available_version",{core_version_installed:this.supervisor.core.version,core_version_needed:e.homeassistant}):this._error=this.supervisor.localize("addon.dashboard.not_available_arch"))}},{kind:"method",key:"_update",value:async function(){if(this._error=void 0,this._shouldCreateBackup){let e;e="addon"===this._updateType?{name:`addon_${this.addonSlug}_${this._version}`,addons:[this.addonSlug],homeassistant:!1}:{name:`${this._updateType}_${this._version}`,folders:["homeassistant"],homeassistant:!0},this._action="backup";try{await(0,w.zU)(this.hass,e)}catch(e){return this._error=(0,E.js)(e),void(this._action=null)}}this._action="update";try{"addon"===this._updateType?await(0,b.V_)(this.hass,this.addonSlug):"core"===this._updateType?await(0,P.y)(this.hass):"os"===this._updateType?await(0,_.Fu)(this.hass):"supervisor"===this._updateType&&await(0,C.CG)(this.hass)}catch(e){if(this.hass.connection.connected&&!(0,E.yz)(e))return this._error=(0,E.js)(e),void(this._action=null)}(0,l.B)(this,"update-complete")}},{kind:"get",static:!0,key:"styles",value:function(){return i.iv`
:host {
display: block;
}
@@ -188,4 +190,4 @@
padding-bottom: 8px;
}
`}}]}}),i.oi)},4450:(e,t,r)=>{r.d(t,{I:()=>i,H:()=>n});const i=(0,r(4516).Z)(((e,t)=>t.some((t=>e.includes(t))))),n=(e,t)=>{if(t.startsWith("# Changelog")&&(t=t.substr(12,t.length)),t.includes(`# ${e.version}`)&&t.includes(`# ${e.version_latest}`)){const r=t.split(`# ${e.version}`)[0];r.includes(`# ${e.version_latest}`)&&(t=r)}return t}}}]);
//# sourceMappingURL=95559dcf.js.map
//# sourceMappingURL=cee1db09.js.map

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,3 +1,3 @@
{
"entrypoint.js": "/api/hassio/app/frontend_latest/entrypoint.510c6a91.js"
"entrypoint.js": "/api/hassio/app/frontend_latest/entrypoint.f09e9f8e.js"
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More