Merge pull request #1738 from home-assistant/dev

Release 223
This commit is contained in:
Pascal Vizeli 2020-05-21 12:08:36 +02:00 committed by GitHub
commit c61995aab8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
74 changed files with 498 additions and 84 deletions

4
.gitignore vendored
View File

@ -96,3 +96,7 @@ ENV/
!.vscode/cSpell.json
!.vscode/tasks.json
!.vscode/launch.json
# mypy
/.mypy_cache/*
/.dmypy.json

4
.vscode/tasks.json vendored
View File

@ -60,7 +60,7 @@
{
"label": "Flake8",
"type": "shell",
"command": "flake8 hassio tests",
"command": "flake8 supervisor tests",
"group": {
"kind": "test",
"isDefault": true
@ -74,7 +74,7 @@
{
"label": "Pylint",
"type": "shell",
"command": "pylint hassio",
"command": "pylint supervisor",
"dependsOn": ["Install all Requirements"],
"group": {
"kind": "test",

1
API.md
View File

@ -776,6 +776,7 @@ return:
"supervisor": "version",
"homeassistant": "version",
"hassos": "null|version",
"docker": "version",
"hostname": "name",
"machine": "type",
"arch": "arch",

@ -1 +1 @@
Subproject commit 3febf059ec38e656b20a958b77a00161be64ca0e
Subproject commit 300c8d06c4c73601bcefbc1b0baeceef007fdba9

View File

@ -1,27 +1,28 @@
[MASTER]
reports=no
jobs=2
# Reasons disabled:
# format - handled by black
# locally-disabled - it spams too much
# duplicate-code - unavoidable
# cyclic-import - doesn't test if both import on load
# abstract-class-little-used - prevents from setting right foundation
# abstract-class-not-used - is flaky, should not show up but does
# unused-argument - generic callbacks and setup methods create a lot of warnings
# global-statement - used for the on-demand requirement installation
# redefined-variable-type - this is Python, we're duck typing!
# too-many-* - are not enforced for the sake of readability
# too-few-* - same as too-many-*
# abstract-method - with intro of async there are always methods missing
disable=
format,
abstract-class-little-used,
abstract-class-not-used,
abstract-method,
cyclic-import,
duplicate-code,
global-statement,
locally-disabled,
no-else-return,
no-self-use,
not-context-manager,
redefined-variable-type,
too-few-public-methods,
@ -34,14 +35,6 @@ disable=
too-many-return-statements,
too-many-statements,
unused-argument,
line-too-long,
bad-continuation,
too-few-public-methods,
no-self-use,
not-async-context-manager,
too-many-locals,
too-many-branches,
no-else-return
[EXCEPTIONS]
overgeneral-exceptions=Exception

View File

@ -8,9 +8,9 @@ cryptography==2.9.2
docker==4.2.0
gitpython==3.1.2
jinja2==2.11.2
packaging==20.3
packaging==20.4
ptvsd==4.3.2
pulsectl==20.4.3
pulsectl==20.5.0
pytz==2020.1
pyudev==0.22.0
ruamel.yaml==0.15.100

View File

@ -1,6 +1,6 @@
flake8==3.7.9
flake8==3.8.1
pylint==2.5.2
pytest==5.4.1
pytest==5.4.2
pytest-timeout==1.3.4
pytest-aiohttp==0.3.0
black==19.10b0

View File

@ -380,7 +380,7 @@ class RestAPI(CoreSysAttributes):
try:
await self._site.start()
except OSError as err:
_LOGGER.fatal("Failed to create HTTP server at 0.0.0.0:80 -> %s", err)
_LOGGER.critical("Failed to create HTTP server at 0.0.0.0:80 -> %s", err)
else:
_LOGGER.info("Start API on %s", self.sys_docker.network.supervisor)

View File

@ -7,6 +7,7 @@ from aiohttp import web
from ..const import (
ATTR_ARCH,
ATTR_CHANNEL,
ATTR_DOCKER,
ATTR_HASSOS,
ATTR_HOMEASSISTANT,
ATTR_HOSTNAME,
@ -32,6 +33,7 @@ class APIInfo(CoreSysAttributes):
ATTR_SUPERVISOR: self.sys_supervisor.version,
ATTR_HOMEASSISTANT: self.sys_homeassistant.version,
ATTR_HASSOS: self.sys_hassos.version,
ATTR_DOCKER: self.sys_docker.info.version,
ATTR_HOSTNAME: self.sys_host.info.hostname,
ATTR_MACHINE: self.sys_machine,
ATTR_ARCH: self.sys_arch.default,

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

Binary file not shown.

View File

@ -0,0 +1 @@
{"version":3,"file":"chunk.0f72ffcda496ba135cd8.js","sources":["webpack:///./src/resources/render-markdown.ts"],"sourcesContent":["import { wrap } from \"comlink\";\n\ntype RenderMarkdownType = typeof import(\"./markdown_worker\").api[\"renderMarkdown\"];\ntype renderMarkdownParamTypes = Parameters<RenderMarkdownType>;\n\nlet worker: any | undefined;\n\nexport const renderMarkdown = async (\n content: renderMarkdownParamTypes[0],\n markedOptions: renderMarkdownParamTypes[1],\n hassOptions?: renderMarkdownParamTypes[2]\n): Promise<ReturnType<RenderMarkdownType>> => {\n if (!worker) {\n worker = wrap(new Worker(\"./markdown_worker\", { type: \"module\" }));\n }\n\n return await worker.renderMarkdown(content, markedOptions, hassOptions);\n};\n"],"mappings":"AAKA","sourceRoot":""}

View File

@ -0,0 +1,2 @@
(self.webpackJsonp=self.webpackJsonp||[]).push([[1],{196:function(e,r,n){"use strict";n.r(r),n.d(r,"codeMirror",function(){return c}),n.d(r,"codeMirrorCss",function(){return i});var a=n(54),o=n.n(a),s=n(186),t=(n(187),n(188),n(12));o.a.commands.save=function(e){Object(t.a)(e.getWrapperElement(),"editor-save")};var c=o.a,i=s.a}}]);
//# sourceMappingURL=chunk.1009a4a228e1b844359a.js.map

Binary file not shown.

View File

@ -0,0 +1 @@
{"version":3,"file":"chunk.1009a4a228e1b844359a.js","sources":["webpack:///./src/resources/codemirror.ts"],"sourcesContent":["// @ts-ignore\nimport _CodeMirror, { Editor } from \"codemirror\";\n// @ts-ignore\nimport _codeMirrorCss from \"codemirror/lib/codemirror.css\";\nimport \"codemirror/mode/jinja2/jinja2\";\nimport \"codemirror/mode/yaml/yaml\";\nimport { fireEvent } from \"../common/dom/fire_event\";\n\n_CodeMirror.commands.save = (cm: Editor) => {\n fireEvent(cm.getWrapperElement(), \"editor-save\");\n};\nexport const codeMirror: any = _CodeMirror;\nexport const codeMirrorCss: any = _codeMirrorCss;\n"],"mappings":"AAAA","sourceRoot":""}

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -0,0 +1 @@
{"version":3,"file":"chunk.33bfb7d5880765434044.js","sources":["webpack:///./src/components/dialog/ha-iron-focusables-helper.js"],"sourcesContent":["/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at\nhttp://polymer.github.io/LICENSE.txt The complete set of authors may be found at\nhttp://polymer.github.io/AUTHORS.txt The complete set of contributors may be\nfound at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as\npart of the polymer project is also subject to an additional IP rights grant\nfound at http://polymer.github.io/PATENTS.txt\n*/\n/*\n Fixes issue with not using shadow dom properly in iron-overlay-behavior/icon-focusables-helper.js\n*/\nimport { IronFocusablesHelper } from \"@polymer/iron-overlay-behavior/iron-focusables-helper\";\nimport { dom } from \"@polymer/polymer/lib/legacy/polymer.dom\";\n\nexport const HaIronFocusablesHelper = {\n /**\n * Returns a sorted array of tabbable nodes, including the root node.\n * It searches the tabbable nodes in the light and shadow dom of the chidren,\n * sorting the result by tabindex.\n * @param {!Node} node\n * @return {!Array<!HTMLElement>}\n */\n getTabbableNodes: function (node) {\n var result = [];\n // If there is at least one element with tabindex > 0, we need to sort\n // the final array by tabindex.\n var needsSortByTabIndex = this._collectTabbableNodes(node, result);\n if (needsSortByTabIndex) {\n return IronFocusablesHelper._sortByTabIndex(result);\n }\n return result;\n },\n\n /**\n * Searches for nodes that are tabbable and adds them to the `result` array.\n * Returns if the `result` array needs to be sorted by tabindex.\n * @param {!Node} node The starting point for the search; added to `result`\n * if tabbable.\n * @param {!Array<!HTMLElement>} result\n * @return {boolean}\n * @private\n */\n _collectTabbableNodes: function (node, result) {\n // If not an element or not visible, no need to explore children.\n if (\n node.nodeType !== Node.ELEMENT_NODE ||\n !IronFocusablesHelper._isVisible(node)\n ) {\n return false;\n }\n var element = /** @type {!HTMLElement} */ (node);\n var tabIndex = IronFocusablesHelper._normalizedTabIndex(element);\n var needsSort = tabIndex > 0;\n if (tabIndex >= 0) {\n result.push(element);\n }\n\n // In ShadowDOM v1, tab order is affected by the order of distrubution.\n // E.g. getTabbableNodes(#root) in ShadowDOM v1 should return [#A, #B];\n // in ShadowDOM v0 tab order is not affected by the distrubution order,\n // in fact getTabbableNodes(#root) returns [#B, #A].\n // <div id=\"root\">\n // <!-- shadow -->\n // <slot name=\"a\">\n // <slot name=\"b\">\n // <!-- /shadow -->\n // <input id=\"A\" slot=\"a\">\n // <input id=\"B\" slot=\"b\" tabindex=\"1\">\n // </div>\n // TODO(valdrin) support ShadowDOM v1 when upgrading to Polymer v2.0.\n var children;\n if (element.localName === \"content\" || element.localName === \"slot\") {\n children = dom(element).getDistributedNodes();\n } else {\n // /////////////////////////\n // Use shadow root if possible, will check for distributed nodes.\n // THIS IS THE CHANGED LINE\n children = dom(element.shadowRoot || element.root || element).children;\n // /////////////////////////\n }\n for (var i = 0; i < children.length; i++) {\n // Ensure method is always invoked to collect tabbable children.\n needsSort = this._collectTabbableNodes(children[i], result) || needsSort;\n }\n return needsSort;\n },\n};\n"],"mappings":"AAgBA","sourceRoot":""}

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

View File

@ -0,0 +1 @@
{"version":3,"file":"chunk.3da0764ff5ed49302c8a.worker.js","sources":["webpack:///webpack/bootstrap"],"sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/api/hassio/app/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 15);\n"],"mappings":"AACA","sourceRoot":""}

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -0,0 +1 @@
{"version":3,"file":"chunk.4223bae6cb28b94d3bb4.js","sources":["webpack:///./src/data/auth.ts"],"sourcesContent":["import { HomeAssistant } from \"../types\";\n\nexport interface AuthProvider {\n name: string;\n id: string;\n type: string;\n}\n\nexport interface Credential {\n type: string;\n}\n\nexport interface SignedPath {\n path: string;\n}\n\nexport const hassUrl = `${location.protocol}//${location.host}`;\n\nexport const getSignedPath = (\n hass: HomeAssistant,\n path: string\n): Promise<SignedPath> => hass.callWS({ type: \"auth/sign_path\", path });\n\nexport const fetchAuthProviders = () =>\n fetch(\"/auth/providers\", {\n credentials: \"same-origin\",\n });\n\nexport const createAuthForUser = async (\n hass: HomeAssistant,\n userId: string,\n username: string,\n password: string\n) =>\n hass.callWS({\n type: \"config/auth_provider/homeassistant/create\",\n user_id: userId,\n username,\n password,\n });\n"],"mappings":"AAgBA","sourceRoot":""}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,34 @@
/**
@license
Copyright 2018 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/**
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at
http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
part of the polymer project is also subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt
*/
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/

Binary file not shown.

View File

@ -0,0 +1 @@
{"version":3,"file":"chunk.473a297b6ad67535a13a.js","sources":["webpack:///./node_modules/js-yaml/lib/js-yaml/type.js"],"sourcesContent":["'use strict';\n\nvar YAMLException = require('./exception');\n\nvar TYPE_CONSTRUCTOR_OPTIONS = [\n 'kind',\n 'resolve',\n 'construct',\n 'instanceOf',\n 'predicate',\n 'represent',\n 'defaultStyle',\n 'styleAliases'\n];\n\nvar YAML_NODE_KINDS = [\n 'scalar',\n 'sequence',\n 'mapping'\n];\n\nfunction compileStyleAliases(map) {\n var result = {};\n\n if (map !== null) {\n Object.keys(map).forEach(function (style) {\n map[style].forEach(function (alias) {\n result[String(alias)] = style;\n });\n });\n }\n\n return result;\n}\n\nfunction Type(tag, options) {\n options = options || {};\n\n Object.keys(options).forEach(function (name) {\n if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {\n throw new YAMLException('Unknown option \"' + name + '\" is met in definition of \"' + tag + '\" YAML type.');\n }\n });\n\n // TODO: Add tag format check.\n this.tag = tag;\n this.kind = options['kind'] || null;\n this.resolve = options['resolve'] || function () { return true; };\n this.construct = options['construct'] || function (data) { return data; };\n this.instanceOf = options['instanceOf'] || null;\n this.predicate = options['predicate'] || null;\n this.represent = options['represent'] || null;\n this.defaultStyle = options['defaultStyle'] || null;\n this.styleAliases = compileStyleAliases(options['styleAliases'] || null);\n\n if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {\n throw new YAMLException('Unknown kind \"' + this.kind + '\" is specified for \"' + tag + '\" YAML type.');\n }\n}\n\nmodule.exports = Type;\n"],"mappings":";AAEA","sourceRoot":""}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,290 @@
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/
/**
@license
Copyright (c) 2019 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at
http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
part of the polymer project is also subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt
*/
/**
@license
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/**
@license
Copyright 2018 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/**
@license
Copyright 2019 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/**
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at
http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
part of the polymer project is also subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt
*/
/**
* @license
* Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/
/**
* @license
* Copyright 2016 Google Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* @license
* Copyright 2018 Google Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
@license
Copyright 2020 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/**
* @license
* Copyright 2019 Google Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
@license
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at
http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
part of the polymer project is also subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt
*/
/**
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
/**
@license
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at
http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
part of the polymer project is also subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt
*/
/**
@license
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at
http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
part of the polymer project is also subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt
*/
/**
@license
Copyright 2020 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/**
* @license
* Copyright 2016 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*!
* Fuse.js v3.4.4 - Lightweight fuzzy-search (http://fusejs.io)
*
* Copyright (c) 2012-2017 Kirollos Risk (http://kiro.me)
* All Rights Reserved. Apache Software License 2.0
*
* http://www.apache.org/licenses/LICENSE-2.0
*/
/**
@license
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/

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

@ -0,0 +1 @@
{"version":3,"file":"chunk.a13df8fc50eb25140356.js","sources":["webpack:///./hassio/src/ingress-view/hassio-ingress-view.ts"],"sourcesContent":["import {\n css,\n CSSResult,\n customElement,\n html,\n LitElement,\n property,\n PropertyValues,\n TemplateResult,\n} from \"lit-element\";\nimport {\n fetchHassioAddonInfo,\n HassioAddonDetails,\n} from \"../../../src/data/hassio/addon\";\nimport { createHassioSession } from \"../../../src/data/hassio/supervisor\";\nimport \"../../../src/layouts/hass-loading-screen\";\nimport \"../../../src/layouts/hass-subpage\";\nimport { HomeAssistant, Route } from \"../../../src/types\";\n\n@customElement(\"hassio-ingress-view\")\nclass HassioIngressView extends LitElement {\n @property() public hass!: HomeAssistant;\n\n @property() public route!: Route;\n\n @property() private _addon?: HassioAddonDetails;\n\n protected render(): TemplateResult {\n if (!this._addon) {\n return html` <hass-loading-screen></hass-loading-screen> `;\n }\n\n return html`\n <hass-subpage .header=${this._addon.name} hassio>\n <iframe src=${this._addon.ingress_url}></iframe>\n </hass-subpage>\n `;\n }\n\n protected updated(changedProps: PropertyValues) {\n super.firstUpdated(changedProps);\n\n if (!changedProps.has(\"route\")) {\n return;\n }\n\n const addon = this.route.path.substr(1);\n\n const oldRoute = changedProps.get(\"route\") as this[\"route\"] | undefined;\n const oldAddon = oldRoute ? oldRoute.path.substr(1) : undefined;\n\n if (addon && addon !== oldAddon) {\n this._fetchData(addon);\n }\n }\n\n private async _fetchData(addonSlug: string) {\n try {\n const [addon] = await Promise.all([\n fetchHassioAddonInfo(this.hass, addonSlug).catch(() => {\n throw new Error(\"Failed to fetch add-on info\");\n }),\n createHassioSession(this.hass).catch(() => {\n throw new Error(\"Failed to create an ingress session\");\n }),\n ]);\n\n if (!addon.ingress) {\n throw new Error(\"This add-on does not support ingress\");\n }\n\n this._addon = addon;\n } catch (err) {\n // eslint-disable-next-line\n console.error(err);\n alert(err.message || \"Unknown error starting ingress.\");\n history.back();\n }\n }\n\n static get styles(): CSSResult {\n return css`\n iframe {\n display: block;\n width: 100%;\n height: 100%;\n border: 0;\n }\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"hassio-ingress-view\": HassioIngressView;\n }\n}\n"],"mappings":"AAmBA","sourceRoot":""}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,27 @@
/**
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at
http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
part of the polymer project is also subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt
*/
/**
@license
Copyright 2018 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"version":3,"sources":["webpack:///./src/resources/roboto.js"],"names":["documentContainer","document","createElement","setAttribute","innerHTML","head","appendChild","content"],"mappings":"oEAAA,IAAMA,EAAoBC,SAASC,cAAc,YACjDF,EAAkBG,aAAa,QAAS,kBAExCH,EAAkBI,UAAlB,6gFA+GAH,SAASI,KAAKC,YAAYN,EAAkBO","file":"chunk.dd9697afb9d7acfa2f9a.js","sourcesContent":["const documentContainer = document.createElement(\"template\");\ndocumentContainer.setAttribute(\"style\", \"display: none;\");\n\ndocumentContainer.innerHTML = `<style>\n@font-face {\nfont-family: \"Roboto\";\nsrc:\n local(\"Roboto Thin\"),\n local(\"Roboto-Thin\"),\n url(/static/fonts/roboto/Roboto-Thin.woff2) format(\"woff2\");\nfont-weight: 100;\nfont-style: normal;\n}\n@font-face {\nfont-family: \"Roboto\";\nsrc:\n local(\"Roboto Thin Italic\"),\n local(\"Roboto-ThinItalic\"),\n url(/static/fonts/roboto/Roboto-ThinItalic.woff2) format(\"woff2\");\nfont-weight: 100;\nfont-style: italic;\n}\n@font-face {\nfont-family: \"Roboto\";\nsrc:\n local(\"Roboto Light\"),\n local(\"Roboto-Light\"),\n url(/static/fonts/roboto/Roboto-Light.woff2) format(\"woff2\");\nfont-weight: 300;\nfont-style: normal;\n}\n@font-face {\nfont-family: \"Roboto\";\nsrc:\n local(\"Roboto Light Italic\"),\n local(\"Roboto-LightItalic\"),\n url(/static/fonts/roboto/Roboto-LightItalic.woff2) format(\"woff2\");\nfont-weight: 300;\nfont-style: italic;\n}\n@font-face {\nfont-family: \"Roboto\";\nsrc:\n local(\"Roboto Regular\"),\n local(\"Roboto-Regular\"),\n url(/static/fonts/roboto/Roboto-Regular.woff2) format(\"woff2\");\nfont-weight: 400;\nfont-style: normal;\n}\n@font-face {\nfont-family: \"Roboto\";\nsrc:\n local(\"Roboto Italic\"),\n local(\"Roboto-Italic\"),\n url(/static/fonts/roboto/Roboto-RegularItalic.woff2) format(\"woff2\");\nfont-weight: 400;\nfont-style: italic;\n}\n@font-face {\nfont-family: \"Roboto\";\nsrc:\n local(\"Roboto Medium\"),\n local(\"Roboto-Medium\"),\n url(/static/fonts/roboto/Roboto-Medium.woff2) format(\"woff2\");\nfont-weight: 500;\nfont-style: normal;\n}\n@font-face {\nfont-family: \"Roboto\";\nsrc:\n local(\"Roboto Medium Italic\"),\n local(\"Roboto-MediumItalic\"),\n url(/static/fonts/roboto/Roboto-MediumItalic.woff2) format(\"woff2\");\nfont-weight: 500;\nfont-style: italic;\n}\n@font-face {\nfont-family: \"Roboto\";\nsrc:\n local(\"Roboto Bold\"),\n local(\"Roboto-Bold\"),\n url(/static/fonts/roboto/Roboto-Bold.woff2) format(\"woff2\");\nfont-weight: 700;\nfont-style: normal;\n}\n@font-face {\nfont-family: \"Roboto\";\nsrc:\n local(\"Roboto Bold Italic\"),\n local(\"Roboto-BoldItalic\"),\n url(/static/fonts/roboto/Roboto-BoldItalic.woff2) format(\"woff2\");\nfont-weight: 700;\nfont-style: italic;\n}\n@font-face {\nfont-family: \"Roboto\";\nsrc:\n local(\"Roboto Black\"),\n local(\"Roboto-Black\"),\n url(/static/fonts/roboto/Roboto-Black.woff2) format(\"woff2\");\nfont-weight: 900;\nfont-style: normal;\n}\n@font-face {\nfont-family: \"Roboto\";\nsrc:\n local(\"Roboto Black Italic\"),\n local(\"Roboto-BlackItalic\"),\n url(/static/fonts/roboto/Roboto-BlackItalic.woff2) format(\"woff2\");\nfont-weight: 900;\nfont-style: italic;\n}\n</style>`;\n\ndocument.head.appendChild(documentContainer.content);\n\n/**\n@license\nCopyright (c) 2015 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n/*\n FIXME(polymer-modulizer): the above comments were extracted\n from HTML and may be out of place here. Review them and\n then delete this comment!\n*/\n"],"sourceRoot":""}
{"version":3,"file":"chunk.dd9697afb9d7acfa2f9a.js","sources":["webpack:///./src/resources/roboto.js"],"sourcesContent":["const documentContainer = document.createElement(\"template\");\ndocumentContainer.setAttribute(\"style\", \"display: none;\");\n\ndocumentContainer.innerHTML = `<style>\n@font-face {\nfont-family: \"Roboto\";\nsrc:\n local(\"Roboto Thin\"),\n local(\"Roboto-Thin\"),\n url(/static/fonts/roboto/Roboto-Thin.woff2) format(\"woff2\");\nfont-weight: 100;\nfont-style: normal;\n}\n@font-face {\nfont-family: \"Roboto\";\nsrc:\n local(\"Roboto Thin Italic\"),\n local(\"Roboto-ThinItalic\"),\n url(/static/fonts/roboto/Roboto-ThinItalic.woff2) format(\"woff2\");\nfont-weight: 100;\nfont-style: italic;\n}\n@font-face {\nfont-family: \"Roboto\";\nsrc:\n local(\"Roboto Light\"),\n local(\"Roboto-Light\"),\n url(/static/fonts/roboto/Roboto-Light.woff2) format(\"woff2\");\nfont-weight: 300;\nfont-style: normal;\n}\n@font-face {\nfont-family: \"Roboto\";\nsrc:\n local(\"Roboto Light Italic\"),\n local(\"Roboto-LightItalic\"),\n url(/static/fonts/roboto/Roboto-LightItalic.woff2) format(\"woff2\");\nfont-weight: 300;\nfont-style: italic;\n}\n@font-face {\nfont-family: \"Roboto\";\nsrc:\n local(\"Roboto Regular\"),\n local(\"Roboto-Regular\"),\n url(/static/fonts/roboto/Roboto-Regular.woff2) format(\"woff2\");\nfont-weight: 400;\nfont-style: normal;\n}\n@font-face {\nfont-family: \"Roboto\";\nsrc:\n local(\"Roboto Italic\"),\n local(\"Roboto-Italic\"),\n url(/static/fonts/roboto/Roboto-RegularItalic.woff2) format(\"woff2\");\nfont-weight: 400;\nfont-style: italic;\n}\n@font-face {\nfont-family: \"Roboto\";\nsrc:\n local(\"Roboto Medium\"),\n local(\"Roboto-Medium\"),\n url(/static/fonts/roboto/Roboto-Medium.woff2) format(\"woff2\");\nfont-weight: 500;\nfont-style: normal;\n}\n@font-face {\nfont-family: \"Roboto\";\nsrc:\n local(\"Roboto Medium Italic\"),\n local(\"Roboto-MediumItalic\"),\n url(/static/fonts/roboto/Roboto-MediumItalic.woff2) format(\"woff2\");\nfont-weight: 500;\nfont-style: italic;\n}\n@font-face {\nfont-family: \"Roboto\";\nsrc:\n local(\"Roboto Bold\"),\n local(\"Roboto-Bold\"),\n url(/static/fonts/roboto/Roboto-Bold.woff2) format(\"woff2\");\nfont-weight: 700;\nfont-style: normal;\n}\n@font-face {\nfont-family: \"Roboto\";\nsrc:\n local(\"Roboto Bold Italic\"),\n local(\"Roboto-BoldItalic\"),\n url(/static/fonts/roboto/Roboto-BoldItalic.woff2) format(\"woff2\");\nfont-weight: 700;\nfont-style: italic;\n}\n@font-face {\nfont-family: \"Roboto\";\nsrc:\n local(\"Roboto Black\"),\n local(\"Roboto-Black\"),\n url(/static/fonts/roboto/Roboto-Black.woff2) format(\"woff2\");\nfont-weight: 900;\nfont-style: normal;\n}\n@font-face {\nfont-family: \"Roboto\";\nsrc:\n local(\"Roboto Black Italic\"),\n local(\"Roboto-BlackItalic\"),\n url(/static/fonts/roboto/Roboto-BlackItalic.woff2) format(\"woff2\");\nfont-weight: 900;\nfont-style: italic;\n}\n</style>`;\n\ndocument.head.appendChild(documentContainer.content);\n\n/**\n@license\nCopyright (c) 2015 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n/*\n FIXME(polymer-modulizer): the above comments were extracted\n from HTML and may be out of place here. Review them and\n then delete this comment!\n*/\n"],"mappings":"AAAA","sourceRoot":""}

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

Binary file not shown.

View File

@ -0,0 +1 @@
{"version":3,"file":"chunk.fd9e236592d4dc38ec71.js","sources":["webpack:///./hassio/src/dialogs/suggestAddonRestart.ts"],"sourcesContent":["import type { LitElement } from \"lit-element\";\nimport {\n HassioAddonDetails,\n restartHassioAddon,\n} from \"../../../src/data/hassio/addon\";\nimport {\n showAlertDialog,\n showConfirmationDialog,\n} from \"../../../src/dialogs/generic/show-dialog-box\";\nimport { HomeAssistant } from \"../../../src/types\";\n\nexport const suggestAddonRestart = async (\n element: LitElement,\n hass: HomeAssistant,\n addon: HassioAddonDetails\n): Promise<void> => {\n const confirmed = await showConfirmationDialog(element, {\n title: addon.name,\n text: \"Do you want to restart the add-on with your changes?\",\n confirmText: \"restart add-on\",\n dismissText: \"no\",\n });\n if (confirmed) {\n try {\n await restartHassioAddon(hass, addon.slug);\n } catch (err) {\n showAlertDialog(element, {\n title: \"Failed to restart\",\n text: err.body.message,\n });\n }\n }\n};\n"],"mappings":"AAWA","sourceRoot":""}

View File

@ -1,2 +1,2 @@
!function(e){function n(n){for(var t,o,a=n[0],i=n[1],f=0,c=[];f<a.length;f++)o=a[f],Object.prototype.hasOwnProperty.call(r,o)&&r[o]&&c.push(r[o][0]),r[o]=0;for(t in i)Object.prototype.hasOwnProperty.call(i,t)&&(e[t]=i[t]);for(u&&u(n);c.length;)c.shift()()}var t={},r={5:0};function o(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.e=function(e){var n=[],t=r[e];if(0!==t)if(t)n.push(t[2]);else{var a=new Promise(function(n,o){t=r[e]=[n,o]});n.push(t[2]=a);var i,f=document.createElement("script");f.charset="utf-8",f.timeout=120,o.nc&&f.setAttribute("nonce",o.nc),f.src=function(e){return o.p+"chunk."+{0:"b4210ce95c479d064904",1:"191b24e89a6c62b8c9ff",2:"e9ff3f9ba264bd09e9da",3:"cee4e499acaf7f10d114",4:"fbeedc21f0dfe1202da0",6:"eaf9f04351a38c55ef6d",7:"e3ba9a7a217e17849082",8:"21c40e328e283f71a3a9",9:"dd9697afb9d7acfa2f9a",10:"aa1f2ea8d4a3e8116f6b",11:"a46f93d2ba55f6653f6d",12:"a28c3e62d954cbdbabea"}[e]+".js"}(e);var u=new Error;i=function(n){f.onerror=f.onload=null,clearTimeout(c);var t=r[e];if(0!==t){if(t){var o=n&&("load"===n.type?"missing":n.type),a=n&&n.target&&n.target.src;u.message="Loading chunk "+e+" failed.\n("+o+": "+a+")",u.name="ChunkLoadError",u.type=o,u.request=a,t[1](u)}r[e]=void 0}};var c=setTimeout(function(){i({type:"timeout",target:f})},12e4);f.onerror=f.onload=i,document.head.appendChild(f)}return Promise.all(n)},o.m=e,o.c=t,o.d=function(e,n,t){o.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:t})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,n){if(1&n&&(e=o(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(o.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var r in e)o.d(t,r,function(n){return e[n]}.bind(null,r));return t},o.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(n,"a",n),n},o.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},o.p="/api/hassio/app/",o.oe=function(e){throw console.error(e),e};var a=self.webpackJsonp=self.webpackJsonp||[],i=a.push.bind(a);a.push=n,a=a.slice();for(var f=0;f<a.length;f++)n(a[f]);var u=i;o(o.s=0)}([function(e,n,t){window.loadES5Adapter().then(function(){t.e(9).then(t.t.bind(null,1,7)),Promise.all([t.e(12),t.e(8)]).then(t.bind(null,3))});var r=document.createElement("style");r.innerHTML="\nbody {\n font-family: Roboto, sans-serif;\n -moz-osx-font-smoothing: grayscale;\n -webkit-font-smoothing: antialiased;\n font-weight: 400;\n margin: 0;\n padding: 0;\n height: 100vh;\n}\n",document.head.appendChild(r)},,function(e,n){if("undefined"==typeof esprima){var t=new Error("Cannot find module 'esprima'");throw t.code="MODULE_NOT_FOUND",t}e.exports=esprima}]);
!function(e){function n(n){for(var t,o,a=n[0],i=n[1],f=0,u=[];f<a.length;f++)o=a[f],Object.prototype.hasOwnProperty.call(r,o)&&r[o]&&u.push(r[o][0]),r[o]=0;for(t in i)Object.prototype.hasOwnProperty.call(i,t)&&(e[t]=i[t]);for(c&&c(n);u.length;)u.shift()()}var t={},r={5:0};function o(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.e=function(e){var n=[],t=r[e];if(0!==t)if(t)n.push(t[2]);else{var a=new Promise(function(n,o){t=r[e]=[n,o]});n.push(t[2]=a);var i,f=document.createElement("script");f.charset="utf-8",f.timeout=120,o.nc&&f.setAttribute("nonce",o.nc),f.src=function(e){return o.p+"chunk."+{0:"0f72ffcda496ba135cd8",1:"1009a4a228e1b844359a",2:"33bfb7d5880765434044",3:"3825f21cff675c9ee2ad",4:"4223bae6cb28b94d3bb4",6:"fd9e236592d4dc38ec71",7:"a13df8fc50eb25140356",8:"0ebda88ce75397d2f09b",9:"dd9697afb9d7acfa2f9a",10:"e8554c2637626b079983",11:"c080894d91c6be9604de",12:"473a297b6ad67535a13a",13:"57b3edaf03f03f999e2a"}[e]+".js"}(e);var c=new Error;i=function(n){f.onerror=f.onload=null,clearTimeout(u);var t=r[e];if(0!==t){if(t){var o=n&&("load"===n.type?"missing":n.type),a=n&&n.target&&n.target.src;c.message="Loading chunk "+e+" failed.\n("+o+": "+a+")",c.name="ChunkLoadError",c.type=o,c.request=a,t[1](c)}r[e]=void 0}};var u=setTimeout(function(){i({type:"timeout",target:f})},12e4);f.onerror=f.onload=i,document.head.appendChild(f)}return Promise.all(n)},o.m=e,o.c=t,o.d=function(e,n,t){o.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:t})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,n){if(1&n&&(e=o(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(o.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var r in e)o.d(t,r,function(n){return e[n]}.bind(null,r));return t},o.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(n,"a",n),n},o.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},o.p="/api/hassio/app/",o.oe=function(e){throw console.error(e),e};var a=self.webpackJsonp=self.webpackJsonp||[],i=a.push.bind(a);a.push=n,a=a.slice();for(var f=0;f<a.length;f++)n(a[f]);var c=i;o(o.s=0)}([function(e,n,t){window.loadES5Adapter().then(function(){t.e(9).then(t.t.bind(null,1,7)),Promise.all([t.e(13),t.e(8)]).then(t.bind(null,3))});var r=document.createElement("style");r.innerHTML="\nbody {\n font-family: Roboto, sans-serif;\n -moz-osx-font-smoothing: grayscale;\n -webkit-font-smoothing: antialiased;\n font-weight: 400;\n margin: 0;\n padding: 0;\n height: 100vh;\n}\n",document.head.appendChild(r)},,function(e,n){if("undefined"==typeof esprima){var t=new Error("Cannot find module 'esprima'");throw t.code="MODULE_NOT_FOUND",t}e.exports=esprima}]);
//# sourceMappingURL=entrypoint.js.map

File diff suppressed because one or more lines are too long

View File

@ -1,34 +1,3 @@
{
"vendors~confirmation~hassio-addon-dashboard.js": "/api/hassio/app/chunk.b4210ce95c479d064904.js",
"vendors~confirmation~hassio-addon-dashboard.js.map": "/api/hassio/app/chunk.b4210ce95c479d064904.js.map",
"codemirror.js": "/api/hassio/app/chunk.191b24e89a6c62b8c9ff.js",
"codemirror.js.map": "/api/hassio/app/chunk.191b24e89a6c62b8c9ff.js.map",
"confirmation.js": "/api/hassio/app/chunk.e9ff3f9ba264bd09e9da.js",
"confirmation.js.map": "/api/hassio/app/chunk.e9ff3f9ba264bd09e9da.js.map",
"dialog-hassio-markdown.js": "/api/hassio/app/chunk.cee4e499acaf7f10d114.js",
"dialog-hassio-markdown.js.map": "/api/hassio/app/chunk.cee4e499acaf7f10d114.js.map",
"dialog-hassio-snapshot.js": "/api/hassio/app/chunk.fbeedc21f0dfe1202da0.js",
"dialog-hassio-snapshot.js.map": "/api/hassio/app/chunk.fbeedc21f0dfe1202da0.js.map",
"entrypoint.js": "/api/hassio/app/entrypoint.js",
"entrypoint.js.map": "/api/hassio/app/entrypoint.js.map",
"hassio-addon-dashboard.js": "/api/hassio/app/chunk.eaf9f04351a38c55ef6d.js",
"hassio-addon-dashboard.js.map": "/api/hassio/app/chunk.eaf9f04351a38c55ef6d.js.map",
"hassio-ingress-view.js": "/api/hassio/app/chunk.e3ba9a7a217e17849082.js",
"hassio-ingress-view.js.map": "/api/hassio/app/chunk.e3ba9a7a217e17849082.js.map",
"hassio-main.js": "/api/hassio/app/chunk.21c40e328e283f71a3a9.js",
"hassio-main.js.map": "/api/hassio/app/chunk.21c40e328e283f71a3a9.js.map",
"roboto.js": "/api/hassio/app/chunk.dd9697afb9d7acfa2f9a.js",
"roboto.js.map": "/api/hassio/app/chunk.dd9697afb9d7acfa2f9a.js.map",
"vendors~codemirror.js": "/api/hassio/app/chunk.aa1f2ea8d4a3e8116f6b.js",
"vendors~codemirror.js.map": "/api/hassio/app/chunk.aa1f2ea8d4a3e8116f6b.js.map",
"vendors~hassio-addon-dashboard.js": "/api/hassio/app/chunk.a46f93d2ba55f6653f6d.js",
"vendors~hassio-addon-dashboard.js.map": "/api/hassio/app/chunk.a46f93d2ba55f6653f6d.js.map",
"vendors~hassio-main.js": "/api/hassio/app/chunk.a28c3e62d954cbdbabea.js",
"vendors~hassio-main.js.map": "/api/hassio/app/chunk.a28c3e62d954cbdbabea.js.map",
"chunk.a28c3e62d954cbdbabea.js.LICENSE": "/api/hassio/app/chunk.a28c3e62d954cbdbabea.js.LICENSE",
"chunk.a46f93d2ba55f6653f6d.js.LICENSE": "/api/hassio/app/chunk.a46f93d2ba55f6653f6d.js.LICENSE",
"chunk.b4210ce95c479d064904.js.LICENSE": "/api/hassio/app/chunk.b4210ce95c479d064904.js.LICENSE",
"chunk.e9ff3f9ba264bd09e9da.js.LICENSE": "/api/hassio/app/chunk.e9ff3f9ba264bd09e9da.js.LICENSE",
"ebabbd902502a5b4d115.worker.js": "/api/hassio/app/ebabbd902502a5b4d115.worker.js",
"ebabbd902502a5b4d115.worker.js.map": "/api/hassio/app/ebabbd902502a5b4d115.worker.js.map"
"entrypoint.js": "/api/hassio/app/entrypoint.js"
}

View File

@ -214,27 +214,27 @@ def check_environment() -> None:
try:
os.environ[key]
except KeyError:
_LOGGER.fatal("Can't find %s in env!", key)
_LOGGER.critical("Can't find %s in env!", key)
# Check Machine info
if not os.environ.get(ENV_HOMEASSISTANT_REPOSITORY) and not os.environ.get(
ENV_SUPERVISOR_MACHINE
):
_LOGGER.fatal("Can't find any kind of machine/homeassistant details!")
_LOGGER.critical("Can't find any kind of machine/homeassistant details!")
elif not os.environ.get(ENV_SUPERVISOR_MACHINE):
_LOGGER.info("Use the old homeassistant repository for machine extraction")
# check docker socket
if not SOCKET_DOCKER.is_socket():
_LOGGER.fatal("Can't find Docker socket!")
_LOGGER.critical("Can't find Docker socket!")
# check socat exec
if not shutil.which("socat"):
_LOGGER.fatal("Can't find socat!")
_LOGGER.critical("Can't find socat!")
# check socat exec
if not shutil.which("gdbus"):
_LOGGER.fatal("Can't find gdbus!")
_LOGGER.critical("Can't find gdbus!")
def reg_signal(loop):

View File

@ -69,7 +69,7 @@ class CoreConfig(JsonConfig):
@version.setter
def version(self, value: str):
"""Set config version."""
self._data[ATTR_VERSION] = str
self._data[ATTR_VERSION] = value
@property
def wait_boot(self) -> int:

View File

@ -3,7 +3,7 @@ from enum import Enum
from ipaddress import ip_network
from pathlib import Path
SUPERVISOR_VERSION = "222"
SUPERVISOR_VERSION = "223"
URL_HASSIO_ADDONS = "https://github.com/home-assistant/hassio-addons"
@ -76,6 +76,7 @@ ENV_SUPERVISOR_MACHINE = "SUPERVISOR_MACHINE"
REQUEST_FROM = "HASSIO_FROM"
ATTR_DOCKER = "docker"
ATTR_SUPERVISOR = "supervisor"
ATTR_MACHINE = "machine"
ATTR_MULTICAST = "multicast"

View File

@ -31,7 +31,7 @@ class Core(CoreSysAttributes):
"""Connect Supervisor container."""
await self.sys_supervisor.load()
# Check if system is healthy
# If a update is failed?
if self.sys_dev:
self.sys_config.version = self.sys_supervisor.version
elif (
@ -39,7 +39,22 @@ class Core(CoreSysAttributes):
and self.sys_config.version != self.sys_supervisor.version
):
self.healthy = False
_LOGGER.fatal("System running in a unhealthy state. Please update you OS!")
_LOGGER.critical("Update of Supervisor fails!")
# If local docker is supported?
if not self.sys_docker.info.supported_version:
self.healthy = False
_LOGGER.critical(
"Docker version %s is not supported by Supervisor!",
self.sys_docker.info.version,
)
self.sys_docker.info.check_requirements()
# Check if system is healthy
if not self.healthy:
_LOGGER.critical(
"System running in a unhealthy state. Please update you OS or software!"
)
async def setup(self):
"""Setup supervisor orchestration."""
@ -106,7 +121,7 @@ class Core(CoreSysAttributes):
else:
await self.sys_supervisor.update()
except SupervisorUpdateError:
_LOGGER.fatal(
_LOGGER.critical(
"Can't update supervisor! This will break some Add-ons or affect "
"future version of Home Assistant!"
)

View File

@ -6,6 +6,7 @@ from typing import Any, Dict, Optional
import attr
import docker
from packaging import version as pkg_version
from ..const import SOCKET_DOCKER, DNS_SUFFIX
from ..exceptions import DockerAPIError
@ -13,6 +14,8 @@ from .network import DockerNetwork
_LOGGER: logging.Logger = logging.getLogger(__name__)
MIN_SUPPORTED_DOCKER = "19.03.0"
@attr.s(frozen=True)
class CommandReturn:
@ -22,6 +25,36 @@ class CommandReturn:
output: bytes = attr.ib()
@attr.s(frozen=True)
class DockerInfo:
"""Return docker information."""
version: str = attr.ib()
storage: str = attr.ib()
logging: str = attr.ib()
@staticmethod
def new(data: Dict[str, Any]):
"""Create a object from docker info."""
return DockerInfo(data["ServerVersion"], data["Driver"], data["LoggingDriver"])
@property
def supported_version(self) -> bool:
"""Return true, if docker version is supported."""
version_local = pkg_version.parse(self.version)
version_min = pkg_version.parse(MIN_SUPPORTED_DOCKER)
return version_local >= version_min
def check_requirements(self) -> None:
"""Show wrong configurations."""
if self.storage != "overlay2":
_LOGGER.error("Docker storage driver %s is not supported!", self.storage)
if self.logging != "journald":
_LOGGER.error("Docker logging driver %s is not supported!", self.logging)
class DockerAPI:
"""Docker Supervisor wrapper.
@ -34,6 +67,7 @@ class DockerAPI:
base_url="unix:/{}".format(str(SOCKET_DOCKER)), version="auto", timeout=900
)
self.network: DockerNetwork = DockerNetwork(self.docker)
self._info: DockerInfo = DockerInfo.new(self.docker.info())
@property
def images(self) -> docker.models.images.ImageCollection:
@ -50,6 +84,11 @@ class DockerAPI:
"""Return API containers."""
return self.docker.api
@property
def info(self) -> DockerInfo:
"""Return local docker info."""
return self._info
def run(
self,
image: str,

View File

@ -23,7 +23,7 @@ class DockerInterface(CoreSysAttributes):
"""Initialize Docker base wrapper."""
self.coresys: CoreSys = coresys
self._meta: Optional[Dict[str, Any]] = None
self.lock: asyncio.Lock = asyncio.Lock(loop=coresys.loop)
self.lock: asyncio.Lock = asyncio.Lock()
@property
def timeout(self) -> str:

View File

@ -67,7 +67,7 @@ class HomeAssistant(JsonConfig, CoreSysAttributes):
super().__init__(FILE_HASSIO_HOMEASSISTANT, SCHEMA_HASS_CONFIG)
self.coresys: CoreSys = coresys
self.instance: DockerHomeAssistant = DockerHomeAssistant(coresys)
self.lock: asyncio.Lock = asyncio.Lock(loop=coresys.loop)
self.lock: asyncio.Lock = asyncio.Lock()
self._error_state: bool = False
# We don't persist access tokens. Instead we fetch new ones when needed
@ -356,7 +356,7 @@ class HomeAssistant(JsonConfig, CoreSysAttributes):
# Update going wrong, revert it
if self.error_state and rollback:
_LOGGER.fatal("HomeAssistant update fails -> rollback!")
_LOGGER.critical("HomeAssistant update fails -> rollback!")
await _update(rollback)
else:
raise HomeAssistantUpdateError()

View File

@ -28,7 +28,7 @@ class HwMonitor(CoreSysAttributes):
self.monitor = pyudev.Monitor.from_netlink(self.context)
self.observer = pyudev.MonitorObserver(self.monitor, self._udev_events)
except OSError:
_LOGGER.fatal("Not privileged to run udev monitor!")
_LOGGER.critical("Not privileged to run udev monitor!")
else:
self.observer.start()
_LOGGER.info("Started Supervisor hardware monitor")

View File

@ -64,7 +64,7 @@ class Scheduler:
job = self.loop.call_at(calc.timestamp(), self._run_task, task_id)
else:
_LOGGER.fatal(
_LOGGER.critical(
"Unknown interval %s (type: %s) for scheduler %s",
interval,
type(interval),

View File

@ -19,7 +19,7 @@ class SnapshotManager(CoreSysAttributes):
"""Initialize a snapshot manager."""
self.coresys = coresys
self.snapshots_obj = {}
self.lock = asyncio.Lock(loop=coresys.loop)
self.lock = asyncio.Lock()
@property
def list_snapshots(self):

View File

@ -23,7 +23,7 @@ class GitRepo(CoreSysAttributes):
self.coresys = coresys
self.repo = None
self.path = path
self.lock = asyncio.Lock(loop=coresys.loop)
self.lock = asyncio.Lock()
self.data = RE_REPOSITORY.match(url).groupdict()

View File

@ -36,7 +36,7 @@ class Supervisor(CoreSysAttributes):
try:
await self.instance.attach(tag="latest")
except DockerAPIError:
_LOGGER.fatal("Can't setup Supervisor Docker container!")
_LOGGER.critical("Can't setup Supervisor Docker container!")
with suppress(DockerAPIError):
await self.instance.cleanup()

View File

@ -40,6 +40,7 @@ def sys_machine():
@pytest.fixture
def sys_supervisor():
"""Mock sys_supervisor."""
with patch(
"supervisor.coresys.CoreSys.supervisor", new_callable=PropertyMock
) as mock:

View File

@ -10,8 +10,7 @@ def test_good_config():
"""Test good zwave mqtt config."""
valid_discovery_config(
"zwave_mqtt",
{"host": "test", "port": 3812, "username": "bla", "password": "test"},
"ozw", {"host": "test", "port": 3812, "username": "bla", "password": "test"},
)
@ -19,6 +18,4 @@ def test_bad_config():
"""Test good zwave mqtt config."""
with pytest.raises(vol.Invalid):
valid_discovery_config(
"zwave_mqtt", {"host": "test", "username": "bla", "ssl": True}
)
valid_discovery_config("ozw", {"host": "test", "username": "bla", "ssl": True})

View File

@ -4,8 +4,8 @@ from unittest.mock import patch
import pytest
@pytest.fixture(autouse=True)
def mock_detect_cpu():
@pytest.fixture(name="mock_detect_cpu", autouse=True)
def mock_detect_cpu_fixture():
"""Mock cpu detection."""
with patch("platform.machine") as detect_mock:
detect_mock.return_value = "Unknown"

View File

@ -1,14 +1,13 @@
"""Test Tarfile functions."""
import attr
import pytest
from supervisor.utils.tar import secure_path, exclude_filter
@attr.s
class TarInfo:
"""Fake TarInfo"""
"""Fake TarInfo."""
name: str = attr.ib()

View File

@ -10,8 +10,8 @@ deps =
basepython = python3
ignore_errors = True
commands =
flake8 supervisor
pylint --rcfile pylintrc supervisor
flake8 supervisor tests
pylint --rcfile pylintrc supervisor tests
[testenv:tests]
basepython = python3