diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 000000000..6f7bf6d46 --- /dev/null +++ b/.github/workflows/validate.yml @@ -0,0 +1,18 @@ +name: Validate + +on: + push: + pull_request: + schedule: + - cron: "0 0 * * *" + +jobs: + validate: + runs-on: "ubuntu-latest" + steps: + - uses: "actions/checkout@v2" + - name: HACS validation + uses: "hacs/integration/action@master" + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CATEGORY: "integration" \ No newline at end of file diff --git a/custom_components/z2m-light-admin/__init__.py b/custom_components/z2m-light-admin/__init__.py new file mode 100644 index 000000000..76291693c --- /dev/null +++ b/custom_components/z2m-light-admin/__init__.py @@ -0,0 +1,26 @@ +""" +Hello world! +""" +preffix = "z2m-light-admin" +bundle_file_name = "test.js" +async def async_setup(hass, config): + """Set up this integration using yaml.""" + url = f'/api/panel_custom/${preffix}' + location = hass.config.path(f'custom_components/${preffix}/${bundle_file_name}') + hass.http.register_static_path(url, location) + hass.components.frontend.async_register_built_in_panel( + component_name="custom", + sidebar_title="Z2M", + sidebar_icon="mdi:math-log", + frontend_url_path=preffix, + config={ + "_panel_custom": { + "name": "ui-logs", + "embed_iframe": False, + "trust_external": True, + "js_url": url, + } + }, + require_admin=True, + ) + return True \ No newline at end of file diff --git a/custom_components/z2m-light-admin/manifest.json b/custom_components/z2m-light-admin/manifest.json new file mode 100644 index 000000000..b9e54e349 --- /dev/null +++ b/custom_components/z2m-light-admin/manifest.json @@ -0,0 +1,8 @@ +{ + "domain": "integration-hacs", + "name": "z2m-light-admin", + "documentation": "https://github.com/nurikk/z2m-frontend", + "dependencies": [], + "codeowners": ["@nurikk"], + "requirements": [] + } \ No newline at end of file diff --git a/custom_components/z2m-light-admin/test.js b/custom_components/z2m-light-admin/test.js new file mode 100644 index 000000000..57d2a94ff --- /dev/null +++ b/custom_components/z2m-light-admin/test.js @@ -0,0 +1 @@ +console.log('hello') \ No newline at end of file diff --git a/hacs.json b/hacs.json new file mode 100644 index 000000000..7a4b1a8ef --- /dev/null +++ b/hacs.json @@ -0,0 +1,5 @@ +{ + "name": "z2m light admin", + "zip_release": true, + "filename": "release.zip" + } \ No newline at end of file