Skip to content

Commit

Permalink
bump version to 2.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kirainmoe committed Jun 28, 2020
1 parent 1da1375 commit b955592
Show file tree
Hide file tree
Showing 31 changed files with 105 additions and 159 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,4 @@ uncommit

.DS_Store
release
.idea
2 changes: 0 additions & 2 deletions .idea/.gitignore

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/inspectionProfiles/Project_Default.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/misc.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/project-starbeat.iml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

2 changes: 1 addition & 1 deletion starbeat-client/build/asset-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"static/js/2.chunk.js": "./static/js/2.chunk.js",
"static/js/2.chunk.js.map": "./static/js/2.chunk.js.map",
"index.html": "./index.html",
"precache-manifest.80a6cfb6ce523b8f6529b16a44d64e47.js": "./precache-manifest.80a6cfb6ce523b8f6529b16a44d64e47.js",
"precache-manifest.0cdf736ee87c3857b2c3d55961299085.js": "./precache-manifest.0cdf736ee87c3857b2c3d55961299085.js",
"service-worker.js": "./service-worker.js",
"static/css/2.chunk.css.map": "./static/css/2.chunk.css.map",
"static/css/main.chunk.css.map": "./static/css/main.chunk.css.map",
Expand Down
9 changes: 0 additions & 9 deletions starbeat-client/build/electron/electronCompat.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,6 @@ const electronCompatLayer = () => {
};

doFetch(1);

const retryDaemon = setInterval(() => {
if (done)
clearInterval(retryDaemon);
retry++;
if (retry >= 10)
window.location.reload();
}, 1000);

};

const getUserDir = () => {
Expand Down
39 changes: 28 additions & 11 deletions starbeat-client/build/electron/hidutils.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
const initColorUtils = () => {
const hid = require('node-hid');
const isWin = () => process.platform === "win32";
const isMac = () => process.platform === "darwin";

let revision = 2;

Array.prototype.zeroFill = function (len) {
const isWin = () => process.platform === "win32";
if (isWin()) {
for (let i = this.length - 1; i >= 0; i--)
this[i+1] = this[i];
Expand Down Expand Up @@ -35,20 +38,34 @@ const initColorUtils = () => {
console.error(e);
device = null;
}

if (device == null) {
console.error("No compatible device found!");
return false;
}

try {
if (isMac()) {
const cp = require("child_process");
const stdout = cp.execSync("ioreg -c IOUSBDevice | grep -A 10 ITE | grep bcdDevice").toString();
if (stdout.indexOf("\"bcdDevice\" = 3") >= 0)
revision = 3;
}
} catch (e) {}

console.log(`[Info] ITE revision is 0.0${revision}`);

const sendGenericPacket = () => {
for (let i = 1; i <= 7; i++)
device.sendFeatureReport([ 0x14, 0x00, i, ...generic[i-1], 0x00, 0x00 ].zeroFill(16));
};


const getITErevision = () => {
return revision;
};

const monoColor = (red, green, blue, save, block, brightness) => {
const packet = [0x14, 0x00, 0x01, red, green, blue, 0x00, 0x00],
endPacket = [0x08, 0x02, 0x01, 0x05, brightness, 0x08, 0x00, save ? 0x00 : 0x01];
endPacket = [0x08, 0x02, 0x01, 0x05, brightness, 0x08, 0x00, save ? 0x01 : 0x00];

if (block) { // set specific block
packet[2] = block;
Expand All @@ -65,33 +82,32 @@ const initColorUtils = () => {
};

const breathing = (save, speed, brightness) => {
const endPacket = [0x08, 0x02, 0x02, speed, brightness, 0x08, 0x00, save ? 0x00 : 0x01];
const endPacket = [0x08, 0x02, 0x02, speed, brightness, 0x08, 0x00, save ? 0x01 : 0x00];
sendGenericPacket();
device.sendFeatureReport(endPacket.zeroFill(16));
};

const wave = (save, speed, brightness, direction) => {
const endPacket = [0x08, 0x02, 0x03, speed, brightness, 0x08, direction, save ? 0x00 : 0x01];
const endPacket = [0x08, 0x02, 0x03, speed, brightness, 0x08, direction, save ? 0x01 : 0x00];
sendGenericPacket();
device.sendFeatureReport(endPacket.zeroFill(16));
};

const rainbow = (save, brightness) => {
for (let i = 1; i <= 4; i++)
device.sendFeatureReport([0x14, 0x00, i, ...rainbowColor[i-1], 0x00, 0x00].zeroFill(9));
const endPacket = [0x08, 0x02, 0x05, 0x05, brightness, 0x08, 0x00, save ? 0x00 : 0x01];
console.log(endPacket);
const endPacket = [0x08, 0x02, 0x05, 0x05, brightness, 0x08, 0x00, save ? 0x01 : 0x00];
device.sendFeatureReport(endPacket.zeroFill(9));
};

const flash = (save, speed, brightness, direction) => {
const endPacket = [0x08, 0x02, 0x12, speed, brightness, 0x08, direction, save ? 0x00 : 0x01];
const endPacket = [0x08, 0x02, 0x12, speed, brightness, 0x08, direction, save ? 0x01 : 0x00];
sendGenericPacket();
device.sendFeatureReport(endPacket.zeroFill(16));
};

const mix = (save, speed, brightness) => {
const endPacket = [0x08, 0x02, 0x13, speed, brightness, 0x08, 0x00, save ? 0x00 : 0x01];
const endPacket = [0x08, 0x02, 0x13, speed, brightness, 0x08, 0x00, save ? 0x01 : 0x00];
sendGenericPacket();
device.sendFeatureReport(endPacket.zeroFill(16));
};
Expand All @@ -109,7 +125,8 @@ const initColorUtils = () => {
flash,
mix,
device,
disabler
disabler,
getITErevision
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([
"url": "./index.html"
},
{
"revision": "3b557c342be73394029e",
"revision": "dc3a3ba41bc1eccce49c",
"url": "./static/css/2.chunk.css"
},
{
"revision": "108a5260dd1e0ef2817d",
"revision": "6b3cc1032c7100a33ea4",
"url": "./static/css/main.chunk.css"
},
{
"revision": "3b557c342be73394029e",
"revision": "dc3a3ba41bc1eccce49c",
"url": "./static/js/2.chunk.js"
},
{
"revision": "a366888eb77243c004483cd2ac7ea0cc",
"url": "./static/js/2.chunk.js.LICENSE.txt"
},
{
"revision": "108a5260dd1e0ef2817d",
"revision": "6b3cc1032c7100a33ea4",
"url": "./static/js/main.chunk.js"
},
{
Expand Down
2 changes: 1 addition & 1 deletion starbeat-client/build/service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");

importScripts(
"./precache-manifest.80a6cfb6ce523b8f6529b16a44d64e47.js"
"./precache-manifest.0cdf736ee87c3857b2c3d55961299085.js"
);

self.addEventListener('message', (event) => {
Expand Down

0 comments on commit b955592

Please sign in to comment.