Skip to content

Commit

Permalink
Add HACS integration
Browse files Browse the repository at this point in the history
  • Loading branch information
nurikk committed Jun 21, 2020
1 parent da47d90 commit 84c3efb
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .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"
26 changes: 26 additions & 0 deletions 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
8 changes: 8 additions & 0 deletions 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": []
}
1 change: 1 addition & 0 deletions custom_components/z2m-light-admin/test.js
@@ -0,0 +1 @@
console.log('hello')
5 changes: 5 additions & 0 deletions hacs.json
@@ -0,0 +1,5 @@
{
"name": "z2m light admin",
"zip_release": true,
"filename": "release.zip"
}

0 comments on commit 84c3efb

Please sign in to comment.