updating deps, make consistent the lights icon path between filled/outline, beatDelay

This commit is contained in:
Egor 2017-04-22 17:59:27 -07:00
parent 56edc43737
commit 152f4e1b3a
30 changed files with 147 additions and 52 deletions

View file

@ -6,5 +6,6 @@
Setting `disableAnalytics` to true will prevent any data from being sent. Setting `disableAnalytics` to true will prevent any data from being sent.
*/ */
"disableAnalytics": true, "disableAnalytics": true,
"usePods": true "usePods": true,
"port": 8080
} }

View file

@ -133,6 +133,9 @@ export default Component.extend({
chrome.storage.local.clear(); chrome.storage.local.clear();
location.reload(); location.reload();
chrome.runtime.sendMessage({ action: 'stop-listening' }); chrome.runtime.sendMessage({ action: 'stop-listening' });
},
email() {
chrome.tabs.create({ url: 'mailto:contact@nidratech.com' });
} }
} }
}); });

View file

@ -26,6 +26,10 @@
{{#content.menu-item onClick="clearAllSettings" }} {{#content.menu-item onClick="clearAllSettings" }}
{{paper-icon "settings backup restore" class=dimmerOnClass}} Reset settings {{paper-icon "settings backup restore" class=dimmerOnClass}} Reset settings
{{/content.menu-item}} {{/content.menu-item}}
{{#content.menu-item onClick="email" }}
{{paper-icon "email" class=dimmerOnClass}} Contact
{{/content.menu-item}}
{{/menu.content}} {{/menu.content}}
{{/paper-menu}} {{/paper-menu}}
</div> </div>

View file

@ -106,7 +106,7 @@ export default Component.extend({
case 'HML003': case 'HML003':
case 'HML004': case 'HML004':
case 'HML005': case 'HML005':
src = 'phoenix_ceiling_pendant_table_wall'; src = 'phoenix_ceiling';
break; break;
case 'HML006': case 'HML006':
src = 'phoenix_down'; src = 'phoenix_down';

View file

@ -19,10 +19,10 @@
"broccoli-asset-rev": "^2.2.0", "broccoli-asset-rev": "^2.2.0",
"ember-cli": "^2.8.0", "ember-cli": "^2.8.0",
"ember-cli-app-version": "^3.0.0", "ember-cli-app-version": "^3.0.0",
"ember-cli-babel": "^5.1.5", "ember-cli-babel": "^6.0.0",
"ember-cli-dependency-checker": "^1.2.0", "ember-cli-dependency-checker": "^1.2.0",
"ember-cli-htmlbars": "^1.0.1", "ember-cli-htmlbars": "^1.0.1",
"ember-cli-htmlbars-inline-precompile": "^0.3.1", "ember-cli-htmlbars-inline-precompile": "^0.4.0",
"ember-cli-inject-live-reload": "^1.3.1", "ember-cli-inject-live-reload": "^1.3.1",
"ember-cli-nouislider": "^0.13.0", "ember-cli-nouislider": "^0.13.0",
"ember-cli-release": "^1.0.0-beta.2", "ember-cli-release": "^1.0.0-beta.2",
@ -33,7 +33,7 @@
"ember-export-application-global": "^2.0.0", "ember-export-application-global": "^2.0.0",
"ember-inline-svg": "^0.1.7", "ember-inline-svg": "^0.1.7",
"ember-load-initializers": "^1.0.0", "ember-load-initializers": "^1.0.0",
"ember-modal-dialog": "^0.9.0", "ember-modal-dialog": "^1.0.0",
"ember-notify": "^5.0.4", "ember-notify": "^5.0.4",
"ember-paper": "^1.0.0-alpha.19", "ember-paper": "^1.0.0-alpha.19",
"ember-resolver": "^4.0.0", "ember-resolver": "^4.0.0",

View file

Before

Width:  |  Height:  |  Size: 989 B

After

Width:  |  Height:  |  Size: 989 B

View file

Before

Width:  |  Height:  |  Size: 801 B

After

Width:  |  Height:  |  Size: 801 B

View file

@ -9,6 +9,7 @@ let isNone = function (obj) {
// the main ember app controls may change these // the main ember app controls may change these
let state = { let state = {
activeLights: [], activeLights: [],
beatDelay: 0,
threshold: 0.2, threshold: 0.2,
hueRange: [0, 65535], hueRange: [0, 65535],
brightnessRange: [1, 254], brightnessRange: [1, 254],
@ -25,13 +26,13 @@ let dancer = new window.Dancer(),
kick; kick;
// initialze the state // initialze the state
chrome.storage.local.get('activeLights', ({activeLights}) => { chrome.storage.local.get('activeLights', ({ activeLights }) => {
if (!isNone(activeLights)) { if (!isNone(activeLights)) {
state.activeLights = activeLights; state.activeLights = activeLights;
} }
}); });
chrome.storage.local.get('threshold', ({threshold}) => { chrome.storage.local.get('threshold', ({ threshold }) => {
if (!isNone(threshold)) { if (!isNone(threshold)) {
state.threshold = threshold; state.threshold = threshold;
} }
@ -48,38 +49,44 @@ chrome.storage.local.get('threshold', ({threshold}) => {
kick.on(); kick.on();
}); });
chrome.storage.local.get('hueRange', ({hueRange}) => { chrome.storage.local.get('beatDelay', ({ beatDelay }) => {
if (!isNone(beatDelay)) {
state.beatDelay = beatDelay;
}
});
chrome.storage.local.get('hueRange', ({ hueRange }) => {
if (!isNone(hueRange)) { if (!isNone(hueRange)) {
state.hueRange = hueRange; state.hueRange = hueRange;
} }
}); });
chrome.storage.local.get('brightnessRange', ({brightnessRange}) => { chrome.storage.local.get('brightnessRange', ({ brightnessRange }) => {
if (!isNone(brightnessRange)) { if (!isNone(brightnessRange)) {
state.brightnessRange = brightnessRange; state.brightnessRange = brightnessRange;
} }
}); });
chrome.storage.local.get('bridgeIp', ({bridgeIp}) => { chrome.storage.local.get('bridgeIp', ({ bridgeIp }) => {
if (!isNone(bridgeIp)) { if (!isNone(bridgeIp)) {
state.bridgeIp = bridgeIp; state.bridgeIp = bridgeIp;
} }
}); });
chrome.storage.local.get('bridgeUsername', ({bridgeUsername}) => { chrome.storage.local.get('bridgeUsername', ({ bridgeUsername }) => {
if (!isNone(bridgeUsername)) { if (!isNone(bridgeUsername)) {
state.bridgeUsername = bridgeUsername; state.bridgeUsername = bridgeUsername;
} }
}); });
chrome.storage.local.get('lightsData', ({lightsData}) => { chrome.storage.local.get('lightsData', ({ lightsData }) => {
if (!isNone(lightsData)) { if (!isNone(lightsData)) {
state.lightsData = lightsData; state.lightsData = lightsData;
} }
}); });
// add listeners for appliation state change // add listeners for appliation state change
chrome.storage.onChanged.addListener(function ({activeLights, threshold, hueRange, brightnessRange, bridgeIp, bridgeUsername, lightsData}) { chrome.storage.onChanged.addListener(function ({ activeLights, threshold, beatDelay, hueRange, brightnessRange, bridgeIp, bridgeUsername, lightsData }) {
if (activeLights) { if (activeLights) {
state.activeLights = activeLights.newValue; state.activeLights = activeLights.newValue;
} }
@ -89,6 +96,10 @@ chrome.storage.onChanged.addListener(function ({activeLights, threshold, hueRang
kick.set({ threshold: state.threshold }); kick.set({ threshold: state.threshold });
} }
if (beatDelay) {
state.beatDelay = beatDelay.newValue;
}
if (hueRange) { if (hueRange) {
state.hueRange = hueRange.newValue; state.hueRange = hueRange.newValue;
} }
@ -140,6 +151,12 @@ let stopListening = function () {
} }
}; };
chrome.runtime.onMessageExternal.addListener(
function (request, sender, sendResponse) {
sendResponse({ installed: true });
}
);
chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) { chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {
if (request.action === 'start-listening') { if (request.action === 'start-listening') {
chrome.tabCapture.capture({ chrome.tabCapture.capture({
@ -216,10 +233,12 @@ let simulateKick = (/*mag, ratioKickMag*/) => {
color = Math.floor(Math.random() * (state.hueRange[1] - state.hueRange[0] + 1) + state.hueRange[0]); color = Math.floor(Math.random() * (state.hueRange[1] - state.hueRange[0] + 1) + state.hueRange[0]);
_stimulateLight(light, state.brightnessRange[1], color); setTimeout(() => {
setTimeout(function () { _stimulateLight(light, state.brightnessRange[1], color);
_stimulateLight(light, state.brightnessRange[0]) setTimeout(function () {
}, timeToBriOff); _stimulateLight(light, state.brightnessRange[0])
}, timeToBriOff);
}, state.beatDelay);
} }
state.paused = true; state.paused = true;

View file

@ -3,7 +3,7 @@
"name": "Huegasm for Philips Hue Lights", "name": "Huegasm for Philips Hue Lights",
"short_name": "Huegasm", "short_name": "Huegasm",
"description": "Manage and synchronize your Philips Hue lights with the beat of your music.", "description": "Manage and synchronize your Philips Hue lights with the beat of your music.",
"version": "1.0.4", "version": "1.0.6",
"icons": { "icons": {
"16": "16x16.png", "16": "16x16.png",
"48": "48x48.png", "48": "48x48.png",
@ -23,6 +23,11 @@
"default_popup": "index.html", "default_popup": "index.html",
"default_title": "Huegasm" "default_title": "Huegasm"
}, },
"externally_connectable": {
"matches": [
"http://www.huegasm.com/*", "http://localhost:*/*"
]
},
"permissions": [ "permissions": [
"activeTab", "activeTab",
"tabCapture", "tabCapture",

View file

@ -103,7 +103,7 @@ export default Component.extend({
case 'HML003': case 'HML003':
case 'HML004': case 'HML004':
case 'HML005': case 'HML005':
src = 'phoenix_ceiling_pendant_table_wall'; src = 'phoenix_ceiling';
break; break;
case 'HML006': case 'HML006':
src = 'phoenix_down'; src = 'phoenix_down';

View file

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<widget id="com.hoboman313.huegasm" version="1.2.2" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <widget id="com.hoboman313.huegasm" version="1.2.3" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Huegasm</name> <name>Huegasm</name>
<content src="index.html" /> <content src="index.html" />
<plugin name="cordova-plugin-inappbrowser" spec="~1.6.1" /> <plugin name="cordova-plugin-inappbrowser" spec="~1.6.1" />

View file

@ -21,10 +21,10 @@
"broccoli-asset-rev": "^2.2.0", "broccoli-asset-rev": "^2.2.0",
"ember-cli": "^2.11.0", "ember-cli": "^2.11.0",
"ember-cli-app-version": "^3.0.0", "ember-cli-app-version": "^3.0.0",
"ember-cli-babel": "^5.1.5", "ember-cli-babel": "^6.0.0",
"ember-cli-dependency-checker": "^1.2.0", "ember-cli-dependency-checker": "^1.2.0",
"ember-cli-htmlbars": "^1.0.1", "ember-cli-htmlbars": "^1.0.1",
"ember-cli-htmlbars-inline-precompile": "^0.3.1", "ember-cli-htmlbars-inline-precompile": "^0.4.0",
"ember-cli-inject-live-reload": "^1.3.1", "ember-cli-inject-live-reload": "^1.3.1",
"ember-cli-nouislider": "^0.13.0", "ember-cli-nouislider": "^0.13.0",
"ember-cli-release": "^1.0.0-beta.2", "ember-cli-release": "^1.0.0-beta.2",
@ -36,7 +36,7 @@
"ember-export-application-global": "^2.0.0", "ember-export-application-global": "^2.0.0",
"ember-inline-svg": "^0.1.7", "ember-inline-svg": "^0.1.7",
"ember-load-initializers": "^1.0.0", "ember-load-initializers": "^1.0.0",
"ember-modal-dialog": "^0.9.0", "ember-modal-dialog": "^1.0.0",
"ember-notify": "^5.0.4", "ember-notify": "^5.0.4",
"ember-paper": "^1.0.0-alpha.19", "ember-paper": "^1.0.0-alpha.19",
"ember-resolver": "^4.0.0", "ember-resolver": "^4.0.0",

View file

Before

Width:  |  Height:  |  Size: 989 B

After

Width:  |  Height:  |  Size: 989 B

View file

Before

Width:  |  Height:  |  Size: 801 B

After

Width:  |  Height:  |  Size: 801 B

View file

@ -30,6 +30,8 @@
<link href="https://fonts.googleapis.com/css?family=Open+Sans|Raleway" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Open+Sans|Raleway" rel="stylesheet">
<link rel="chrome-webstore-item" href="https://chrome.google.com/webstore/detail/mbjanbdhcpohhfecjgbdpcfhnnbofooj">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"> <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32"> <link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16"> <link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16">

View file

@ -1,21 +1,13 @@
import Ember from 'ember'; import Ember from 'ember';
const { const { A, Component,computed, isEmpty, isNone, run: { later, scheduleOnce }, inject, $, set } = Ember;
A,
Component,
computed,
isEmpty,
isNone,
run: { later, scheduleOnce },
inject,
$
} = Ember;
export default Component.extend({ export default Component.extend({
classNames: ['container-fluid'], classNames: ['container-fluid'],
elementId: 'hue-controls', elementId: 'hue-controls',
lightsData: null, lightsData: null,
canTryChrome: false,
activeLights: A(), activeLights: A(),
tabList: ["Lights", "Music"], tabList: ["Lights", "Music"],
selectedTab: 1, selectedTab: 1,
@ -75,6 +67,8 @@ export default Component.extend({
init() { init() {
this._super(...arguments); this._super(...arguments);
let isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);
if(!this.get('trial')) { if(!this.get('trial')) {
this.updateLightData(); this.updateLightData();
setInterval(this.updateLightData.bind(this), 2000); setInterval(this.updateLightData.bind(this), 2000);
@ -83,6 +77,20 @@ export default Component.extend({
if (!isNone(this.get('storage').get('huegasm.selectedTab'))) { if (!isNone(this.get('storage').get('huegasm.selectedTab'))) {
this.set('selectedTab', this.get('storage').get('huegasm.selectedTab')); this.set('selectedTab', this.get('storage').get('huegasm.selectedTab'));
} }
if (isChrome && chrome && chrome.runtime && chrome.runtime.sendMessage) {
set(this, 'canTryChrome', true);
chrome.runtime.sendMessage(
'mbjanbdhcpohhfecjgbdpcfhnnbofooj',
{},
(response) => {
if (response && response.installed){
set(this, 'canTryChrome', false);
}
}
);
}
}, },
updateLightData(){ updateLightData(){
@ -115,7 +123,7 @@ export default Component.extend({
window.open("https://play.google.com/store/apps/details?id=com.hoboman313.huegasm", '_blank'); window.open("https://play.google.com/store/apps/details?id=com.hoboman313.huegasm", '_blank');
}, },
tryExtension() { tryExtension() {
window.open("https://chrome.google.com/webstore/detail/huegasm-for-philips-hue-l/mbjanbdhcpohhfecjgbdpcfhnnbofooj", '_blank'); chrome.webstore.install("https://chrome.google.com/webstore/detail/mbjanbdhcpohhfecjgbdpcfhnnbofooj");
}, },
changeTab(tabName){ changeTab(tabName){
let index = this.get('tabList').indexOf(tabName); let index = this.get('tabList').indexOf(tabName);
@ -138,6 +146,9 @@ export default Component.extend({
this.get('storage').clear(); this.get('storage').clear();
location.reload(); location.reload();
}, },
email() {
window.open("mailto:contact@nidratech.com", '_blank');
},
startIntro(){ startIntro(){
let intro = introJs(), let intro = introJs(),
playerBottom = $('#player-bottom'); playerBottom = $('#player-bottom');

View file

@ -13,9 +13,11 @@
{{/menu.trigger}} {{/menu.trigger}}
{{#menu.content width=3 as |content|}} {{#menu.content width=3 as |content|}}
{{#content.menu-item class="hidden-xs" onClick="tryExtension"}} {{#if canTryChrome}}
{{paper-icon "extension" class=dimmerOnClass}} Try the Chrome Extension {{#content.menu-item class="hidden-xs" onClick="tryExtension"}}
{{/content.menu-item}} {{paper-icon "extension" class=dimmerOnClass}} Try the Chrome Extension
{{/content.menu-item}}
{{/if}}
{{#content.menu-item class="visible-xs" onClick="tryAndroid"}} {{#content.menu-item class="visible-xs" onClick="tryAndroid"}}
{{paper-icon "extension" class=dimmerOnClass}} Try the Android Extension {{paper-icon "extension" class=dimmerOnClass}} Try the Android Extension
@ -40,6 +42,10 @@
{{#content.menu-item onClick="clearAllSettings"}} {{#content.menu-item onClick="clearAllSettings"}}
{{paper-icon "settings backup restore" class=dimmerOnClass}} Reset settings {{paper-icon "settings backup restore" class=dimmerOnClass}} Reset settings
{{/content.menu-item}} {{/content.menu-item}}
{{#content.menu-item onClick="email"}}
{{paper-icon "email" class=dimmerOnClass}} Contact
{{/content.menu-item}}
{{/menu.content}} {{/menu.content}}
{{/paper-menu}} {{/paper-menu}}
</div> </div>

View file

@ -106,7 +106,7 @@ export default Component.extend({
case 'HML003': case 'HML003':
case 'HML004': case 'HML004':
case 'HML005': case 'HML005':
src = 'phoenix_ceiling_pendant_table_wall'; src = 'phoenix_ceiling';
break; break;
case 'HML006': case 'HML006':
src = 'phoenix_down'; src = 'phoenix_down';

View file

@ -2,14 +2,7 @@ import Ember from 'ember';
import helperMixin from './mixins/helpers'; import helperMixin from './mixins/helpers';
import visualizerMixin from './mixins/visualizer'; import visualizerMixin from './mixins/visualizer';
const { const { Component, observer, isEmpty, isNone, $, run: { later, next } } = Ember;
Component,
observer,
isEmpty,
isNone,
$,
run: { later, next }
} = Ember;
export default Component.extend(helperMixin, visualizerMixin, { export default Component.extend(helperMixin, visualizerMixin, {
updatePageTitle: observer('playQueuePointer', function () { updatePageTitle: observer('playQueuePointer', function () {
@ -174,8 +167,10 @@ export default Component.extend(helperMixin, visualizerMixin, {
timeToBriOff = 80; timeToBriOff = 80;
} }
stimulateLight(light, brightnessRange[1], color); later(this, () => {
later(this, stimulateLight, light, brightnessRange[0], timeToBriOff); stimulateLight(light, brightnessRange[1], color);
later(this, stimulateLight, light, brightnessRange[0], timeToBriOff);
}, this.get('beatDelay'));
} }
this.set('paused', true); this.set('paused', true);
@ -213,7 +208,7 @@ export default Component.extend(helperMixin, visualizerMixin, {
kick: kick kick: kick
}); });
['volume', 'shuffle', 'repeat', 'volumeMuted', 'threshold', 'playerBottomDisplayed', 'songBeatPreferences', 'firstVisit', 'currentVisName', 'playQueue', 'playQueuePointer', 'flashingTransitions', 'colorloopMode', 'hueRange', 'brightnessRange'].forEach((item) => { ['volume', 'shuffle', 'repeat', 'volumeMuted', 'threshold', 'playerBottomDisplayed', 'songBeatPreferences', 'firstVisit', 'currentVisName', 'playQueue', 'playQueuePointer', 'flashingTransitions', 'colorloopMode', 'hueRange', 'brightnessRange', 'beatDelay'].forEach((item) => {
if (!isNone(storage.get('huegasm.' + item))) { if (!isNone(storage.get('huegasm.' + item))) {
let itemVal = storage.get('huegasm.' + item); let itemVal = storage.get('huegasm.' + item);

View file

@ -98,6 +98,7 @@ export default Mixin.create({
} }
}, },
beatDelay: 0,
threshold: 0.3, threshold: 0.3,
hueRange: [0, 65535], hueRange: [0, 65535],
brightnessRange: [1, 254], brightnessRange: [1, 254],

30
web/config/deploy.js Normal file
View file

@ -0,0 +1,30 @@
/* jshint node: true */
module.exports = function(deployTarget) {
var ENV = {
build: {},
git: {
commitMessage: 'Deployed %@'
}
};
if (deployTarget === 'development') {
ENV.build.environment = 'development';
// configure other plugins for development deploy target here
}
if (deployTarget === 'staging') {
ENV.build.environment = 'production';
// configure other plugins for staging deploy target here
}
if (deployTarget === 'production') {
ENV.build.environment = 'production';
// configure other plugins for production deploy target here
}
// Note: if you need to build some configuration asynchronously, you can return
// a promise that resolves with the ENV object instead of returning the
// ENV object synchronously.
return ENV;
};

View file

@ -19,10 +19,13 @@
"broccoli-asset-rev": "^2.2.0", "broccoli-asset-rev": "^2.2.0",
"ember-cli": "^2.8.0", "ember-cli": "^2.8.0",
"ember-cli-app-version": "^3.0.0", "ember-cli-app-version": "^3.0.0",
"ember-cli-babel": "^5.1.5", "ember-cli-babel": "^6.0.0",
"ember-cli-dependency-checker": "^1.2.0", "ember-cli-dependency-checker": "^1.2.0",
"ember-cli-deploy": "^1.0.0",
"ember-cli-deploy-build": "^1.0.0",
"ember-cli-deploy-git": "^1.1.0",
"ember-cli-htmlbars": "^1.0.1", "ember-cli-htmlbars": "^1.0.1",
"ember-cli-htmlbars-inline-precompile": "^0.3.1", "ember-cli-htmlbars-inline-precompile": "^0.4.0",
"ember-cli-inject-live-reload": "^1.3.1", "ember-cli-inject-live-reload": "^1.3.1",
"ember-cli-nouislider": "^0.13.0", "ember-cli-nouislider": "^0.13.0",
"ember-cli-release": "^1.0.0-beta.2", "ember-cli-release": "^1.0.0-beta.2",
@ -33,7 +36,7 @@
"ember-export-application-global": "^2.0.0", "ember-export-application-global": "^2.0.0",
"ember-inline-svg": "^0.1.7", "ember-inline-svg": "^0.1.7",
"ember-load-initializers": "^1.0.0", "ember-load-initializers": "^1.0.0",
"ember-modal-dialog": "^0.9.0", "ember-modal-dialog": "^1.0.0",
"ember-notify": "^5.0.4", "ember-notify": "^5.0.4",
"ember-paper": "^1.0.0-alpha.19", "ember-paper": "^1.0.0-alpha.19",
"ember-resolver": "^4.0.0", "ember-resolver": "^4.0.0",

10
web/public/.gitignore vendored Normal file
View file

@ -0,0 +1,10 @@
/.idea/
/app/
/node_modules/
/bower_components/
/tmp/
/dist/
/web/
/mobile/
/chrome/
/.vscode/

View file

@ -0,0 +1,4 @@
<?xml version="1.0"?>
<users>
<user>358DAA5A6687F1E33975112708669D1C</user>
</users>

1
web/public/CNAME Normal file
View file

@ -0,0 +1 @@
www.huegasm.com

View file

Before

Width:  |  Height:  |  Size: 989 B

After

Width:  |  Height:  |  Size: 989 B

View file

Before

Width:  |  Height:  |  Size: 801 B

After

Width:  |  Height:  |  Size: 801 B