Skip to content

Commit

Permalink
Merge pull request #4 from LocalBytes/feature/lb-184-publication
Browse files Browse the repository at this point in the history
Feature/lb 184 publication
  • Loading branch information
AAllport authored Apr 29, 2024
2 parents cc86ca9 + 244d506 commit ae7318a
Show file tree
Hide file tree
Showing 7 changed files with 1,128 additions and 1,621 deletions.
116 changes: 116 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
on:
push:
branches:
- main

name: "Build and Publish"

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 8
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: "${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}"
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install -r

- name: Get version
id: version
run: echo version=$(node -p -e "require('./packages/localdeck-configurator/package.json').version") >> $GITHUB_ENV

- name: Build
run: |
sed -i "s/VERSION/${{ env.version }}/g" ./packages/localdeck-configurator/homeassistant/config.yaml
pnpm --filter=localdeck-configurator build
mkdir -p .temp
cp -r ./packages/localdeck-configurator/{.output,homeassistant}/* ./.temp
- uses: actions/upload-artifact@v4
with:
name: localdeck-configurator
path: .temp

- uses: actions/upload-artifact@v4
with:
name: localdeck-configurator-hass
path: ./packages/localdeck-configurator/homeassistant

publish:
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- name: GHCR User
run: echo "ghcr_user=${GITHUB_REPOSITORY_OWNER@L}" >> "${GITHUB_ENV}"

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ env.ghcr_user }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/download-artifact@v4
with:
name: localdeck-configurator
path: localdeck-configurator

- name: Publish
uses: home-assistant/builder@master
with:
args: |
--all \
--target localdeck-configurator \
--docker-hub "ghcr.io/${{ env.ghcr_user }}"
publish-subtree:
needs: [ build, publish ]
runs-on: ubuntu-latest
steps:

- uses: actions/download-artifact@v4
with:
name: localdeck-configurator-hass
path: localdeck-configurator

- name: Pushes to another repository
uses: cpina/github-action-push-to-another-repository@main
env:
SSH_DEPLOY_KEY: ${{ secrets.SSH_LOCALBYTES_HELLO }}
with:
source-directory: 'localdeck-configurator'
target-directory: 'localdeck-configurator'

destination-github-username: '${{ github.repository_owner }}'
destination-repository-name: 'hass-addons'

user-name: "LocalBytes Bot"
user-email: "[email protected]"
target-branch: main
4 changes: 2 additions & 2 deletions packages/localdeck-codegen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"dependencies": {
"esphome-config-ts": "github:LocalBytes/esphome-config-ts",
"js-yaml": "^4.1.0",
"tsx": "^4.7.1"
"tsx": "^4.7.3"
},
"devDependencies": {
"@tsconfig/recommended": "^1.0.3",
"@tsconfig/recommended": "^1.0.6",
"@types/js-yaml": "^4.0.9"
}
}
16 changes: 10 additions & 6 deletions packages/localdeck-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,21 @@
},
"devDependencies": {
"@nuxt/eslint-config": "^0.1.1",
"@nuxt/test-utils": "^3.12.0",
"@nuxt/test-utils": "^3.12.1",
"@types/pako": "^2.0.3",
"@vue/test-utils": "^2.4.5",
"eslint": "^8.57.0",
"nuxt": "^3.11.1",
"maska": "^2.1.11",
"nuxt": "^3.11.2",
"pako": "^2.1.0",
"sass": "^1.75.0",
"typescript": "^5.4.3",
"vitest": "^1.4.0"
"typescript": "^5.4.5",
"vitest": "^1.5.2",
"vue3-emoji-picker": "^1.1.8"
},
"dependencies": {
"@localbytes/localdeck-codegen": "workspace:^",
"material-symbols": "^0.17.2",
"@material-symbols/metadata": "^0.17.2"
"@material-symbols/metadata": "^0.17.3",
"material-symbols": "^0.17.3"
}
}
53 changes: 18 additions & 35 deletions packages/localdeck-configurator/homeassistant/README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,26 @@
## LocalDeck configurator for Home Assistant
# LocalDeck configurator for Home Assistant

To install, extract the contents of this folder to your Home Assistant `addons` folder.
In your Home Assistant dashboard, go to Supervisor -> Add-on Store,
and click the refresh button in the top right corner.
The configurator should now appear in the list of available add-ons.
Welcome to the LocalDeck configurator for Home Assistant.
This add-on allows you to configure your LocalDeck devices from within Home Assistant.

## Making your existing config compatible
The LocalDeck is a 24-key programmable keypad that can be used to control your Home Assistant instance.
You can find our more [LocalBytes / LocalDeck Bundle](https://mylocalbytes.com/products/localdeck-bundle)

There are a few minor changes you need to make to your existing config to make it compatible with the configurator.
The online configurator has not been updated to reflect these.
## Installation

Without these changes, your config will be read correctly,
but saving will override your config with the default config header.
1. Add the repository to your Home Assistant instance.
2. Install & Start the "LocalDeck configurator" add-on.
3. Open the "LocalDeck configurator" web UI.
4. Configure your LocalDeck!

From:
## Support

```yaml
# This file was generated by the LocalBytes LocalDeck Configurator
# https://feature-lb-32-firmware-confi.localbytes-blog.pages.dev/tools/localdeck-configurator?config=[...]
For any questions regarding the LocalDeck or what it can do, please head over to
the [LocalBytes Forum / LocalDeck](https://forum.mylocalbytes.com/t/localdeck)
As a customer, you do have access to our email support, however,
we always suggest going via the Forum first, as others may have similar questions

wifi:
ap:
ssid: LocalBytes LocalDeck
```
## Contributing

To:
```yaml
# This file was generated by the LocalBytes LocalDeck Configurator
wifi:
ap:
ssid: LocalBytes LocalDeck

[ ... ]

# Anything below this line will be removed when saving.
# To change this, navigate to the LocalBytes LocalDeck Configurator.
# Your changes will be lost!
# Edit: https://feature-lb-32-firmware-confi.localbytes-blog.pages.dev/tools/localdeck-configurator?config=[...]

light:
```
If you have any suggestions or improvements, please feel free to open a pull
request - [GitHub / LocalBytes / LocalDeck Config](https://github.com/LocalBytes/localdeck-config)!
5 changes: 4 additions & 1 deletion packages/localdeck-configurator/homeassistant/config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
name: "LocalDeck Configurator"
description: "Configure your LocalBytes LocalDeck with ease!"
version: "0.1.0"
slug: "localdeck-configurator"

version: VERSION
image: ghcr.io/localbytes/hass-localdeck-configurator-{arch}

init: false

panel_icon: "mdi:dialpad"
Expand Down
33 changes: 15 additions & 18 deletions packages/localdeck-configurator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,33 @@
"postinstall": "nuxt prepare"
},
"devDependencies": {
"@nuxt/devtools": "^1.1.3",
"@nuxt/test-utils": "^3.12.0",
"@tailwindcss/typography": "^0.5.10",
"@nuxt/devtools": "^1.2.0",
"@nuxt/test-utils": "^3.12.1",
"@tailwindcss/typography": "^0.5.13",
"@types/lodash": "^4.17.0",
"@types/pako": "^2.0.3",
"@vitest/ui": "^1.4.0",
"@vitest/ui": "^1.5.2",
"@vue/test-utils": "^2.4.5",
"autoprefixer": "^10.4.19",
"happy-dom": "^13.10.1",
"pako": "^2.1.0",
"playwright-core": "^1.42.1",
"playwright-core": "^1.43.1",
"postcss": "^8.4.38",
"rollup-plugin-typescript2": "^0.36.0",
"typescript": "^5.4.3",
"vitest": "^1.4.0",
"vue3-emoji-picker": "^1.1.8"
"typescript": "^5.4.5",
"vitest": "^1.5.2"
},
"dependencies": {
"@fontsource-variable/open-sans": "^5.0.28",
"@fontsource/poppins": "^5.0.12",
"@fontsource-variable/open-sans": "^5.0.29",
"@fontsource/poppins": "^5.0.14",
"@localbytes/localdeck-codegen": "workspace:^",
"@localbytes/localdeck-components": "workspace:^",
"@nuxtjs/color-mode": "^3.3.3",
"@nuxtjs/tailwindcss": "^6.11.4",
"@nuxtjs/color-mode": "^3.4.1",
"@nuxtjs/tailwindcss": "^6.12.0",
"lodash": "^4.17.21",
"maska": "^2.1.11",
"nuxt": "^3.11.1",
"nuxt": "^3.11.2",
"rippleui": "^1.12.1",
"tailwindcss": "^3.4.1",
"vue": "^3.4.21",
"vue-router": "^4.3.0"
"tailwindcss": "^3.4.3",
"vue": "^3.4.26",
"vue-router": "^4.3.2"
}
}
Loading

0 comments on commit ae7318a

Please sign in to comment.