Compare commits
10 Commits
b135f62c18
...
23326938c9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
23326938c9 | ||
|
|
31e061a852 | ||
|
|
252fe1bcda | ||
|
|
f1b4d43380 | ||
|
|
04bc46b37e | ||
|
|
58320efbb3 | ||
|
|
8fee963c77 | ||
|
|
afc2eec6c1 | ||
|
|
51141b3f05 | ||
|
|
fbf76ea6fa |
54
.github/workflows/build.yml
vendored
Normal file
54
.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '*'
|
||||
workflow_dispatch:
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- name: 🐧 Linux
|
||||
os: ubuntu-latest
|
||||
pnpm_command: 'build:linux'
|
||||
binary_path: dist/*.AppImage
|
||||
asset_name: zeroone.AppImage
|
||||
- name: 🪟 Windows
|
||||
os: windows-latest
|
||||
pnpm_command: 'build:win'
|
||||
binary_path: dist/*.exe
|
||||
asset_name: zeroone.exe
|
||||
- name: 🍏 Mac
|
||||
os: macos-latest
|
||||
pnpm_command: 'build:mac'
|
||||
binary_path: dist/*.dmg
|
||||
asset_name: zeroone.dmg
|
||||
name: ${{ matrix.name }} Build
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: 🚚 Checkout latest code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: 🟩 Use Node.js 20.x
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20.x'
|
||||
|
||||
- name: ⚡ Setup pnpm
|
||||
uses: pnpm/action-setup@v4.0.0
|
||||
|
||||
#TODO - Remove this once https://github.com/electron-userland/electron-builder/issues/6933#issuecomment-1213438889 is resolved
|
||||
- name: 💡 Tweak pnpm.cjs
|
||||
if: ${{ contains(matrix.os, 'windows') }}
|
||||
run: sed -i 's/\/usr\/bin\/env node/node/g' /c/Users/runneradmin/setup-pnpm/node_modules/.pnpm/pnpm@9.3.0/node_modules/pnpm/bin/pnpm.cjs
|
||||
shell: bash
|
||||
|
||||
- name: 🔨 Build Project
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
pnpm i
|
||||
pnpm ${{ matrix.pnpm_command }}
|
||||
permissions:
|
||||
contents: write
|
||||
14
.github/workflows/release.yml
vendored
14
.github/workflows/release.yml
vendored
@@ -13,10 +13,10 @@ jobs:
|
||||
- name: 🐧 Linux
|
||||
os: ubuntu-latest
|
||||
pnpm_command: 'build:linux'
|
||||
binary_path: dist/*.deb
|
||||
asset_name: zeroone.deb
|
||||
binary_path: dist/*.AppImage
|
||||
asset_name: zeroone.AppImage
|
||||
- name: 🪟 Windows
|
||||
os: macos-latest
|
||||
os: windows-latest
|
||||
pnpm_command: 'build:win'
|
||||
binary_path: dist/*.exe
|
||||
asset_name: zeroone.exe
|
||||
@@ -44,7 +44,13 @@ jobs:
|
||||
node-version: '20.x'
|
||||
|
||||
- name: ⚡ Setup pnpm
|
||||
uses: pnpm/action-setup@v3.0.0
|
||||
uses: pnpm/action-setup@v4.0.0
|
||||
|
||||
#TODO - Remove this once https://github.com/electron-userland/electron-builder/issues/6933#issuecomment-1213438889 is resolved
|
||||
- name: Tweak pnpm.cjs
|
||||
if: ${{ contains(matrix.os, 'windows') }}
|
||||
run: sed -i 's/\/usr\/bin\/env node/node/g' /c/Users/runneradmin/setup-pnpm/node_modules/.pnpm/pnpm@9.3.0/node_modules/pnpm/bin/pnpm.cjs
|
||||
shell: bash
|
||||
|
||||
- name: 🔨 Build Project
|
||||
env:
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"description": "Configuration Suite for Binaris Devices",
|
||||
"main": "./out/main/index.js",
|
||||
"author": "katbinaris",
|
||||
"packageManager": "pnpm@8.14.1",
|
||||
"packageManager": "pnpm@9.3.0",
|
||||
"homepage": "https://github.com/katbinaris/zeroone",
|
||||
"build": {
|
||||
"productName": "ZERO_ONE"
|
||||
|
||||
@@ -3,8 +3,10 @@ import { PortInfo } from '@serialport/bindings-interface'
|
||||
import { EventEmitter } from 'events'
|
||||
|
||||
// JTAG interface, TODO: change me!
|
||||
const NANO_PRODUCT_ID = '8010'
|
||||
const NANO_VENDOR_ID = '239A'
|
||||
const NANO_VID_PID_PAIRS = [
|
||||
{ vid: '239A', pid: '8010' },
|
||||
{ vid: '303A', pid: '1001' }
|
||||
]
|
||||
const NANO_BAUD_RATE = 115200
|
||||
|
||||
class NanoSerialApi extends EventEmitter {
|
||||
@@ -18,9 +20,12 @@ class NanoSerialApi extends EventEmitter {
|
||||
const found_nano_devices: string[] = []
|
||||
for (const port of ports) {
|
||||
if (
|
||||
port.productId?.toUpperCase() === NANO_PRODUCT_ID &&
|
||||
port.vendorId?.toUpperCase() === NANO_VENDOR_ID &&
|
||||
port.serialNumber
|
||||
port.serialNumber &&
|
||||
NANO_VID_PID_PAIRS.some(
|
||||
(pair) =>
|
||||
pair.vid === port.vendorId?.toUpperCase() &&
|
||||
pair.pid === port.productId?.toUpperCase()
|
||||
)
|
||||
) {
|
||||
found_nano_devices.push(port.serialNumber)
|
||||
if (this.all_nano_devices[port.serialNumber] === undefined) {
|
||||
@@ -30,14 +35,6 @@ class NanoSerialApi extends EventEmitter {
|
||||
}
|
||||
}
|
||||
}
|
||||
resolve(found_nano_devices)
|
||||
for (const serialNumber in this.all_nano_devices) {
|
||||
if (found_nano_devices.indexOf(serialNumber) === -1) {
|
||||
delete this.all_nano_devices[serialNumber]
|
||||
this.emit('nanoSerialApi:device-detached', serialNumber)
|
||||
console.log('detached', serialNumber)
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
reject(error)
|
||||
@@ -120,6 +117,7 @@ class NanoSerialApi extends EventEmitter {
|
||||
})
|
||||
port.open((err) => {
|
||||
if (err) {
|
||||
console.log('Error opening port: ', err)
|
||||
reject(err)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
<p>Idle Timeout: </p>
|
||||
<p>
|
||||
{{
|
||||
deviceStore.settings?.idleTimeout
|
||||
deviceStore.settings?.idleTimeout !== 999999999
|
||||
? `${Math.round(deviceStore.settings.idleTimeout / 1000)}s`
|
||||
: 'Off'
|
||||
}}
|
||||
|
||||
@@ -401,14 +401,14 @@ export const useDeviceStore = defineStore('device', {
|
||||
}
|
||||
},
|
||||
cycleIdleTimeout() {
|
||||
if (this.settings!.idleTimeout === 0) {
|
||||
if (this.settings!.idleTimeout === 999999999) {
|
||||
this.setIdleTimeout(10000)
|
||||
} else if (this.settings!.idleTimeout === 10000) {
|
||||
this.setIdleTimeout(30000)
|
||||
} else if (this.settings!.idleTimeout === 30000) {
|
||||
this.setIdleTimeout(60000)
|
||||
} else {
|
||||
this.setIdleTimeout(0)
|
||||
this.setIdleTimeout(999999999)
|
||||
}
|
||||
},
|
||||
setPosition(position: number) {
|
||||
@@ -649,7 +649,10 @@ export const useDeviceStore = defineStore('device', {
|
||||
JSON.stringify({
|
||||
profile: this.currentProfileName,
|
||||
updates: {
|
||||
knob: this.currentProfile!.knob
|
||||
knob: this.currentProfile!.knob.map((v) => ({
|
||||
haptic: { outputRamp: v.haptic.outputRamp },
|
||||
type: v.type
|
||||
}))
|
||||
}
|
||||
})
|
||||
)
|
||||
@@ -666,7 +669,10 @@ export const useDeviceStore = defineStore('device', {
|
||||
JSON.stringify({
|
||||
profile: this.currentProfileName,
|
||||
updates: {
|
||||
knob: this.currentProfile!.knob
|
||||
knob: this.currentProfile!.knob.map((v) => ({
|
||||
haptic: { detentStrength: v.haptic.detentStrength },
|
||||
type: v.type
|
||||
}))
|
||||
}
|
||||
})
|
||||
)
|
||||
@@ -749,7 +755,7 @@ export const initializeDevices = () => {
|
||||
setTimeout(function timer() {
|
||||
console.log('Requesting profile', profileName)
|
||||
nanoIpc.send(deviceid, JSON.stringify({ profile: profileName }))
|
||||
}, i * 15)
|
||||
}, i * 30)
|
||||
})
|
||||
}
|
||||
if (update.current !== undefined) {
|
||||
|
||||
Reference in New Issue
Block a user