Compare commits
66 Commits
3f2af28a9a
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| c2ac1228e8 | |||
| acf04a32fb | |||
| bab2f64cac | |||
| 10cafdc209 | |||
| c272fa403f | |||
| 120303c51b | |||
| 70bc20e621 | |||
| 5af72cd59b | |||
| 94e1650fd8 | |||
| 8501fffd8a | |||
| 78640e8833 | |||
| 3ae0f38f40 | |||
| 4547f86403 | |||
| 9f363b7633 | |||
| 5bc68ca194 | |||
| 5ed9cae197 | |||
| 721e8fdd66 | |||
| 44a40527b1 | |||
| 9707f4df15 | |||
| ef82ee7317 | |||
| f7f25c598d | |||
| 22a6efc95b | |||
| d3f10482bb | |||
| 8637558f45 | |||
| 9f6ca33133 | |||
| 23b8247ca5 | |||
| 9c95b907bf | |||
| b62443f94f | |||
| ab98eeca27 | |||
| 99f068ab74 | |||
| 0587741a35 | |||
| a191109daf | |||
| fb3c12fe01 | |||
| 211d6e4dbd | |||
| c6e7246c95 | |||
| d222538aa4 | |||
| 6d88307ae1 | |||
| 6ef49e7a50 | |||
| 8431cc4221 | |||
| 867f41a2f5 | |||
| ba273f8cd6 | |||
| 3c454c5d35 | |||
| 3f5df73cfc | |||
| 8ed00c76d3 | |||
| 007e37e3ed | |||
| 5f08c54034 | |||
| eae79a03e9 | |||
| 48fbf44507 | |||
| 8062302325 | |||
| 417cbb64bc | |||
| 4ab8667bd8 | |||
| b72555ea74 | |||
|
|
1257457605 | ||
|
|
7b6a6a0b98 | ||
|
|
23736512a8 | ||
|
|
e33a88106c | ||
|
|
e4a47f3b76 | ||
|
|
8b37ba450e | ||
|
|
00b7060912 | ||
|
|
f14a5b0db0 | ||
|
|
9d0e2ab46e | ||
|
|
ded945e7b9 | ||
|
|
6d1cd08949 | ||
|
|
2f23271bf1 | ||
|
|
794f8ce0d5 | ||
|
|
31f3ecddd1 |
@@ -1,27 +1,11 @@
|
|||||||
name: Local Assistant
|
name: Wagner Home Assistant
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
schema: v1
|
schema: v1
|
||||||
models:
|
models:
|
||||||
- name: qwen2.5
|
- name: Autodetect
|
||||||
provider: ollama
|
provider: ollama
|
||||||
model: qwen2.5:14b
|
model: AUTODETECT
|
||||||
apiBase: http://192.168.0.53
|
apiBase: http://192.168.0.53
|
||||||
roles:
|
|
||||||
- chat
|
|
||||||
- edit
|
|
||||||
- apply
|
|
||||||
- agent
|
|
||||||
- name: qwen3
|
|
||||||
provider: ollama
|
|
||||||
model: qwen3:14b
|
|
||||||
apiBase: http://192.168.0.53
|
|
||||||
roles:
|
|
||||||
- chat
|
|
||||||
- edit
|
|
||||||
- apply
|
|
||||||
- agent
|
|
||||||
|
|
||||||
|
|
||||||
context:
|
context:
|
||||||
- provider: code
|
- provider: code
|
||||||
- provider: docs
|
- provider: docs
|
||||||
|
|||||||
@@ -3,10 +3,11 @@
|
|||||||
# [Choice] Go version (use -bullseye variants on local arm64/Apple Silicon): 1, 1.18, 1.17, 1-bullseye, 1.18-bullseye, 1.17-bullseye, 1-buster, 1.18-buster, 1.17-buster
|
# [Choice] Go version (use -bullseye variants on local arm64/Apple Silicon): 1, 1.18, 1.17, 1-bullseye, 1.18-bullseye, 1.17-bullseye, 1-buster, 1.18-buster, 1.17-buster
|
||||||
ARG VARIANT="1.18-bullseye"
|
ARG VARIANT="1.18-bullseye"
|
||||||
FROM mcr.microsoft.com/vscode/devcontainers/go:${VARIANT}
|
FROM mcr.microsoft.com/vscode/devcontainers/go:${VARIANT}
|
||||||
|
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo gpg --dearmor -o /usr/share/keyrings/yarn-keyring.gpg
|
||||||
|
RUN echo "deb [signed-by=/usr/share/keyrings/yarn-keyring.gpg] https://dl.yarnpkg.com/debian stable main" | sudo tee /etc/apt/sources.list.d/yarn.list > /dev/null
|
||||||
# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
|
# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
|
||||||
ARG NODE_VERSION="none"
|
ARG NODE_VERSION="none"
|
||||||
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
|
#RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
|
||||||
|
|
||||||
# [Optional] Uncomment this section to install additional OS packages.
|
# [Optional] Uncomment this section to install additional OS packages.
|
||||||
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
||||||
|
|||||||
@@ -28,8 +28,7 @@
|
|||||||
|
|
||||||
// Add the IDs of extensions you want installed when the container is created.
|
// Add the IDs of extensions you want installed when the container is created.
|
||||||
"extensions": [
|
"extensions": [
|
||||||
"golang.Go",
|
"golang.Go"
|
||||||
"Continue.continue"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -43,9 +42,7 @@
|
|||||||
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
|
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
|
||||||
"remoteUser": "vscode",
|
"remoteUser": "vscode",
|
||||||
"features": {
|
"features": {
|
||||||
"docker-in-docker": "latest",
|
// "docker-in-docker": "latest",
|
||||||
"kubectl-helm-minikube": "latest",
|
|
||||||
"git": "latest",
|
|
||||||
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
|
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,37 +0,0 @@
|
|||||||
name: build only rgb-board
|
|
||||||
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- "animate-separate"
|
|
||||||
paths-ignore:
|
|
||||||
- ".gitea/workflows/**"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
container:
|
|
||||||
image: registry.local/catthehacker-home:act-latest
|
|
||||||
volumes:
|
|
||||||
- /var/run/user/1000/docker.sock:/var/run/docker.sock
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- name: short-sha
|
|
||||||
id: short-sha
|
|
||||||
run: echo "short-sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v2
|
|
||||||
with:
|
|
||||||
driver-opts: |
|
|
||||||
image=registry.local/buildkit-wagnerca:stable-3-rootless
|
|
||||||
seccomp=unconfined
|
|
||||||
apparmor=unconfined
|
|
||||||
systempaths=unconfined
|
|
||||||
privileged=false
|
|
||||||
- run: docker buildx ls
|
|
||||||
- name: push rgbboard
|
|
||||||
uses: docker/build-push-action@master
|
|
||||||
with:
|
|
||||||
push: false
|
|
||||||
tags: registry.local/rgbboard:${{ steps.short-sha.outputs.short-sha }}
|
|
||||||
platforms: linux/arm64,linux/amd64
|
|
||||||
@@ -6,7 +6,7 @@ on:
|
|||||||
- main
|
- main
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- ".gitea/workflows/**"
|
- ".gitea/workflows/**"
|
||||||
|
workflow_dispatch:
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -29,9 +29,35 @@ jobs:
|
|||||||
systempaths=unconfined
|
systempaths=unconfined
|
||||||
privileged=false
|
privileged=false
|
||||||
- run: docker buildx ls
|
- run: docker buildx ls
|
||||||
- name: push rgbboard
|
- name: build push rgbboard
|
||||||
uses: docker/build-push-action@master
|
uses: docker/build-push-action@master
|
||||||
|
#id: build_push_rgbboard
|
||||||
with:
|
with:
|
||||||
push: true
|
push: true
|
||||||
tags: registry.local/rgbboard:${{ steps.short-sha.outputs.short-sha }}
|
tags: registry.local/rgbboard:${{ steps.short-sha.outputs.short-sha }}
|
||||||
platforms: linux/arm64
|
platforms: linux/arm64
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: wagshome/rgbboard
|
||||||
|
token: ${{ secrets.runner_deploy }}
|
||||||
|
path: rgbboard
|
||||||
|
- name: Set up Git
|
||||||
|
run: |
|
||||||
|
git config --global user.name "Gitea Actions"
|
||||||
|
git config --global user.email "actions@nope.com"
|
||||||
|
- name: Install yq
|
||||||
|
uses: https://github.com/chrisdickinson/setup-yq@v1.0.0
|
||||||
|
with:
|
||||||
|
yq-version: v4.45.4
|
||||||
|
- name: Update values.yaml
|
||||||
|
run: |
|
||||||
|
yq -i '.image.tag = env(SHORT_SHA)' rgbboard/rgbboard/values.yaml
|
||||||
|
env:
|
||||||
|
SHORT_SHA: ${{ steps.short-sha.outputs.short-sha }}
|
||||||
|
- name: Commit and Push changes
|
||||||
|
run: |
|
||||||
|
cd rgbboard
|
||||||
|
git add .
|
||||||
|
git commit -m "Update image to ${{ steps.short_sha.outputs.short_sha }}"
|
||||||
|
git push
|
||||||
@@ -11,4 +11,3 @@ FROM scratch
|
|||||||
COPY --from=builder /usr/src/app/rgb/rgb /usr/src/app/work/
|
COPY --from=builder /usr/src/app/rgb/rgb /usr/src/app/work/
|
||||||
COPY --from=builder /usr/src/app/rgb/mari* /usr/src/app/work/
|
COPY --from=builder /usr/src/app/rgb/mari* /usr/src/app/work/
|
||||||
WORKDIR /usr/src/app/work
|
WORKDIR /usr/src/app/work
|
||||||
|
|
||||||
|
|||||||
@@ -56,38 +56,96 @@ func (a *Animation) animateMario() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// what mario does every frame
|
|
||||||
func (a *Animation) updateMarioPosition() {
|
func (a *Animation) updateMarioPosition() {
|
||||||
// Ellipse parameters (centered on canvas)
|
|
||||||
centerX := a.ctx.Width() / 2
|
centerX := a.ctx.Width() / 2
|
||||||
centerY := a.ctx.Height() / 2
|
centerY := a.ctx.Height() / 2
|
||||||
|
|
||||||
// Calculate new position using parametric ellipse equations
|
// Determine sprite size (use current updown image if available)
|
||||||
|
var sprite image.Image
|
||||||
|
if img, ok := a.mario.images[a.mario.updown]; ok && img != nil {
|
||||||
|
sprite = img
|
||||||
|
} else {
|
||||||
|
for _, im := range a.mario.images {
|
||||||
|
sprite = im
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// default half sizes if sprite missing
|
||||||
|
halfW, halfH := 8, 8
|
||||||
|
if sprite != nil {
|
||||||
|
halfW = sprite.Bounds().Dx() / 2
|
||||||
|
halfH = sprite.Bounds().Dy() / 2
|
||||||
|
}
|
||||||
|
|
||||||
|
// allowable center range so the sprite stays fully on the panel
|
||||||
|
minCenterX := halfW
|
||||||
|
maxCenterX := a.ctx.Width() - 1 - halfW
|
||||||
|
minCenterY := halfH
|
||||||
|
maxCenterY := a.ctx.Height() - 1 - halfH
|
||||||
|
|
||||||
|
// If the sprite is larger than the panel in a dimension, collapse
|
||||||
|
// the allowed center range to the panel center so we don't get
|
||||||
|
// immediate collisions every frame which makes Mario flash.
|
||||||
|
if maxCenterX < minCenterX {
|
||||||
|
minCenterX = centerX
|
||||||
|
maxCenterX = centerX
|
||||||
|
}
|
||||||
|
if maxCenterY < minCenterY {
|
||||||
|
minCenterY = centerY
|
||||||
|
maxCenterY = centerY
|
||||||
|
}
|
||||||
|
|
||||||
|
// advance angle for this frame
|
||||||
|
delta := 0.05
|
||||||
t := a.mario.angle
|
t := a.mario.angle
|
||||||
marioX := centerX + a.mario.a*math.Cos(t)
|
tNext := t + delta
|
||||||
marioY := centerY + a.mario.b*math.Sin(t)
|
if tNext >= 2*math.Pi {
|
||||||
|
tNext -= 2 * math.Pi
|
||||||
// Update angle to move along the ellipse
|
|
||||||
a.mario.angle += 0.1 // Adjust speed as needed
|
|
||||||
if a.mario.angle >= 2*math.Pi {
|
|
||||||
a.mario.angle -= 2 * math.Pi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Determine horizontal direction (left/right) for image flipping
|
// compute next candidate center from the next parametric position
|
||||||
if math.Sin(t) > 0 {
|
marioX := int(math.Round(a.mario.a*math.Cos(tNext))) + centerX
|
||||||
a.mario.dir.X = -1 // Moving left
|
marioY := int(math.Round(a.mario.b*math.Sin(tNext))) + centerY
|
||||||
} else {
|
|
||||||
a.mario.dir.X = 1 // Moving right
|
// clamp into allowed center ranges so sprite stays fully on panel
|
||||||
|
if marioX < minCenterX {
|
||||||
|
marioX = minCenterX
|
||||||
|
}
|
||||||
|
if marioX > maxCenterX {
|
||||||
|
marioX = maxCenterX
|
||||||
|
}
|
||||||
|
if marioY < minCenterY {
|
||||||
|
marioY = minCenterY
|
||||||
|
}
|
||||||
|
if marioY > maxCenterY {
|
||||||
|
marioY = maxCenterY
|
||||||
}
|
}
|
||||||
|
|
||||||
// Determine vertical direction (up/down) for image selection
|
// commit position and advance angle
|
||||||
if math.Cos(t) > 0 {
|
|
||||||
a.mario.updown = "marioUp" // Moving downward
|
|
||||||
} else {
|
|
||||||
a.mario.updown = "marioDown" // Moving upward
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update Mario's position
|
|
||||||
a.mario.position.X = marioX
|
a.mario.position.X = marioX
|
||||||
a.mario.position.Y = marioY
|
a.mario.position.Y = marioY
|
||||||
|
a.mario.angle = tNext
|
||||||
|
|
||||||
|
// Direction logic (based on the motion between t and tNext)
|
||||||
|
// approximate direction by comparing positions (preferable to trig sign when clamped)
|
||||||
|
prevX := int(math.Round(a.mario.a*math.Cos(t))) + centerX
|
||||||
|
if prevX == marioX {
|
||||||
|
// if we didn't move horizontally, keep previous direction
|
||||||
|
// (this prevents flicker when clamped)
|
||||||
|
} else if marioX < prevX {
|
||||||
|
a.mario.dir.X = -1
|
||||||
|
} else {
|
||||||
|
a.mario.dir.X = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
// up/down based on vertical movement
|
||||||
|
prevY := int(math.Round(a.mario.b*math.Sin(t))) + centerY
|
||||||
|
if prevY == marioY {
|
||||||
|
// keep previous up/down state
|
||||||
|
} else if marioY < prevY {
|
||||||
|
a.mario.updown = "marioUp"
|
||||||
|
} else {
|
||||||
|
a.mario.updown = "marioDown"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user