diff --git a/chrome/.bowerrc b/chrome/.bowerrc deleted file mode 100644 index 959e169..0000000 --- a/chrome/.bowerrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "directory": "bower_components", - "analytics": false -} diff --git a/chrome/.editorconfig b/chrome/.editorconfig deleted file mode 100644 index 219985c..0000000 --- a/chrome/.editorconfig +++ /dev/null @@ -1,20 +0,0 @@ -# EditorConfig helps developers define and maintain consistent -# coding styles between different editors and IDEs -# editorconfig.org - -root = true - - -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true -indent_style = space -indent_size = 2 - -[*.hbs] -insert_final_newline = false - -[*.{diff,md}] -trim_trailing_whitespace = false diff --git a/chrome/.ember-cli b/chrome/.ember-cli deleted file mode 100644 index 2b62747..0000000 --- a/chrome/.ember-cli +++ /dev/null @@ -1,11 +0,0 @@ -{ - /** - Ember CLI sends analytics information by default. The data is completely - anonymous, but there are times when you might want to disable this behavior. - - Setting `disableAnalytics` to true will prevent any data from being sent. - */ - "disableAnalytics": true, - "usePods": true, - "port": 8080 -} diff --git a/chrome/.gitignore b/chrome/.gitignore deleted file mode 100644 index 5d5c656..0000000 --- a/chrome/.gitignore +++ /dev/null @@ -1,19 +0,0 @@ -# See http://help.github.com/ignore-files/ for more about ignoring files. - -# compiled output -/dist -/tmp - -# dependencies -/node_modules -/bower_components - -# misc -/.sass-cache -/connect.lock -/coverage/* -/libpeerconnection.log -npm-debug.log -testem.log -/.idea/ -*.zip diff --git a/chrome/.jshintrc b/chrome/.jshintrc deleted file mode 100644 index 42624ff..0000000 --- a/chrome/.jshintrc +++ /dev/null @@ -1,37 +0,0 @@ -{ - "predef": [ - "document", - "window", - "-Promise", - "Dancer", - "ID3", - "FileAPIReader", - "SC", - "introJs" - ], - "browser": true, - "boss": true, - "curly": true, - "debug": false, - "devel": true, - "eqeqeq": true, - "evil": true, - "forin": false, - "immed": false, - "laxbreak": false, - "newcap": true, - "noarg": true, - "noempty": false, - "nonew": false, - "nomen": false, - "onevar": false, - "plusplus": false, - "regexp": false, - "undef": true, - "sub": true, - "strict": false, - "white": false, - "eqnull": true, - "esversion": 6, - "unused": true -} diff --git a/chrome/.travis.yml b/chrome/.travis.yml deleted file mode 100644 index a75f20e..0000000 --- a/chrome/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ ---- -language: node_js -node_js: - - "4" - -sudo: false - -cache: - directories: - - $HOME/.npm - - $HOME/.cache # includes bowers cache - -before_install: - - npm config set spin false - - npm install -g bower phantomjs-prebuilt - - bower --version - - phantomjs --version - -install: - - npm install - - bower install - -script: - - npm test diff --git a/chrome/.watchmanconfig b/chrome/.watchmanconfig deleted file mode 100644 index e7834e3..0000000 --- a/chrome/.watchmanconfig +++ /dev/null @@ -1,3 +0,0 @@ -{ - "ignore_dirs": ["tmp", "dist"] -} diff --git a/chrome/README.md b/chrome/README.md deleted file mode 100644 index c8af9d5..0000000 --- a/chrome/README.md +++ /dev/null @@ -1,44 +0,0 @@ -# Huegasm - -This README outlines the details of collaborating on this Ember application. -Music awesomeness for hue lights. - -## Prerequisites - -You will need the following things properly installed on your computer. - -* [Git](http://git-scm.com/) -* [Node.js](http://nodejs.org/) (with NPM) -* [Bower](http://bower.io/) -* [Ember CLI](http://ember-cli.com/) -* [PhantomJS](http://phantomjs.org/) - -## Installation - -* `git clone ` this repository -* `cd huegasm` -* `npm install` -* `bower install` - -## Running / Development - -* `ember serve` -* Visit your app at [http://localhost:4200](http://localhost:4200). - -### Code Generators - -Make use of the many generators for code, try `ember help generate` for more details - -### Building - -* `ember build` (development) -* `ember build --environment production` (production) - -## Further Reading / Useful Links - -* [ember.js](http://emberjs.com/) -* [ember-cli](http://ember-cli.com/) -* Development Browser Extensions - * [ember inspector for chrome](https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi) - * [ember inspector for firefox](https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/) - diff --git a/chrome/app/app.js b/chrome/app/app.js deleted file mode 100644 index 831ad61..0000000 --- a/chrome/app/app.js +++ /dev/null @@ -1,18 +0,0 @@ -import Ember from 'ember'; -import Resolver from './resolver'; -import loadInitializers from 'ember-load-initializers'; -import config from './config/environment'; - -let App; - -Ember.MODEL_FACTORY_INJECTIONS = true; - -App = Ember.Application.extend({ - modulePrefix: config.modulePrefix, - podModulePrefix: config.podModulePrefix, - Resolver -}); - -loadInitializers(App, config.modulePrefix); - -export default App; diff --git a/chrome/app/index.html b/chrome/app/index.html deleted file mode 100644 index e51d089..0000000 --- a/chrome/app/index.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - Huegasm - {{content-for 'head'}} - - - - - {{content-for 'head-footer'}} - - - - {{content-for 'body'}} - - - - - {{content-for 'body-footer'}} - - - \ No newline at end of file diff --git a/chrome/app/pods/application/controller.js b/chrome/app/pods/application/controller.js deleted file mode 100644 index a117a59..0000000 --- a/chrome/app/pods/application/controller.js +++ /dev/null @@ -1,53 +0,0 @@ -import Ember from 'ember'; - -const { - Controller, - isEmpty, - $ -} = Ember; - -export default Controller.extend({ - dimmerOn: false, - lightsIconsOn: true, - - init() { - this._super(...arguments); - - chrome.storage.local.get('dimmerOn', ({dimmerOn}) => { - chrome.storage.local.get('lightsIconsOn', ({lightsIconsOn}) => { - if (!isEmpty(dimmerOn) && dimmerOn) { - this.send('toggleDimmer'); - } - - if (!isEmpty(lightsIconsOn)) { - this.set('lightsIconsOn', lightsIconsOn); - } - }) - }); - }, - - actions: { - toggleLightsIcons() { - this.toggleProperty('lightsIconsOn'); - - let lightsIconsOn = this.get('lightsIconsOn'); - - chrome.storage.local.set({ 'lightsIconsOn': lightsIconsOn }); - }, - toggleDimmer() { - this.toggleProperty('dimmerOn'); - - let dimmerOn = this.get('dimmerOn'); - - if (dimmerOn) { - $('body').addClass('dimmerOn'); - $('html').addClass('dimmerOn'); - } else { - $('body').removeClass('dimmerOn'); - $('html').removeClass('dimmerOn'); - } - - chrome.storage.local.set({ 'dimmerOn': dimmerOn }); - } - } -}); diff --git a/chrome/app/pods/application/template.hbs b/chrome/app/pods/application/template.hbs deleted file mode 100644 index 3132013..0000000 --- a/chrome/app/pods/application/template.hbs +++ /dev/null @@ -1 +0,0 @@ -{{huegasm-app toggleLightsIcons="toggleLightsIcons" toggleDimmer="toggleDimmer" dimmerOn=dimmerOn lightsIconsOn=lightsIconsOn}} \ No newline at end of file diff --git a/chrome/app/pods/components/bridge-finder/component.js b/chrome/app/pods/components/bridge-finder/component.js deleted file mode 100644 index bf8fad0..0000000 --- a/chrome/app/pods/components/bridge-finder/component.js +++ /dev/null @@ -1,156 +0,0 @@ -import Ember from 'ember'; - -const { - Component, - observer, - computed, - on, - isNone, - run: { later }, - $ -} = Ember; - -export default Component.extend({ - elementId: 'bridge-finder', - classNames: ['container'], - bridgeIp: null, - trial: false, - bridgeUsername: null, - bridgeFindStatus: null, - bridgeFindSuccess: computed.equal('bridgeFindStatus', 'success'), - bridgeFindMultiple: computed.equal('bridgeFindStatus', 'multiple'), - bridgeFindFail: computed.equal('bridgeFindStatus', 'fail'), - bridgeUsernamePingMaxTime: 30000, // 30 seconds - bridgeUsernamePingIntervalTime: 1500, - bridgeUserNamePingIntervalProgress: 0, - bridgePingIntervalHandle: null, - bridgeAuthenticateReachedStatus: null, - manualBridgeIp: null, - manualBridgeIpNotFound: false, - multipleBridgeIps: [], - isAuthenticating: computed.notEmpty('bridgePingIntervalHandle'), - - // try to authenticate against the bridge here - onBridgeIpChange: on('init', observer('bridgeIp', function () { - if (!this.get('trial') && !this.get('isAuthenticating')) { - this.setProperties({ - bridgePingIntervalHandle: setInterval(this.pingBridgeUser.bind(this), this.get('bridgeUsernamePingIntervalTime')), - bridgeUserNamePingIntervalProgress: 0 - }); - } - })), - - didInsertElement() { - $(document).keypress((event) => { - if (!isNone(this.get('manualBridgeIp')) && event.which === 13) { - this.send('findBridgeByIp'); - } - }); - }, - - // find the bridge ip here - init() { - this._super(...arguments); - - if (this.get('bridgeIp') === null) { - $.ajax('https://www.meethue.com/api/nupnp', { - timeout: 30000 - }) - .done((result, status) => { - let bridgeFindStatus = 'fail'; - - if (!this.isDestroyed) { - if (status === 'success' && result.length === 1) { - this.set('bridgeIp', result[0].internalipaddress); - chrome.storage.local.set({ 'bridgeIp': result[0].internalipaddress }); - bridgeFindStatus = 'success'; - } else if (result.length > 1) { - let multipleBridgeIps = this.get('multipleBridgeIps'); - - result.forEach(function (item) { - multipleBridgeIps.pushObject(item.internalipaddress); - }); - - bridgeFindStatus = 'multiple'; - } else { - bridgeFindStatus = 'fail'; - } - - this.set('bridgeFindStatus', bridgeFindStatus); - } - }) - .fail(() => { - this.set('bridgeFindStatus', 'fail'); - }); - } - }, - - pingBridgeUser() { - let bridgeIp = this.get('bridgeIp'), - bridgeUserNamePingIntervalProgress = this.get('bridgeUserNamePingIntervalProgress'), - bridgeUsernamePingMaxTime = this.get('bridgeUsernamePingMaxTime'); - - if (bridgeIp !== null && bridgeUserNamePingIntervalProgress < 100) { - $.ajax('http://' + bridgeIp + '/api', { - data: JSON.stringify({ "devicetype": "huegasm" }), - contentType: 'application/json', - type: 'POST' - }).done((result, status) => { - if (!this.isDestroyed) { - this.set('bridgeAuthenticateReachedStatus', status); - - if (status === 'success' && !result[0].error) { - this.clearBridgePingIntervalHandle(); - chrome.storage.local.set({ 'bridgeUsername': result[0].success.username }); - this.set('bridgeUsername', result[0].success.username); - } - } - }); - - this.incrementProperty('bridgeUserNamePingIntervalProgress', this.get('bridgeUsernamePingIntervalTime') / bridgeUsernamePingMaxTime * 100); - } else { - this.clearBridgePingIntervalHandle(); - } - }, - - clearBridgePingIntervalHandle() { - clearInterval(this.get('bridgePingIntervalHandle')); - if (!this.isDestroyed) { - this.set('bridgePingIntervalHandle', null); - } - }, - - actions: { - retry() { - this.onBridgeIpChange(); - }, - chooseBridge(bridgeIp) { - this.set('bridgeIp', bridgeIp); - chrome.storage.local.set({ 'bridgeIp': bridgeIp }); - }, - findBridgeByIp() { - let manualBridgeIp = this.get('manualBridgeIp'); - - if (manualBridgeIp.toLowerCase() === 'trial' || manualBridgeIp.toLowerCase() === 'offline') { - this.setProperties({ - trial: true, - bridgeIp: 'trial', - bridgeUsername: 'trial' - }); - } else { - $.ajax('http://' + manualBridgeIp + '/api', { - data: JSON.stringify({ "devicetype": "huegasm" }), - contentType: 'application/json', - type: 'POST' - }).fail(() => { - this.set('manualBridgeIpNotFound', true); - later(this, function () { - this.set('manualBridgeIpNotFound', false); - }, 5000); - }).then(() => { - this.send('chooseBridge', manualBridgeIp); - }); - } - } - }, -}); diff --git a/chrome/app/pods/components/bridge-finder/template.hbs b/chrome/app/pods/components/bridge-finder/template.hbs deleted file mode 100644 index 4ea916f..0000000 --- a/chrome/app/pods/components/bridge-finder/template.hbs +++ /dev/null @@ -1,75 +0,0 @@ -{{#unless bridgeUsername}} - {{#if bridgeIp}} - - - - - - - - - - {{paper-progress-linear warn=true value=bridgeUserNamePingIntervalProgress}} - - {{#if isAuthenticating}} -

- Your bridge IP is {{bridgeIp}} -
Press the button on your bridge to authenticate Huegasm. -

- {{else}} -

You failed to press the button in time. RETRY

- {{/if}} - {{else}} - {{#unless bridgeFindStatus}} - {{paper-progress-circular diameter=100}} -

Trying to find your bridge's IP.

- {{/unless}} - - {{#if bridgeFindMultiple}} -

Huegasm found multiple hue bridges.
Please select the one you want to use for Huegasm.

- -
- {{#each multipleBridgeIps as |bridge|}} - {{paper-radio value=bridge label=bridge onChange=(action "chooseBridge")}} - {{/each}} -
- {{else}} - {{#if bridgeFindFail}} -

- A hue bridge could not be automatically found on your network.
Enter one manually?

(or type offline to look around) -

- - - {{paper-input label="Hue bridge IP address" value=manualBridgeIp onChange=(action (mut manualBridgeIp))}} - -
- {{paper-button onClick=(action "findBridgeByIp") raised=true primary=true label="Find"}} -
-
- - {{#if manualBridgeIpNotFound}} -

- Could not find a bridge with that IP address. -

- {{/if}} - {{/if}} - {{/if}} - {{/if}} -{{/unless}} \ No newline at end of file diff --git a/chrome/app/pods/components/hue-controls/component.js b/chrome/app/pods/components/hue-controls/component.js deleted file mode 100644 index 458f03a..0000000 --- a/chrome/app/pods/components/hue-controls/component.js +++ /dev/null @@ -1,141 +0,0 @@ -import Ember from 'ember'; - -const { - A, - Component, - computed, - isEmpty, - isNone, - run: { later, scheduleOnce }, - inject, - $ -} = Ember; - -export default Component.extend({ - classNames: ['container-fluid'], - elementId: 'hue-controls', - lightsData: null, - - activeLights: A(), - tabList: ["Lights", "Music"], - selectedTab: 0, - pauseLightUpdates: false, - - displayFailure: true, - - notify: inject.service(), - - dimmerOnClass: computed('dimmerOn', function () { - return this.get('dimmerOn') ? 'dimmerOn md-menu-origin' : 'md-menu-origin'; - }), - - ready: computed('lightsData', 'trial', function () { - return this.get('trial') || !isNone(this.get('lightsData')); - }), - - apiURL: computed('bridgeIp', 'bridgeUsername', function () { - return 'http://' + this.get('bridgeIp') + '/api/' + this.get('bridgeUsername'); - }), - - tabData: computed('tabList', 'selectedTab', function () { - let tabData = [], selectedTab = this.get('selectedTab'); - - this.get('tabList').forEach(function (tab, i) { - let selected = false; - - if (i === selectedTab) { - selected = true; - } - - tabData.push({ "name": tab, "selected": selected }); - }); - - return tabData; - }), - - didInsertElement() { - // here's a weird way to automatically initialize bootstrap tooltips - let observer = new MutationObserver(function (mutations) { - let haveTooltip = !mutations.every(function (mutation) { - return isEmpty(mutation.addedNodes) || isNone(mutation.addedNodes[0].classList) || mutation.addedNodes[0].classList.contains('tooltip'); - }); - - if (haveTooltip) { - scheduleOnce('afterRender', function () { - $('.bootstrap-tooltip').tooltip(); - }); - } - }); - - observer.observe($('#hue-controls')[0], { childList: true, subtree: true }); - }, - - init() { - this._super(...arguments); - - if (!this.get('trial')) { - this.updateLightData(); - setInterval(this.updateLightData.bind(this), 2000); - } - - chrome.storage.local.get('selectedTab', ({selectedTab}) => { - if (!isNone(selectedTab)) { - this.set('selectedTab', selectedTab); - } - }); - }, - - updateLightData() { - let fail = () => { - if (isNone(this.get('lightsData'))) { - this.send('clearBridge'); - } else if (this.get('displayFailure')) { - this.get('notify').warning({ html: '' }); - this.set('displayFailure', false); - - later(this, function () { - this.set('displayFailure', true); - }, 30000); - } - }; - - if (!this.get('pauseLightUpdates')) { - $.get(this.get('apiURL') + '/lights', (result, status) => { - if (!isNone(result[0]) && !isNone(result[0].error)) { - fail(); - } else if (status === 'success' && JSON.stringify(this.get('lightsData')) !== JSON.stringify(result)) { - this.set('lightsData', result); - chrome.storage.local.set({ 'lightsData': result }); - } - }).fail(fail); - } - }, - - actions: { - changeTab(tabName) { - let index = this.get('tabList').indexOf(tabName); - this.set('selectedTab', index); - chrome.storage.local.set({ 'selectedTab': index }); - }, - clearBridge() { - chrome.storage.local.remove('bridgeUsername'); - chrome.storage.local.remove('bridgeIp'); - location.reload(); - chrome.runtime.sendMessage({ action: 'stop-listening' }); - }, - toggleDimmer() { - this.sendAction('toggleDimmer'); - }, - toggleLightsIcons() { - this.sendAction('toggleLightsIcons'); - }, - clearAllSettings() { - chrome.storage.local.clear(); - location.reload(); - chrome.runtime.sendMessage({ action: 'stop-listening' }); - }, - email() { - chrome.tabs.create({ url: 'mailto:contact@nidratech.com' }); - } - } -}); diff --git a/chrome/app/pods/components/hue-controls/template.hbs b/chrome/app/pods/components/hue-controls/template.hbs deleted file mode 100644 index fa5cfe4..0000000 --- a/chrome/app/pods/components/hue-controls/template.hbs +++ /dev/null @@ -1,51 +0,0 @@ -{{#if ready}} - - - {{light-group lightsData=lightsData activeLights=activeLights syncLight=syncLight apiURL=apiURL dimmerOn=dimmerOn lightsIconsOn=lightsIconsOn pauseLightUpdates=pauseLightUpdates}} - -
- {{lights-tab active=(eq selectedTab 0) apiURL=apiURL lightsData=lightsData activeLights=activeLights syncLight=syncLight - trial=trial colorLoopOn=colorLoopOn dimmerOn=dimmerOn playing=playing pauseLightUpdates=pauseLightUpdates}} - - {{music-tab active=(eq selectedTab 1) apiURL=apiURL lightsData=lightsData activeLights=activeLights pauseLightUpdates=pauseLightUpdates - dimmerOn=dimmerOn colorLoopOn=colorLoopOn playing=playing action="startIntro"}} -
-{{else}} - {{paper-progress-circular diameter=100}} -{{/if}} - -{{ember-notify messageStyle='bootstrap' closeAfter=5000}} \ No newline at end of file diff --git a/chrome/app/pods/components/huegasm-app/component.js b/chrome/app/pods/components/huegasm-app/component.js deleted file mode 100644 index fa2e451..0000000 --- a/chrome/app/pods/components/huegasm-app/component.js +++ /dev/null @@ -1,37 +0,0 @@ -import Ember from 'ember'; - -const { - Component, - isEmpty, - $ -} = Ember; - -export default Component.extend({ - bridgeIp: null, - bridgeUsername: null, - trial: false, - elementId: 'huegasm', - - init() { - this._super(...arguments); - - chrome.storage.local.get('bridgeIp', ({bridgeIp}) => { - chrome.storage.local.get('bridgeUsername', ({bridgeUsername}) => { - this.setProperties({ - bridgeIp, - bridgeUsername - }); - }); - }); - }, - - actions: { - toggleDimmer() { - this.sendAction('toggleDimmer'); - }, - - toggleLightsIcons() { - this.sendAction('toggleLightsIcons'); - } - } -}); diff --git a/chrome/app/pods/components/huegasm-app/template.hbs b/chrome/app/pods/components/huegasm-app/template.hbs deleted file mode 100644 index 78c19e7..0000000 --- a/chrome/app/pods/components/huegasm-app/template.hbs +++ /dev/null @@ -1,6 +0,0 @@ -{{#if bridgeUsername}} - {{hue-controls bridgeIp=bridgeIp bridgeUsername=bridgeUsername trial=trial dimmerOn=dimmerOn lightsIconsOn=lightsIconsOn - toggleDimmer="toggleDimmer" toggleLightsIcons="toggleLightsIcons"}} -{{else}} - {{bridge-finder bridgeIp=bridgeIp bridgeUsername=bridgeUsername trial=trial}} -{{/if}} \ No newline at end of file diff --git a/chrome/app/pods/components/light-group/component.js b/chrome/app/pods/components/light-group/component.js deleted file mode 100644 index 5b88a5a..0000000 --- a/chrome/app/pods/components/light-group/component.js +++ /dev/null @@ -1,254 +0,0 @@ -import Ember from 'ember'; - -const { - A, - Component, - computed, - isEmpty, - isNone, - observer, - $ -} = Ember; - -export default Component.extend({ - elementId: 'active-lights', - classNames: ['light-group'], - isHovering: false, - activeLights: A(), - - // list of all the lights in the hue system - lightsList: computed('lightsData', 'activeLights.[]', 'dimmerOn', function () { - let lightsData = this.get('lightsData'), - activeLights = this.get('activeLights'), - dimmerOn = this.get('dimmerOn'), - lightsList = A(), - src, - activeClass; - - for (let key in lightsData) { - activeClass = 'light-active'; - - if (lightsData.hasOwnProperty(key) && lightsData[key].state.reachable) { - switch (lightsData[key].modelid) { - case 'BSB001': - src = 'bridge_v1'; - break; - case 'BSB002': - src = 'bridge_v2'; - break; - case 'LCT001': - case 'LCT007': - case 'LCT010': - case 'LCT014': - case 'LTW010': - case 'LTW001': - case 'LTW004': - case 'LTW015': - case 'LWB004': - case 'LWB006': - src = 'white_and_color_e27'; - break; - case 'LWB010': - case 'LWB014': - src = 'white_e27'; - break; - case 'LCT002': - src = 'br30'; - break; - case 'LCT011': - case 'LTW011': - src = 'br30_slim'; - break; - case 'LCT003': - src = 'gu10'; - break; - case 'LTW013': - src = 'gu10_perfectfit'; - break; - case 'LST002': - case 'LST001': - src = 'lightstrip'; - break; - case 'LLC006': - case 'LLC010': - src = 'iris'; - break; - case 'LLC005': - case 'LLC011': - case 'LLC012': - case 'LLC007': - src = 'bloom'; - break; - case 'LLC014': - src = 'aura'; - break; - case 'LLC013': - src = 'storylight'; - break; - case 'LLC020': - src = 'go'; - break; - case 'HBL001': - case 'HBL002': - case 'HBL003': - src = 'beyond_ceiling_pendant_table'; - break; - case 'HIL001': - case 'HIL002': - src = 'impulse'; - break; - case 'HEL001': - case 'HEL002': - src = 'entity'; - break; - case 'HML001': - case 'HML002': - case 'HML003': - case 'HML004': - case 'HML005': - src = 'phoenix_ceiling'; - break; - case 'HML006': - src = 'phoenix_down'; - break; - case 'LTP003': - src = 'pendant_square'; - break; - case 'LTP002': - case 'LTP003': - src = 'pendant_round'; - break; - case 'LTP001': - src = 'pendant_oval'; - break; - case 'LDF002': - case 'LTF002': - case 'LTF001': - case 'LTC001': - case 'LTC002': - case 'LDF001': - src = 'ceiling_square'; - break; - case 'LTC003': - case 'LTD001': - case 'LTD001': - src = 'ceiling_round'; - break; - case 'LDD002': - src = 'floor'; - break; - case 'LDD001': - src = 'table'; - break; - case 'LDT001': - case 'MWM001': - src = 'recessed'; - break; - case 'SWT001': - src = 'tap'; - break; - case 'RWL021': - src = 'hds'; - break; - case 'SML001': - src = 'motion_sensor'; - break; - default: - src = 'white_e27'; - } - - if (dimmerOn) { - src = `assets/images/lights/filled/${src}.svg`; - } else { - src = `assets/images/lights/outline/${src}.svg`; - } - - if (!activeLights.includes(key)) { - activeClass = 'light-inactive'; - } - - lightsList.push({ src , name: lightsData[key].name, id: key, data: lightsData[key], activeClass }); - } - } - - return lightsList; - }), - - onActiveLightsChange: observer('activeLights.[]', function () { - chrome.storage.local.set({ 'activeLights': this.get('activeLights') }); - }), - - init() { - this._super(...arguments); - - let lightsData = this.get('lightsData'), - _activeLights = this.get('activeLights'); - - chrome.storage.local.get('activeLights', ({activeLights}) => { - if (!isNone(activeLights)) { - activeLights.forEach(function (i) { - if (!isNone(lightsData) && lightsData.hasOwnProperty(i) && lightsData[i].state.reachable) { - _activeLights.pushObject(i); - } - }); - } else { - for (let key in lightsData) { - if (lightsData.hasOwnProperty(key) && lightsData[key].state.reachable) { - _activeLights.pushObject(key); - } - } - } - }); - }, - - actions: { - clickLight(id) { - let activeLights = this.get('activeLights'), - lightId = activeLights.indexOf(id); - - if (lightId !== -1) { - activeLights.removeObject(id); - } else { - activeLights.pushObject(id); - this.set('syncLight', id); - } - }, - lightStartHover(id) { - let activeLights = this.get('activeLights'), - hoveredLight = this.get('lightsList').filter(function (light) { - return light.activeClass !== 'unreachable' && light.id === id[0] && activeLights.indexOf(id) !== -1; - }); - - if (!isEmpty(hoveredLight) && this.get('noHover') !== true) { - $.ajax(this.get('apiURL') + '/lights/' + id + '/state', { - data: JSON.stringify({ "alert": "lselect" }), - contentType: 'application/json', - type: 'PUT' - }); - } - - this.setProperties({ - pauseLightUpdates: true, - isHovering: true - }); - }, - lightStopHover(id) { - let hoveredLight = this.get('lightsList').filter(function (light) { - return light.activeClass !== 'unreachable' && light.id === id[0]; - }); - - if (!isEmpty(hoveredLight) && this.get('noHover') !== true) { - $.ajax(this.get('apiURL') + '/lights/' + id + '/state', { - data: JSON.stringify({ "alert": "none" }), - contentType: 'application/json', - type: 'PUT' - }); - } - - this.setProperties({ - pauseLightUpdates: false, - isHovering: false - }); - } - } -}); diff --git a/chrome/app/pods/components/light-group/template.hbs b/chrome/app/pods/components/light-group/template.hbs deleted file mode 100644 index 0161669..0000000 --- a/chrome/app/pods/components/light-group/template.hbs +++ /dev/null @@ -1,11 +0,0 @@ -{{#each lightsList as |light|}} - {{#if lightsIconsOn}} -
- {{inline-svg light.src class="hue-light"}} -
- {{else}} -
-
{{light.name}}
-
- {{/if}} -{{/each}} \ No newline at end of file diff --git a/chrome/app/pods/components/lights-tab/color-picker/component.js b/chrome/app/pods/components/lights-tab/color-picker/component.js deleted file mode 100644 index 232cfb1..0000000 --- a/chrome/app/pods/components/lights-tab/color-picker/component.js +++ /dev/null @@ -1,58 +0,0 @@ -import Ember from 'ember'; - -const { - Component, - $ -} = Ember; - -export default Component.extend({ - elementId: 'color-picker', - rgb: null, - canvas: null, - canvasContext: null, - pressingDown: false, - - mouseUp(){ - this.set('pressingDown', false); - }, - - mouseMove(event){ - if (this.get('pressingDown')) { - this.mouseDown(event); - } - }, - - mouseDown(event){ - let canvasOffset = $(this.get('canvas')).offset(), - canvasX = Math.floor(event.pageX - canvasOffset.left), - canvasY = Math.floor(event.pageY - canvasOffset.top); - - // get current pixel - let imageData = this.get('canvasContext').getImageData(canvasX, canvasY, 1, 1), - pixel = imageData.data; - - this.set('pressingDown', true); - - if (!(pixel[0] === 0 && pixel[1] === 0 && pixel[2] === 0)) { - this.set('rgb', [pixel[0], pixel[1], pixel[2]]); - } - }, - - // https://dzone.com/articles/creating-your-own-html5 - didInsertElement(){ - // handle color changes - let canvas = $('#picker')[0], - canvasContext = canvas.getContext('2d'), - image = new Image(); - - image.src = 'assets/images/colormap.png'; - image.onload = function () { - canvasContext.drawImage(image, 0, 0, image.width, image.height); // draw the image on the canvas - }; - - this.setProperties({ - canvas: canvas, - canvasContext: canvasContext - }); - } -}); diff --git a/chrome/app/pods/components/lights-tab/color-picker/template.hbs b/chrome/app/pods/components/lights-tab/color-picker/template.hbs deleted file mode 100644 index 16508e9..0000000 --- a/chrome/app/pods/components/lights-tab/color-picker/template.hbs +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/chrome/app/pods/components/lights-tab/component.js b/chrome/app/pods/components/lights-tab/component.js deleted file mode 100644 index 875c30f..0000000 --- a/chrome/app/pods/components/lights-tab/component.js +++ /dev/null @@ -1,348 +0,0 @@ -import Ember from 'ember'; - -const { - Component, - observer, - computed, - on, - run: { later, once }, - $ -} = Ember; - -export default Component.extend({ - classNames: ['col-sm-10', 'col-sm-offset-1', 'col-xs-12'], - classNameBindings: ['active::hidden'], - elementId: 'lights-tab', - - rgb: [255, 255, 255], - - lightsOn: false, - - // COLOR LOOP related stuff - colorLoopOn: false, - - lightsOnTxt: computed('lightsOn', function () { - return this.get('lightsOn') ? 'On' : 'Off'; - }), - - colorloopOnTxt: computed('colorLoopOn', function () { - return this.get('colorLoopOn') ? 'On' : 'Off'; - }), - - // determines the average brightness of the hue system for the brightness slider - lightsBrightness: computed('lightsData', function () { - let lightsData = this.get('lightsData'), - activeLights = this.get('activeLights'), - lightsBrightness = 0; - - activeLights.forEach(function (light) { - lightsBrightness += lightsData[light].state.bri; - }); - - return lightsBrightness / activeLights.length; - }), - - brightnessControlDisabled: computed.not('lightsOn'), - - onColorLoopOnChange: observer('colorLoopOn', function () { - let lightsData = this.get('lightsData'), - activeLights = this.get('activeLights'), - colorLoopsOn = this.get('colorLoopOn'), - effect = colorLoopsOn ? 'colorloop' : 'none'; - - let colorLoopsOnSystem = activeLights.some(function (light) { - return lightsData[light].state.effect === 'colorloop'; - }); - - // if the internal lights state is different than the one from lightsData (user manually toggled the switch), send the request to change the bulbs state - if (colorLoopsOn !== colorLoopsOnSystem) { - activeLights.forEach((light) => { - if (this.get('lightsData')[light].state.effect !== effect) { - $.ajax(this.get('apiURL') + '/lights/' + light + '/state', { - data: JSON.stringify({ 'effect': effect }), - contentType: 'application/json', - type: 'PUT' - }); - } - }); - } - }), - - rgbPreview: observer('rgb', function () { - let rgb = this.get('rgb'), - xy = this.rgbToXy(rgb[0], rgb[1], rgb[2]); - - this.set('colorLoopOn', false); - - this.get('activeLights').forEach((light) => { - $.ajax(this.get('apiURL') + '/lights/' + light + '/state', { - data: JSON.stringify({ "xy": xy }), - contentType: 'application/json', - type: 'PUT' - }); - }); - - this.set('colorLoopOn', false); - $('.color').css('background', 'rgb(' + rgb[0] + ',' + rgb[1] + ',' + rgb[2] + ')'); - }), - - // determines whether the lights are on/off for the lights switch - lightsOnChange: on('init', observer('lightsData.@each.state.on', 'activeLights.[]', function () { - if (!this.get('strobeOn')) { - let lightsData = this.get('lightsData'), lightsOn = this.get('activeLights').some(function (light) { - return lightsData[light].state.on === true; - }); - - this.set('lightsOn', lightsOn); - } - })), - - onLightsOnChange: observer('lightsOn', function () { - let lightsData = this.get('lightsData'), - activeLights = this.get('activeLights'), - lightsOn = this.get('lightsOn'); - - let lightsOnSystem = activeLights.some(function (light) { - return lightsData[light].state.on === true; - }); - - // if the internal lights state is different than the one from lightsData (user manually toggled the switch), send the request to change the bulbs state - if (lightsOn !== lightsOnSystem) { - activeLights.forEach((light) => { - $.ajax(this.get('apiURL') + '/lights/' + light + '/state', { - data: JSON.stringify({ "on": lightsOn }), - contentType: 'application/json', - type: 'PUT' - }); - }); - } - }), - - onBrightnessChanged: observer('lightsBrightness', function () { - once(this, function () { - let lightsData = this.get('lightsData'), - lightsBrightnessSystem = false, - lightsBrightness = this.get('lightsBrightness'), - activeLights = this.get('activeLights'); - - activeLights.forEach(function (light) { - lightsBrightnessSystem += lightsData[light].state.bri; - }); - - lightsBrightnessSystem /= activeLights.length; - - // if the internal lights state is different than the one from lightsData (user manually toggled the switch), send the request to change the bulbs state - if (lightsBrightness !== lightsBrightnessSystem) { - activeLights.forEach((light) => { - $.ajax(this.get('apiURL') + '/lights/' + light + '/state', { - data: JSON.stringify({ "bri": lightsBrightness }), - contentType: 'application/json', - type: 'PUT' - }); - }); - } - }); - }), - - // sync the current light settings to the newly added light - onaActiveLightsChange: observer('syncLight', function () { - let options = { - on: this.get('lightsOn'), - bri: this.get('lightsBrightness'), - effect: this.get('colorLoopOn') ? 'colorloop' : 'none' - }, rgb = this.get('rgb'), - syncLight = this.get('syncLight'); - - if (rgb[0] !== 255 && rgb[1] !== 255 && rgb[2] !== 255) { - options['xy'] = this.rgbToXy(rgb[0], rgb[1], rgb[2]); - } - - options['transitiontime'] = 0; - - $.ajax(this.get('apiURL') + '/lights/' + syncLight + '/state', { - data: JSON.stringify(options), - contentType: 'application/json', - type: 'PUT' - }); - }), - - // **************** STROBE LIGHT START **************** - strobeOn: false, - - strobeOnInervalHandle: null, - preStrobeOnLightsDataCache: null, - nextLightIdx: 0, - - onStrobeOnChange: observer('strobeOn', function () { - let lightsData = this.get('lightsData'), - strobeOn = this.get('strobeOn'); - - if (strobeOn) { - this.set('preStrobeOnLightsDataCache', lightsData); - let stobeInitRequestData = { transitiontime: 0 }; - - for (let key in lightsData) { - if (lightsData.hasOwnProperty(key)) { - if (lightsData[key].state.on) { - stobeInitRequestData.on = false; - } - - $.ajax(this.get('apiURL') + '/lights/' + key + '/state', { - data: JSON.stringify(stobeInitRequestData), - contentType: 'application/json', - type: 'PUT' - }); - } - } - - this.set('strobeOnInervalHandle', setInterval(this.strobeStep.bind(this), 500)); - } else { // revert the light system to pre-strobe - let preStrobeOnLightsDataCache = this.get('preStrobeOnLightsDataCache'), updateLight = (lightIndex) => { - $.ajax(this.get('apiURL') + '/lights/' + lightIndex + '/state', { - data: JSON.stringify({ - on: preStrobeOnLightsDataCache[lightIndex].state.on, - sat: preStrobeOnLightsDataCache[lightIndex].state.sat - }), - contentType: 'application/json', - type: 'PUT' - }); - }; - - for (let key in lightsData) { - if (lightsData.hasOwnProperty(key)) { - later(this, updateLight, key, 2000); - } - } - - later(this, this.onColorLoopOnChange, 2000); - clearInterval(this.get('strobeOnInervalHandle')); - } - - this.set('pauseLightUpdates', strobeOn); - }), - - strobeStep() { - let nextLightIdx = this.get('nextLightIdx') % this.get('activeLights').length, - nextStrobeLight = this.get('activeLights')[nextLightIdx], - turnOnOptions = { on: true, transitiontime: 0, alert: 'select' }; - - // random light if in cololoop mode - if (this.get('colorLoopOn')) { - turnOnOptions.hue = Math.floor(Math.random() * 65535); - } - - $.ajax(this.get('apiURL') + '/lights/' + nextStrobeLight + '/state', { - data: JSON.stringify(turnOnOptions), - contentType: 'application/json', - type: 'PUT' - }); - $.ajax(this.get('apiURL') + '/lights/' + nextStrobeLight + '/state', { - data: JSON.stringify({ 'on': false, 'transitiontime': 0 }), - contentType: 'application/json', - type: 'PUT' - }); - - this.set('nextLightIdx', ++nextLightIdx); - }, - - strobeOnTxt: computed('strobeOn', function () { - return this.get('strobeOn') ? 'On' : 'Off'; - }), - - dimmerOnClass: computed('dimmerOn', function () { - return this.get('dimmerOn') ? 'dimmerOn' : null; - }), - - actions: { - toggleDimmer() { - this.sendAction('toggleDimmer'); - } - }, - - // **************** STROBE LIGHT FINISH **************** - // http://www.developers.meethue.com/documentation/color-conversions-rgb-xy - rgbToXy(red, green, blue) { - let X, Y, Z, x, y; - - // normalize - red = Number((red / 255)); - green = Number((green / 255)); - blue = Number((blue / 255)); - - // gamma correction - red = (red > 0.04045) ? Math.pow((red + 0.055) / (1.0 + 0.055), 2.4) : (red / 12.92); - green = (green > 0.04045) ? Math.pow((green + 0.055) / (1.0 + 0.055), 2.4) : (green / 12.92); - blue = (blue > 0.04045) ? Math.pow((blue + 0.055) / (1.0 + 0.055), 2.4) : (blue / 12.92); - - // RGB to XYZ - X = red * 0.664511 + green * 0.154324 + blue * 0.162028; - Y = red * 0.283881 + green * 0.668433 + blue * 0.047685; - Z = red * 0.000088 + green * 0.072310 + blue * 0.986039; - - x = X / (X + Y + Z); - y = Y / (X + Y + Z); - - return [x, y]; - }, - - xyToRgb(x, y) { - let r, g, b, X, Y = 1.0, Z; - - X = (Y / y) * x; - Z = (Y / y) * (1 - x - y); - - r = X * 1.656492 - Y * 0.354851 - Z * 0.255038; - g = X * -0.707196 + Y * 1.655397 + Z * 0.036152; - b = X * 0.051713 - Y * 0.121364 + Z * 1.011530; - - if (r > b && r > g && r > 1.0) { - // red is too big - g = g / r; - b = b / r; - r = 1.0; - } else if (g > b && g > r && g > 1.0) { - // green is too big - r = r / g; - b = b / g; - g = 1.0; - } else if (b > r && b > g && b > 1.0) { - // blue is too big - r = r / b; - g = g / b; - b = 1.0; - } - - r = (r <= 0.0031308) ? 12.92 * r : 1.055 * Math.pow(r, (1.0 / 2.4)) - 0.055; - g = (g <= 0.0031308) ? 12.92 * g : 1.055 * Math.pow(g, (1.0 / 2.4)) - 0.055; - b = (b <= 0.0031308) ? 12.92 * b : 1.055 * Math.pow(b, (1.0 / 2.4)) - 0.055; - - if (r > b && r > g) { - // red is biggest - if (r > 1.0) { - g = g / r; - b = b / r; - r = 1.0; - } - } else if (g > b && g > r) { - // green is biggest - if (g > 1.0) { - r = r / g; - b = b / g; - g = 1.0; - } - } else if (b > r && b > g) { - // blue is biggest - if (b > 1.0) { - r = r / b; - g = g / b; - b = 1.0; - } - } - - r = r * 255; - g = g * 255; - b = b * 255; - - return [r, g, b]; - } -}); diff --git a/chrome/app/pods/components/lights-tab/template.hbs b/chrome/app/pods/components/lights-tab/template.hbs deleted file mode 100644 index 8b68b7e..0000000 --- a/chrome/app/pods/components/lights-tab/template.hbs +++ /dev/null @@ -1,43 +0,0 @@ -{{#paper-list}} - {{#paper-item}} - {{paper-icon "power-settings-new" class=dimmerOnClass}} -

Power

- {{paper-switch value=lightsOn onChange=(action (mut lightsOn)) disabled=(or trial playing) skipProxy=trial label=lightsOnTxt}} - {{/paper-item}} - - {{#paper-item}} - {{paper-icon "brightness-4" class=dimmerOnClass}} -

Brightness

- {{paper-slider class="flex" step=10 min=1 max=254 value=lightsBrightness onChange=(action (mut lightsBrightness)) disabled=brightnessControlDisabled}} - {{/paper-item}} - - {{#paper-item elementId="color-row" }} - {{paper-icon "color-lens" class=dimmerOnClass}} -

Color

- - {{#paper-menu offset="0 -50" as |menu|}} - {{#menu.trigger}} - {{#paper-button iconButton=false}} - {{paper-button raised=true class="color" disabled=(or trial playing)}} - {{/paper-button}} - {{/menu.trigger}} - {{#menu.content class="color-content" width=0 as |content|}} - {{#content.menu-item}} - {{lights-tab/color-picker lightsData=lightsData activeLights=activeLights rgb=rgb}} - {{/content.menu-item}} - {{/menu.content}} - {{/paper-menu}} - {{/paper-item}} - - {{#paper-item}} - {{paper-icon "flare" class=dimmerOnClass}} -

Strobe

- {{paper-switch value=strobeOn onChange=(action (mut strobeOn)) disabled=(or trial playing) skipProxy=trial label=strobeOnTxt}} - {{/paper-item}} - - {{#paper-item}} - {{paper-icon "color-lens" class=dimmerOnClass}} {{paper-icon "loop" id="loop-addition" class=dimmerOnClass}} -

Colorloop

- {{paper-switch value=colorLoopOn onChange=(action (mut colorLoopOn)) disabled=(or trial playing) skipProxy=trial label=colorloopOnTxt}} - {{/paper-item}} -{{/paper-list}} \ No newline at end of file diff --git a/chrome/app/pods/components/music-tab/component.js b/chrome/app/pods/components/music-tab/component.js deleted file mode 100644 index b1ceadd..0000000 --- a/chrome/app/pods/components/music-tab/component.js +++ /dev/null @@ -1,289 +0,0 @@ -import Ember from 'ember'; - -const { - A, - Component, - observer, - isEmpty, - isNone, - $, - inject: { service }, - run: { later, once, next } -} = Ember; - -export default Component.extend({ - classNames: ['col-sm-10', 'col-sm-offset-1', 'col-xs-12'], - classNameBindings: ['active::hidden'], - elementId: 'music-tab', - - notify: service(), - - beatOptions: { - threshold: { - range: { min: 0, max: 0.5 }, - step: 0.01, - defaultValue: 0.3, - pips: { - mode: 'values', - values: [0, 0.25, 0.5], - density: 10, - format: { - to: function (value) { - if (value === 0) { - value = 'High'; - } else if (value === 0.25) { - value = ''; - } else { - value = 'Low'; - } - - return value; - }, - from: function (value) { return value; } - } - } - }, - hueRange: { - range: { min: 0, max: 65535 }, - step: 1, - defaultValue: 0.3, - pips: { - mode: 'values', - values: [0, 25500, 46920, 65535], - density: 10, - format: { - to: function (value) { - if (value === 0 || value === 65535) { - value = 'Red'; - } else if (value === 25500) { - value = 'Green'; - } else { - value = 'Blue'; - } - - return value; - }, - from: function (value) { return value; } - } - } - }, - brightnessRange: { - range: { min: 1, max: 254 }, - step: 1, - defaultValue: 0, - pips: { - mode: 'values', - values: [1, 63, 127, 190, 254], - density: 10, - format: { - to: function (value) { - if (value === 63) { - value = 25; - } else if (value === 127) { - value = 50; - } else if (value === 190) { - value = 75; - } else if (value === 254) { - value = 100; - } - - return value; - }, - from: function (value) { return value; } - } - } - } - }, - - threshold: 0.2, - hueRange: [0, 65535], - brightnessRange: [1, 254], - - lastLightBopIndex: 0, - - songBeatPreferences: {}, - usingBeatPreferences: false, - oldBeatPrefCache: null, - isListenining: false, - firstVisit: true, - - // noUiSlider connection specification - filledConnect: [true, false], - hueRangeConnect: [false, true, false], - - onActive: observer('active', function () { - if (this.get('active') && this.get('firstVisit')) { - chrome.storage.local.set({ firstVisit: false }); - this.set('firstVisit', false); - - next(this, () => { - $('#fancy-button-wrapper a').popover('show'); - - later(this, () => { - $('#fancy-button-wrapper a').popover('hide'); - }, 5000); - }); - } - }), - - onConfigItemChanged: observer('threshold', 'hueRange', 'brightnessRange', 'isListenining', function (_class, name) { - once(this, () => { - let value = this.get(name); - - this.set(name, value); - - if (name === 'isListenining') { - if (value) { - chrome.storage.local.get('currentlyListenining', ({currentlyListenining}) => { - if (!currentlyListenining) { - chrome.runtime.sendMessage({ action: 'start-listening' }, (response) => { - if (response && response.error) { - let message = response.error; - - if (message === 'Extension has not been invoked for the current page (see activeTab permission). Chrome pages cannot be captured.') { - message = 'Please click inside the tab you want to listen to.' - } - - this.get('notify').warning({ html: '' }); - - this.set('isListenining', false); - chrome.storage.local.set({ isListenining: false }); - } - }); - } - }); - } else { - chrome.runtime.sendMessage({ action: 'stop-listening' }); - } - - this.set('pauseLightUpdates', value); - } - - let toSave = {}; - toSave[name] = value; - chrome.storage.local.set(toSave); - }); - }), - - simulateKick() { - this.buttonBump(); - - let activeLights = this.get('activeLights'), - lightsData = this.get('lightsData'), - color = null, - stimulateLight = (light, brightness, hue) => { - let options = { 'bri': brightness }; - - if (transitiontime) { - options['transitiontime'] = 0; - } else { - options['transitiontime'] = 1; - } - - if (!isNone(hue)) { - options.hue = hue; - } - - if (lightsData[light].state.on === false) { - options.on = true; - } - - $.ajax(this.get('apiURL') + '/lights/' + light + '/state', { - data: JSON.stringify(options), - contentType: 'application/json', - type: 'PUT' - }); - }, - timeToBriOff = 100; - - if (activeLights.length > 0) { - let lastLightBopIndex = this.get('lastLightBopIndex'), - lightBopIndex, - hueRange = this.get('hueRange'), - brightnessRange = this.get('brightnessRange'), - light; - - lightBopIndex = Math.floor(Math.random() * activeLights.length); - - // let's try not to select the same light twice in a row - if (activeLights.length > 1) { - while (lightBopIndex === lastLightBopIndex) { - lightBopIndex = Math.floor(Math.random() * activeLights.length); - } - } - - light = activeLights[lightBopIndex]; - this.set('lastLightBopIndex', lightBopIndex); - - color = Math.floor(Math.random() * (hueRange[1] - hueRange[0] + 1) + hueRange[0]); - - stimulateLight(light, brightnessRange[1], color); - later(this, stimulateLight, light, brightnessRange[0], timeToBriOff); - } - - this.set('paused', true); - later(this, function () { - this.set('paused', false); - }, 200); - }, - - buttonBump() { - $('.fancy-button').velocity({ scale: 1.05 }, 100).velocity({ scale: 1 }, 100); - }, - - init() { - this._super(...arguments); - - chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { - if (request.action === 'button-bump') { - this.buttonBump(); - } - }); - - chrome.storage.local.get('threshold', ({threshold}) => { - if (!isNone(threshold)) { - this.set('threshold', threshold); - } - }); - - chrome.storage.local.get('hueRange', ({hueRange}) => { - if (!isNone(hueRange)) { - this.set('hueRange', hueRange); - } - }); - - chrome.storage.local.get('brightnessRange', ({brightnessRange}) => { - if (!isNone(brightnessRange)) { - this.set('brightnessRange', brightnessRange); - } - }); - - chrome.storage.local.get('isListenining', ({isListenining}) => { - if (!isNone(isListenining)) { - this.set('isListenining', isListenining); - } - }); - - chrome.storage.local.get('firstVisit', ({firstVisit}) => { - if (!isNone(firstVisit)) { - this.set('firstVisit', firstVisit); - } - }); - }, - - didInsertElement() { - // prevent space/text selection when the user repeatedly clicks on the center - $('#beat-container').on('mousedown', '#beat-speaker-center-inner', function (event) { - event.preventDefault(); - }); - }, - - actions: { - toggleListening() { - this.toggleProperty('isListenining'); - }, - toggleDimmer() { - this.sendAction('toggleDimmer'); - } - } -}); diff --git a/chrome/app/pods/components/music-tab/template.hbs b/chrome/app/pods/components/music-tab/template.hbs deleted file mode 100644 index ac09596..0000000 --- a/chrome/app/pods/components/music-tab/template.hbs +++ /dev/null @@ -1,45 +0,0 @@ -
-
- {{if isListenining "Stop" "Start"}} Listening -
- - - -
- -
-
-
-
- - Hue Range - - - {{range-slider start=hueRange orientation="vertical" step=beatOptions.hueRange.step range=beatOptions.hueRange.range connect=hueRangeConnect - on-change=(action (mut hueRange)) pips=beatOptions.hueRange.pips}} -
- -
- - Brightness Range - - - {{range-slider start=brightnessRange orientation="vertical" step=beatOptions.brightnessRange.step range=beatOptions.brightnessRange.range - on-change=(action (mut brightnessRange)) pips=beatOptions.brightnessRange.pips}} -
- -
- - Sensitivity - - - {{range-slider start=threshold orientation="vertical" step=beatOptions.threshold.step range=beatOptions.threshold.range on-change=(action - (mut threshold)) pips=beatOptions.threshold.pips}} -
-
-
-
\ No newline at end of file diff --git a/chrome/app/resolver.js b/chrome/app/resolver.js deleted file mode 100644 index 2fb563d..0000000 --- a/chrome/app/resolver.js +++ /dev/null @@ -1,3 +0,0 @@ -import Resolver from 'ember-resolver'; - -export default Resolver; diff --git a/chrome/app/router.js b/chrome/app/router.js deleted file mode 100644 index cdc2578..0000000 --- a/chrome/app/router.js +++ /dev/null @@ -1,12 +0,0 @@ -import Ember from 'ember'; -import config from './config/environment'; - -const Router = Ember.Router.extend({ - location: config.locationType, - rootURL: config.rootURL -}); - -Router.map(function() { -}); - -export default Router; diff --git a/chrome/app/styles/app.scss b/chrome/app/styles/app.scss deleted file mode 100644 index a3a9e70..0000000 --- a/chrome/app/styles/app.scss +++ /dev/null @@ -1,60 +0,0 @@ -@import 'ember-modal-dialog/ember-modal-structure'; -@import 'ember-modal-dialog/ember-modal-appearance'; - -@import 'huegasm-variables'; - -@import 'bootstrap'; // used to take out bootstrap scss modules that we don't need -@import 'paper'; - -@import 'bridge-finder'; -@import 'common'; -@import 'dimmer'; -@import 'hue-controls'; -@import 'light-group'; -@import 'music-tab'; -@import 'noui-slider'; - -body { - min-width: 500px; - font-size: 13px; -} - -body > .ember-view { - display: flex; - flex-direction: column; -} - -body, button { - font-family: 'Raleway', sans-serif; -} - -.ember-app { - padding-bottom: 50px; -} - -.alert { - margin-bottom: 0; - border: none; -} - -button.md-warn { - background: $secondaryThemeColor; -} - -div.ember-modal-dialog { - padding: 20px; - color: $blackish; - md-input-container { - width: 100%; - input.md-input[type="text"] { - color: $blackish !important; - } - } - md-input-container label { - color: rgba(0, 0, 0, 0.26); - } -} - -.display-flex { - display: flex !important; -} diff --git a/chrome/app/styles/bootstrap.scss b/chrome/app/styles/bootstrap.scss deleted file mode 100644 index 75d3fa7..0000000 --- a/chrome/app/styles/bootstrap.scss +++ /dev/null @@ -1,56 +0,0 @@ -/*! - * Bootstrap v3.3.7 (http://getbootstrap.com) - * Copyright 2011-2016 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - */ - -// Core variables and mixins -@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/variables"; -@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/mixins"; - -// Reset and dependencies -@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/normalize"; -//@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/print"; -@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/glyphicons"; - -// Core CSS -@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/scaffolding"; -@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/type"; -//@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/code"; -@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/grid"; -//@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/tables"; -@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/forms"; -@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/buttons"; - -// Components -//@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/component-animations"; -@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/dropdowns"; -//@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/button-groups"; -@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/input-groups"; -//@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/navs"; -//@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/navbar"; -//@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/breadcrumbs"; -//@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/pagination"; -//@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/pager"; -//@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/labels"; -//@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/badges"; -//@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/jumbotron"; -//@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/thumbnails"; -@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/alerts"; -//@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/progress-bars"; -//@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/media"; -//@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/list-group"; -//@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/panels"; -//@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/responsive-embed"; -//@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/wells"; -//@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/close"; - -// Components w/ JavaScript -//@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/modals"; -@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/tooltip"; -@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/popovers"; -//@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/carousel"; - -// Utility classes -@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/utilities"; -@import "bower_components/bootstrap-sass/assets/stylesheets/bootstrap/responsive-utilities"; diff --git a/chrome/app/styles/bridge-finder.scss b/chrome/app/styles/bridge-finder.scss deleted file mode 100644 index eb0f907..0000000 --- a/chrome/app/styles/bridge-finder.scss +++ /dev/null @@ -1,28 +0,0 @@ -#press-bridge-button-img { - width: 200px; - margin: 0 auto 30px auto; - display: inherit; -} - -#bridge-button-group { - width: 150px; - margin: 30px auto; - text-align: left; -} - -#bridge-input md-input-container{ - max-width: 200px; - margin: 30px auto 20px; -} - -#bridge-finder { - text-align: center; - padding: 20px; - font-size: 16px; - flex-direction: column; - display: flex; - justify-content: center; - .md-bar { - background-color: $secondaryThemeColor !important; - } -} \ No newline at end of file diff --git a/chrome/app/styles/common.scss b/chrome/app/styles/common.scss deleted file mode 100644 index db7ef0f..0000000 --- a/chrome/app/styles/common.scss +++ /dev/null @@ -1,15 +0,0 @@ -.text-left { - text-align: left !important; -} - -.relative { - position: relative !important; -} - -.no-text-decoration { - text-decoration: none !important; -} - -.pointer { - cursor: pointer; -} \ No newline at end of file diff --git a/chrome/app/styles/dimmer.scss b/chrome/app/styles/dimmer.scss deleted file mode 100644 index 1add9b1..0000000 --- a/chrome/app/styles/dimmer.scss +++ /dev/null @@ -1,86 +0,0 @@ -div.dimmerOn { - color: $whitish !important; - background: $blackish !important; -} - -html.dimmerOn { - color: white; - background: $blackish; -} - -body.dimmerOn { - color: $whitish; - background: $blackish; - md-input-container { - label { - color: #3f51b5 !important; - } - .md-input { - color: $whitish !important; - border-color: #3f51b5 !important; - } - } - .md-track { - background: $whitish; - } - .color { - border: 1px solid white; - } - .playlist-item, .ember-basic-dropdown-content md-menu-content { - color: $whitish; - background-color: $dimmerOnButtonColor; - } - .ember-basic-dropdown-content a { - color: $whitish; - } - .playlist-item { - &.active { - background: darken($dimmerOnButtonColor, 15%) !important; - } - &:hover { - background: darken($dimmerOnButtonColor, 10%); - } - .audio-remove-button .paper-icon { - color: $whitish !important; - &:hover { - color: white !important; - } - } - } - - .light-inactive::before { - display: none; - } - - .hue-light { - -webkit-filter: drop-shadow(0 0 5px #228DFF); - fill: $whitish; - path { - fill: $whitish; - } - } - - .md-container { - color: $whitish; - } - .add-new-music:hover { - background: darken($dimmerOnButtonColor, 5%); - } - .md-bar { - background-color: darken(white, 60%) !important; - } -} - -.paper-icon.dimmerOn { - text-shadow: $glowingText; - opacity: 0.9 !important; -} - -.logo { - display: inline-block; - cursor: pointer; - width: 40px; - height: 40px; - background: url(images/huegasm.png) center center no-repeat; - background-size: 40px 40px; -} \ No newline at end of file diff --git a/chrome/app/styles/hue-controls.scss b/chrome/app/styles/hue-controls.scss deleted file mode 100644 index 4ab290f..0000000 --- a/chrome/app/styles/hue-controls.scss +++ /dev/null @@ -1,100 +0,0 @@ -#lights-tab { - padding: 0; - .paper-icon { - line-height: 0.8 !important; - } -} - -.lights-control-tooltip + .tooltip { - left: 0 !important; -} - -#color-row { - cursor: pointer; - .md-list-item-inner { - padding-right: 0; - } -} - -#hue-controls { - max-width: 1200px; - md-progress-circular { - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - } -} - -#navigation { - padding: 5px 0 1vh; - text-align: center; - margin: auto; - position: relative; - .ember-basic-dropdown-trigger { - z-index: 3; - text-align: right; - position: absolute; - top: -10px; - right: -10px; - transform: scale(1.1); - } -} - -.navigation-item { - font-size: 18px; - padding: 0 10px 0 10px; - &.active { - font-weight: bold; - cursor: default; - text-decoration: none !important; - } - &:hover { - text-decoration: underline; - } -} - -.color { - border: 1px solid rgba(0, 0, 0, 0.5); -} - -#color-picker { - padding: 5px; - background: rgba(0, 0, 0, 0.7); - box-shadow: 5px 10px 15px 5px rgba(0, 0, 0, 0.3); - color: #FFFFFF; - position: absolute; - width: 266px; - height: 266px; - right: 6px; - top: -9px; - z-index: 3; -} - -.color-content { - box-shadow: none !important; - md-menu-content, md-menu-item { - background-color: transparent !important; - } -} - -#picker { - cursor: crosshair; -} - -#loop-addition { - position: absolute; - left: 33px; - top: 15px; - font-size: 16px !important; -} - - -@media(min-width:767px) { - #lights-tab { - font-size: 18px; - .paper-icon { - font-size: 24px; - } - } -} diff --git a/chrome/app/styles/huegasm-variables.scss b/chrome/app/styles/huegasm-variables.scss deleted file mode 100644 index 914abb3..0000000 --- a/chrome/app/styles/huegasm-variables.scss +++ /dev/null @@ -1,8 +0,0 @@ -$playerHeight: 400px; -$playerDefaultIconColor: #BBBBBB; -$secondaryThemeColor: #F12B24; -$glowingText: 0 0 2px #fff, 0 0 4px #fff, 0 0 20px #228DFF; -$dimmerOnButtonColor: #404040; -$blackish: #242424; -$whitish: #e0e0e0; -$paperThemeColor: #3f51b5; diff --git a/chrome/app/styles/light-group.scss b/chrome/app/styles/light-group.scss deleted file mode 100644 index e906e3b..0000000 --- a/chrome/app/styles/light-group.scss +++ /dev/null @@ -1,74 +0,0 @@ -.light-group { - max-width: 800px; - margin: 5px auto; - display: flex; - justify-content: center; - flex-wrap: wrap; - .tooltip.top { - margin-top: 1px; - margin-left: 2px; - } -} - -.hue-light { - width: 35px; -} - -.toggleable-light { - cursor: pointer; - position: relative; - border-radius: 30%; - border: 2px solid $whitish; - margin: 0 2px; - display: flex; - height: 50px; - align-items: center; - justify-content: center; - padding: 3px; -} - -.light-inactive { - border-color: rgba($secondaryThemeColor, 0.4); -} - -.light-inactive::before { - font-weight: bold; - position: absolute; - top: -5px; - content: "\e014"; - font-family: 'Glyphicons Halflings'; - font-size: 40px; - color: rgba($secondaryThemeColor, 0.6); -} - -.light-active { - border-color: rgba(green, 0.4); - .hue-light { - transition-duration: 0.3s; - transition-property: transform; - box-shadow: 0 0 1px rgba(0, 0, 0, 0); - } - .hue-light:hover { - transform: scale(1.2); - } -} - -.ember-modal-overlay.translucent { - background-color: rgba(0, 0, 0, 0.50); -} - -.remove-button { - margin: 10px 0 10px 60px; -} - -.light-text { - padding: 0 7px; -} - -.light-text-content { - display: block; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - max-width: 100px; -} \ No newline at end of file diff --git a/chrome/app/styles/music-tab.scss b/chrome/app/styles/music-tab.scss deleted file mode 100644 index a2756c6..0000000 --- a/chrome/app/styles/music-tab.scss +++ /dev/null @@ -1,135 +0,0 @@ -.row { - margin: 0; -} - -#music-tab { - padding: 0; - margin-top: 5px; -} - -#beat-area { - position: relative; -} - -#beat-option-button-group { - margin: 20px 0 10px 0; -} - -.beat-option { - padding: 10px 0; - text-align: center; - md-checkbox { - padding: 10px 0; - } - md-switch { - margin: 0; - } - .option-description { - display: inline-flex; - font-size: 16px; - justify-content: center; - flex-direction: column; - padding: 5px 0; - } - button { - margin-top: 0; - } - .tooltip { - margin: 0; - display: inline-block !important; - } -} - -#start-listening { - margin-bottom: 5px; - font-size: 18px; -} - -#fancy-button-wrapper { - display: flex; - justify-content: center; - align-items: center; - flex-direction: column; -} - -.fancy-button { - border-radius: 50%; - box-shadow: 0 2px 10px 2px rgba(0, 0, 0, .3), inset 0 4px 1px 1px white, inset 0 -3px 1px 1px rgba(204,198,197,.5); - float:left; - height: 90px; - position: relative; - width: 90px; - transition: all .1s linear; - &:after { - color:rgba(255, 0, 0, 0); - content: ""; - display: block; - font-size: 55px; - height: 30px; - text-decoration: none; - text-shadow: 0px -1px 1px #bdb5b4, 1px 1px 1px white; - position: absolute; - width: 30px; - } - &:hover { - background-image: -webkit-linear-gradient(top, #fff, #f4f1ee); - background-image: linear-gradient(top, #fff, #f4f1ee); - color:#0088cc; - } - &:active { - background-image: -webkit-linear-gradient(top, #efedec, #f7f4f4); - background-image: linear-gradient(top, #efedec, #f7f4f4); - box-shadow: 0 3px 5px 0 rgba(0,0,0,.4), inset 0px -3px 1px 1px rgba(204,198,197,.5); - &:after{ - color:#dbd2d2; - text-shadow: 0px -1px 1px #bdb5b4, 0px 1px 1px white; - } - } -} - -.note { - &.active:after { - color: $secondaryThemeColor; - } - &:after{ - content: "♪"; - left: 32px; - top: 5px; - } - &:hover:after { - color: $secondaryThemeColor; - text-shadow: 0px 0px 6px $secondaryThemeColor; - } -} - -@media(min-width:767px) and (max-width:1200px) { - #play-list-controls .paper-button { - border: 1px solid $whitish; - border-radius: 5px; - } -} - -// mobile overrides -@media(max-width:767px) { - div#player-bottom { - display: block !important; - } - #beat-area { - height: initial; - } - #seek-slider { - height: 8px; - .noUi-handle { - opacity: 1 !important; - } - } - #seek-slider { - margin-bottom: 15px; - } - .close { - display: block; - } - md-checkbox { - padding-right: 20px !important; - } -} diff --git a/chrome/app/styles/noui-slider.scss b/chrome/app/styles/noui-slider.scss deleted file mode 100644 index ac9f2e2..0000000 --- a/chrome/app/styles/noui-slider.scss +++ /dev/null @@ -1,56 +0,0 @@ -.noUi-value-vertical { - margin-top: -10px; - transform: none; -} - -.noUi-value-vertical, .noUi-pips { - color: inherit !important; -} - -.noUi-vertical .noUi-handle { - border: 1px solid #A3A0A0; - width: 26px; -} - -.noUi-vertical .noUi-handle:after, .noUi-vertical .noUi-handle:before{ - background: grey; -} - -.noUi-base { - cursor: pointer; -} - -.noUi-connect { - background-color: $secondaryThemeColor; -} - -.noUi-handle { - cursor: pointer; -} - -.noUi-horizontal .noUi-handle { - width: 0.4em; - height: 1.3em; - left: -0.071em; - top: -0.550em; - transition-duration: 0.1s; - background: $playerDefaultIconColor !important; -} - -.noUi-horizontal .noUi-handle:hover { - background: white !important; -} - -.noUi-target { - margin: 0 auto; -} - -.noUi-base { - background-color: #ADADAD; - border: 1px solid #797979; -} - -.noUi-vertical { - height: 180px; - margin: 15px auto 10px; -} diff --git a/chrome/app/styles/paper.scss b/chrome/app/styles/paper.scss deleted file mode 100644 index 0c39535..0000000 --- a/chrome/app/styles/paper.scss +++ /dev/null @@ -1,73 +0,0 @@ -@import 'ember-paper'; - -.paper-icon { - cursor: pointer; -} - -md-checkbox .md-icon, .md-off, .md-on { - border-color: inherit !important; -} - -md-checkbox.md-default-theme.md-checked .md-icon { - background: $secondaryThemeColor; -} - -md-checkbox .md-label { - width: 125px; - text-align: left; -} - -.md-button { - font-size: 13px; - flex-direction: unset; - span { - width: 100%; - } -} - -md-switch[disabled=disabled], md-switch[disabled=disabled] .md-container, md-slider[disabled=disabled] { - cursor: not-allowed; -} - -md-progress-circular { - margin: 0 auto 20px auto !important; -} - -md-progress-linear { - margin-bottom: 50px !important; -} - -md-slider { - cursor: pointer; -} - -.md-thumb-text { - user-select: none; -} - -md-slider.md-default-theme .md-thumb:after { - border-color: $secondaryThemeColor; - background-color: $secondaryThemeColor; -} - -md-icon { - color: rgba(0, 0, 0, 0.54) !important; -} - -md-switch.md-default-theme.md-checked .md-thumb { - background-color: $secondaryThemeColor; -} - -.ember-basic-dropdown-trigger { - outline: none !important; -} - -md-list-item { - margin-bottom: 2vh; -} - -@media(max-width:500px) { - #save-beat-preferences-star { - right: 5px; - } -} diff --git a/chrome/bower.json b/chrome/bower.json deleted file mode 100644 index dee4aba..0000000 --- a/chrome/bower.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "huegasm", - "dependencies": { - "bootstrap-sass": "^3.3.5", - "hammer.js": "^2.0.8", - "matchMedia": "^0.3.0", - "velocity": "^1.3.1" - } -} \ No newline at end of file diff --git a/chrome/config/environment.js b/chrome/config/environment.js deleted file mode 100644 index a683d19..0000000 --- a/chrome/config/environment.js +++ /dev/null @@ -1,47 +0,0 @@ -/* jshint node: true */ - -module.exports = function (environment) { - var ENV = { - modulePrefix: 'huegasm', - podModulePrefix: 'huegasm/pods', - environment: environment, - rootURL: '', - locationType: 'hash', - EmberENV: { - FEATURES: { - // Here you can enable experimental features on an ember canary build - // e.g. 'with-controller': true - } - }, - - APP: { - // Here you can pass flags/options to your application instance - // when it is created - } - }; - - if (environment === 'development') { - // ENV.APP.LOG_RESOLVER = true; - // ENV.APP.LOG_ACTIVE_GENERATION = true; - // ENV.APP.LOG_TRANSITIONS = true; - // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; - // ENV.APP.LOG_VIEW_LOOKUPS = true; - } - - if (environment === 'test') { - // Testem prefers this... - ENV.locationType = 'none'; - - // keep test console output quieter - ENV.APP.LOG_ACTIVE_GENERATION = false; - ENV.APP.LOG_VIEW_LOOKUPS = false; - - ENV.APP.rootElement = '#ember-testing'; - } - - if (environment === 'production') { - - } - - return ENV; -}; diff --git a/chrome/ember-cli-build.js b/chrome/ember-cli-build.js deleted file mode 100644 index 81bceda..0000000 --- a/chrome/ember-cli-build.js +++ /dev/null @@ -1,22 +0,0 @@ -/* global require, module */ -var EmberApp = require('ember-cli/lib/broccoli/ember-app'); -var Funnel = require('broccoli-funnel'); - -module.exports = function (defaults) { - var app = new EmberApp(defaults, { - fingerprint: { - enabled: false - } - }); - var extraAssets = new Funnel('bower_components/bootstrap-sass/assets/fonts/bootstrap/', { - srcDir: '/', - include: ['**'], - destDir: '/fonts/bootstrap' - }); - - app.import('bower_components/bootstrap-sass/assets/javascripts/bootstrap/tooltip.js'); - app.import('bower_components/bootstrap-sass/assets/javascripts/bootstrap/popover.js'); - app.import('bower_components/velocity/velocity.js'); - - return app.toTree(extraAssets); -}; diff --git a/chrome/package.json b/chrome/package.json deleted file mode 100644 index e11a683..0000000 --- a/chrome/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "huegasm", - "version": "1.0.0", - "description": "Huegasm is a free web application for managing and synchronizing your Philips Hue lights with the beat of your music.", - "private": true, - "directories": { - "doc": "doc", - "test": "tests" - }, - "scripts": { - "start": "ember server --live-reload=false", - "build": "ember build --env=production" - }, - "engines": { - "node": "6" - }, - "author": "Egor Philippov", - "devDependencies": { - "broccoli-asset-rev": "^2.2.0", - "ember-cli": "^2.8.0", - "ember-cli-app-version": "^3.0.0", - "ember-cli-babel": "^6.0.0", - "ember-cli-dependency-checker": "^1.2.0", - "ember-cli-htmlbars": "^1.0.1", - "ember-cli-htmlbars-inline-precompile": "^0.4.0", - "ember-cli-inject-live-reload": "^1.3.1", - "ember-cli-nouislider": "^0.13.0", - "ember-cli-release": "^1.0.0-beta.2", - "ember-cli-sass": "^6.0.0", - "ember-cli-shims": "^1.0.2", - "ember-cli-sri": "^2.1.0", - "ember-cli-uglify": "^1.2.0", - "ember-export-application-global": "^2.0.0", - "ember-inline-svg": "^0.1.7", - "ember-load-initializers": "^1.0.0", - "ember-modal-dialog": "^1.0.0", - "ember-notify": "^5.0.4", - "ember-paper": "^1.0.0-alpha.19", - "ember-resolver": "^4.0.0", - "ember-source": "^2.11.0", - "ember-truth-helpers": "^1.2.0", - "loader.js": "^4.0.7" - } -} diff --git a/chrome/public/128x128.png b/chrome/public/128x128.png deleted file mode 100644 index 33ec2e7..0000000 Binary files a/chrome/public/128x128.png and /dev/null differ diff --git a/chrome/public/16x16.png b/chrome/public/16x16.png deleted file mode 100644 index 9e5a2e4..0000000 Binary files a/chrome/public/16x16.png and /dev/null differ diff --git a/chrome/public/32x32.png b/chrome/public/32x32.png deleted file mode 100644 index 14dbea8..0000000 Binary files a/chrome/public/32x32.png and /dev/null differ diff --git a/chrome/public/48x48.png b/chrome/public/48x48.png deleted file mode 100644 index 8c41674..0000000 Binary files a/chrome/public/48x48.png and /dev/null differ diff --git a/chrome/public/assets/images/colormap.png b/chrome/public/assets/images/colormap.png deleted file mode 100644 index 53c80ef..0000000 Binary files a/chrome/public/assets/images/colormap.png and /dev/null differ diff --git a/chrome/public/assets/images/huegasm.png b/chrome/public/assets/images/huegasm.png deleted file mode 100644 index 6490342..0000000 Binary files a/chrome/public/assets/images/huegasm.png and /dev/null differ diff --git a/chrome/public/assets/images/lights/filled/aura.svg b/chrome/public/assets/images/lights/filled/aura.svg deleted file mode 100644 index c047da6..0000000 --- a/chrome/public/assets/images/lights/filled/aura.svg +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - diff --git a/chrome/public/assets/images/lights/filled/beyond_ceiling_pendant_table.svg b/chrome/public/assets/images/lights/filled/beyond_ceiling_pendant_table.svg deleted file mode 100644 index 2588b6c..0000000 --- a/chrome/public/assets/images/lights/filled/beyond_ceiling_pendant_table.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - diff --git a/chrome/public/assets/images/lights/filled/bloom.svg b/chrome/public/assets/images/lights/filled/bloom.svg deleted file mode 100644 index 9765cd8..0000000 --- a/chrome/public/assets/images/lights/filled/bloom.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - diff --git a/chrome/public/assets/images/lights/filled/br30.svg b/chrome/public/assets/images/lights/filled/br30.svg deleted file mode 100644 index e474676..0000000 --- a/chrome/public/assets/images/lights/filled/br30.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - diff --git a/chrome/public/assets/images/lights/filled/br30_slim.svg b/chrome/public/assets/images/lights/filled/br30_slim.svg deleted file mode 100644 index 56ec0a2..0000000 --- a/chrome/public/assets/images/lights/filled/br30_slim.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - diff --git a/chrome/public/assets/images/lights/filled/bridge_v1.svg b/chrome/public/assets/images/lights/filled/bridge_v1.svg deleted file mode 100644 index caa67bf..0000000 --- a/chrome/public/assets/images/lights/filled/bridge_v1.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - diff --git a/chrome/public/assets/images/lights/filled/bridge_v2.svg b/chrome/public/assets/images/lights/filled/bridge_v2.svg deleted file mode 100644 index f84f750..0000000 --- a/chrome/public/assets/images/lights/filled/bridge_v2.svg +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - diff --git a/chrome/public/assets/images/lights/filled/ceiling_round.svg b/chrome/public/assets/images/lights/filled/ceiling_round.svg deleted file mode 100644 index fa3f8e1..0000000 --- a/chrome/public/assets/images/lights/filled/ceiling_round.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - diff --git a/chrome/public/assets/images/lights/filled/ceiling_square.svg b/chrome/public/assets/images/lights/filled/ceiling_square.svg deleted file mode 100644 index 10b5080..0000000 --- a/chrome/public/assets/images/lights/filled/ceiling_square.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - diff --git a/chrome/public/assets/images/lights/filled/entity.svg b/chrome/public/assets/images/lights/filled/entity.svg deleted file mode 100644 index 8754d90..0000000 --- a/chrome/public/assets/images/lights/filled/entity.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - diff --git a/chrome/public/assets/images/lights/filled/floor.svg b/chrome/public/assets/images/lights/filled/floor.svg deleted file mode 100644 index 77404d2..0000000 --- a/chrome/public/assets/images/lights/filled/floor.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - diff --git a/chrome/public/assets/images/lights/filled/go.svg b/chrome/public/assets/images/lights/filled/go.svg deleted file mode 100644 index e1b78ec..0000000 --- a/chrome/public/assets/images/lights/filled/go.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/chrome/public/assets/images/lights/filled/gu10.svg b/chrome/public/assets/images/lights/filled/gu10.svg deleted file mode 100644 index 3efa6dc..0000000 --- a/chrome/public/assets/images/lights/filled/gu10.svg +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - diff --git a/chrome/public/assets/images/lights/filled/gu10_perfectfit.svg b/chrome/public/assets/images/lights/filled/gu10_perfectfit.svg deleted file mode 100644 index a40f2d4..0000000 --- a/chrome/public/assets/images/lights/filled/gu10_perfectfit.svg +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - diff --git a/chrome/public/assets/images/lights/filled/hds.svg b/chrome/public/assets/images/lights/filled/hds.svg deleted file mode 100644 index 56c191a..0000000 --- a/chrome/public/assets/images/lights/filled/hds.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - diff --git a/chrome/public/assets/images/lights/filled/impulse.svg b/chrome/public/assets/images/lights/filled/impulse.svg deleted file mode 100644 index 636e36a..0000000 --- a/chrome/public/assets/images/lights/filled/impulse.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - diff --git a/chrome/public/assets/images/lights/filled/iris.svg b/chrome/public/assets/images/lights/filled/iris.svg deleted file mode 100644 index 82d2b54..0000000 --- a/chrome/public/assets/images/lights/filled/iris.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - diff --git a/chrome/public/assets/images/lights/filled/lightstrip.svg b/chrome/public/assets/images/lights/filled/lightstrip.svg deleted file mode 100644 index 146bac0..0000000 --- a/chrome/public/assets/images/lights/filled/lightstrip.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - diff --git a/chrome/public/assets/images/lights/filled/motion_sensor.svg b/chrome/public/assets/images/lights/filled/motion_sensor.svg deleted file mode 100644 index ca6ceca..0000000 --- a/chrome/public/assets/images/lights/filled/motion_sensor.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - diff --git a/chrome/public/assets/images/lights/filled/pendant_oval.svg b/chrome/public/assets/images/lights/filled/pendant_oval.svg deleted file mode 100644 index 3e1dfdd..0000000 --- a/chrome/public/assets/images/lights/filled/pendant_oval.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - diff --git a/chrome/public/assets/images/lights/filled/pendant_round.svg b/chrome/public/assets/images/lights/filled/pendant_round.svg deleted file mode 100644 index c98f454..0000000 --- a/chrome/public/assets/images/lights/filled/pendant_round.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - diff --git a/chrome/public/assets/images/lights/filled/pendant_square.svg b/chrome/public/assets/images/lights/filled/pendant_square.svg deleted file mode 100644 index 96b65c1..0000000 --- a/chrome/public/assets/images/lights/filled/pendant_square.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - diff --git a/chrome/public/assets/images/lights/filled/phoenix_ceiling.svg b/chrome/public/assets/images/lights/filled/phoenix_ceiling.svg deleted file mode 100644 index 2a581d4..0000000 --- a/chrome/public/assets/images/lights/filled/phoenix_ceiling.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - diff --git a/chrome/public/assets/images/lights/filled/phoenix_down.svg b/chrome/public/assets/images/lights/filled/phoenix_down.svg deleted file mode 100644 index fe056be..0000000 --- a/chrome/public/assets/images/lights/filled/phoenix_down.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - diff --git a/chrome/public/assets/images/lights/filled/recessed.svg b/chrome/public/assets/images/lights/filled/recessed.svg deleted file mode 100644 index a39c14a..0000000 --- a/chrome/public/assets/images/lights/filled/recessed.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - diff --git a/chrome/public/assets/images/lights/filled/storylight.svg b/chrome/public/assets/images/lights/filled/storylight.svg deleted file mode 100644 index dcb1bb7..0000000 --- a/chrome/public/assets/images/lights/filled/storylight.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - diff --git a/chrome/public/assets/images/lights/filled/table.svg b/chrome/public/assets/images/lights/filled/table.svg deleted file mode 100644 index c2dedb5..0000000 --- a/chrome/public/assets/images/lights/filled/table.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - diff --git a/chrome/public/assets/images/lights/filled/tap.svg b/chrome/public/assets/images/lights/filled/tap.svg deleted file mode 100644 index 7987991..0000000 --- a/chrome/public/assets/images/lights/filled/tap.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - diff --git a/chrome/public/assets/images/lights/filled/white_and_color_e27.svg b/chrome/public/assets/images/lights/filled/white_and_color_e27.svg deleted file mode 100644 index c304a62..0000000 --- a/chrome/public/assets/images/lights/filled/white_and_color_e27.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - diff --git a/chrome/public/assets/images/lights/filled/white_e27.svg b/chrome/public/assets/images/lights/filled/white_e27.svg deleted file mode 100644 index 79981c9..0000000 --- a/chrome/public/assets/images/lights/filled/white_e27.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/chrome/public/assets/images/lights/outline/aura.svg b/chrome/public/assets/images/lights/outline/aura.svg deleted file mode 100644 index 194eeb5..0000000 --- a/chrome/public/assets/images/lights/outline/aura.svg +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - diff --git a/chrome/public/assets/images/lights/outline/beyond_ceiling_pendant_table.svg b/chrome/public/assets/images/lights/outline/beyond_ceiling_pendant_table.svg deleted file mode 100644 index 0e59f05..0000000 --- a/chrome/public/assets/images/lights/outline/beyond_ceiling_pendant_table.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - diff --git a/chrome/public/assets/images/lights/outline/bloom.svg b/chrome/public/assets/images/lights/outline/bloom.svg deleted file mode 100644 index 9b68bbe..0000000 --- a/chrome/public/assets/images/lights/outline/bloom.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - diff --git a/chrome/public/assets/images/lights/outline/br30.svg b/chrome/public/assets/images/lights/outline/br30.svg deleted file mode 100644 index 24fa52c..0000000 --- a/chrome/public/assets/images/lights/outline/br30.svg +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/chrome/public/assets/images/lights/outline/br30_slim.svg b/chrome/public/assets/images/lights/outline/br30_slim.svg deleted file mode 100644 index f11d2bb..0000000 --- a/chrome/public/assets/images/lights/outline/br30_slim.svg +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/chrome/public/assets/images/lights/outline/bridge_v1.svg b/chrome/public/assets/images/lights/outline/bridge_v1.svg deleted file mode 100644 index 28336bb..0000000 --- a/chrome/public/assets/images/lights/outline/bridge_v1.svg +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/chrome/public/assets/images/lights/outline/bridge_v2.svg b/chrome/public/assets/images/lights/outline/bridge_v2.svg deleted file mode 100644 index 2ae2dbb..0000000 --- a/chrome/public/assets/images/lights/outline/bridge_v2.svg +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/chrome/public/assets/images/lights/outline/ceiling_round.svg b/chrome/public/assets/images/lights/outline/ceiling_round.svg deleted file mode 100644 index 5fe0917..0000000 --- a/chrome/public/assets/images/lights/outline/ceiling_round.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - diff --git a/chrome/public/assets/images/lights/outline/ceiling_square.svg b/chrome/public/assets/images/lights/outline/ceiling_square.svg deleted file mode 100644 index 0e4ed1a..0000000 --- a/chrome/public/assets/images/lights/outline/ceiling_square.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - diff --git a/chrome/public/assets/images/lights/outline/entity.svg b/chrome/public/assets/images/lights/outline/entity.svg deleted file mode 100644 index 32f96d0..0000000 --- a/chrome/public/assets/images/lights/outline/entity.svg +++ /dev/null @@ -1,1515 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/chrome/public/assets/images/lights/outline/floor.svg b/chrome/public/assets/images/lights/outline/floor.svg deleted file mode 100644 index b6c6264..0000000 --- a/chrome/public/assets/images/lights/outline/floor.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - diff --git a/chrome/public/assets/images/lights/outline/go.svg b/chrome/public/assets/images/lights/outline/go.svg deleted file mode 100644 index 8a6da13..0000000 --- a/chrome/public/assets/images/lights/outline/go.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - diff --git a/chrome/public/assets/images/lights/outline/gu10.svg b/chrome/public/assets/images/lights/outline/gu10.svg deleted file mode 100644 index 6572d73..0000000 --- a/chrome/public/assets/images/lights/outline/gu10.svg +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/chrome/public/assets/images/lights/outline/gu10_perfectfit.svg b/chrome/public/assets/images/lights/outline/gu10_perfectfit.svg deleted file mode 100644 index bbdef6b..0000000 --- a/chrome/public/assets/images/lights/outline/gu10_perfectfit.svg +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/chrome/public/assets/images/lights/outline/hds.svg b/chrome/public/assets/images/lights/outline/hds.svg deleted file mode 100644 index a299e1b..0000000 --- a/chrome/public/assets/images/lights/outline/hds.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - diff --git a/chrome/public/assets/images/lights/outline/impulse.svg b/chrome/public/assets/images/lights/outline/impulse.svg deleted file mode 100644 index 0067f41..0000000 --- a/chrome/public/assets/images/lights/outline/impulse.svg +++ /dev/null @@ -1,413 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/chrome/public/assets/images/lights/outline/iris.svg b/chrome/public/assets/images/lights/outline/iris.svg deleted file mode 100644 index cca3b83..0000000 --- a/chrome/public/assets/images/lights/outline/iris.svg +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - diff --git a/chrome/public/assets/images/lights/outline/lightstrip.svg b/chrome/public/assets/images/lights/outline/lightstrip.svg deleted file mode 100644 index 91c2b70..0000000 --- a/chrome/public/assets/images/lights/outline/lightstrip.svg +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/chrome/public/assets/images/lights/outline/motion_sensor.svg b/chrome/public/assets/images/lights/outline/motion_sensor.svg deleted file mode 100644 index 4a18813..0000000 --- a/chrome/public/assets/images/lights/outline/motion_sensor.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - diff --git a/chrome/public/assets/images/lights/outline/par16.svg b/chrome/public/assets/images/lights/outline/par16.svg deleted file mode 100644 index a2b7f75..0000000 --- a/chrome/public/assets/images/lights/outline/par16.svg +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/chrome/public/assets/images/lights/outline/pendant_oval.svg b/chrome/public/assets/images/lights/outline/pendant_oval.svg deleted file mode 100644 index ba4a4fa..0000000 --- a/chrome/public/assets/images/lights/outline/pendant_oval.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - diff --git a/chrome/public/assets/images/lights/outline/pendant_round.svg b/chrome/public/assets/images/lights/outline/pendant_round.svg deleted file mode 100644 index 93afd31..0000000 --- a/chrome/public/assets/images/lights/outline/pendant_round.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - diff --git a/chrome/public/assets/images/lights/outline/pendant_square.svg b/chrome/public/assets/images/lights/outline/pendant_square.svg deleted file mode 100644 index 4bcedfc..0000000 --- a/chrome/public/assets/images/lights/outline/pendant_square.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - diff --git a/chrome/public/assets/images/lights/outline/phoenix_ceiling.svg b/chrome/public/assets/images/lights/outline/phoenix_ceiling.svg deleted file mode 100644 index e0a5978..0000000 --- a/chrome/public/assets/images/lights/outline/phoenix_ceiling.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - diff --git a/chrome/public/assets/images/lights/outline/phoenix_ceiling_2.svg b/chrome/public/assets/images/lights/outline/phoenix_ceiling_2.svg deleted file mode 100644 index 0565771..0000000 --- a/chrome/public/assets/images/lights/outline/phoenix_ceiling_2.svg +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/chrome/public/assets/images/lights/outline/phoenix_down.svg b/chrome/public/assets/images/lights/outline/phoenix_down.svg deleted file mode 100644 index b5799b9..0000000 --- a/chrome/public/assets/images/lights/outline/phoenix_down.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - diff --git a/chrome/public/assets/images/lights/outline/phoenix_pendant.svg b/chrome/public/assets/images/lights/outline/phoenix_pendant.svg deleted file mode 100644 index 489690e..0000000 --- a/chrome/public/assets/images/lights/outline/phoenix_pendant.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - diff --git a/chrome/public/assets/images/lights/outline/phoenix_table.svg b/chrome/public/assets/images/lights/outline/phoenix_table.svg deleted file mode 100644 index b42efe0..0000000 --- a/chrome/public/assets/images/lights/outline/phoenix_table.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - diff --git a/chrome/public/assets/images/lights/outline/phoenix_wall.svg b/chrome/public/assets/images/lights/outline/phoenix_wall.svg deleted file mode 100644 index 0241640..0000000 --- a/chrome/public/assets/images/lights/outline/phoenix_wall.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - diff --git a/chrome/public/assets/images/lights/outline/recessed.svg b/chrome/public/assets/images/lights/outline/recessed.svg deleted file mode 100644 index 5bd5356..0000000 --- a/chrome/public/assets/images/lights/outline/recessed.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - diff --git a/chrome/public/assets/images/lights/outline/storylight.svg b/chrome/public/assets/images/lights/outline/storylight.svg deleted file mode 100644 index f29a2b6..0000000 --- a/chrome/public/assets/images/lights/outline/storylight.svg +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/chrome/public/assets/images/lights/outline/table.svg b/chrome/public/assets/images/lights/outline/table.svg deleted file mode 100644 index e05b7b0..0000000 --- a/chrome/public/assets/images/lights/outline/table.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - diff --git a/chrome/public/assets/images/lights/outline/tap.svg b/chrome/public/assets/images/lights/outline/tap.svg deleted file mode 100644 index 6cab707..0000000 --- a/chrome/public/assets/images/lights/outline/tap.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - diff --git a/chrome/public/assets/images/lights/outline/white_and_color_e27.svg b/chrome/public/assets/images/lights/outline/white_and_color_e27.svg deleted file mode 100644 index 950322e..0000000 --- a/chrome/public/assets/images/lights/outline/white_and_color_e27.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - diff --git a/chrome/public/assets/images/lights/outline/white_e27.svg b/chrome/public/assets/images/lights/outline/white_e27.svg deleted file mode 100644 index 4cca0dd..0000000 --- a/chrome/public/assets/images/lights/outline/white_e27.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - diff --git a/chrome/public/background.js b/chrome/public/background.js deleted file mode 100644 index d8e0235..0000000 --- a/chrome/public/background.js +++ /dev/null @@ -1,248 +0,0 @@ -'use strict'; - -// utility functions -let isNone = function (obj) { - return obj === null || obj === undefined; -}; - -// drive the application state by listening its on its change in the storage -// the main ember app controls may change these -let state = { - activeLights: [], - beatDelay: 0, - threshold: 0.2, - hueRange: [0, 65535], - brightnessRange: [1, 254], - bridgeIp: null, - bridgeUsername: null, - lightsData: null, - lastLightBopIndex: 0, // background only properties below here - paused: false, - preMusicLightsDataCache: null -}; - -let dancer = new window.Dancer(), - stream = null, - kick; - -// initialze the state -chrome.storage.local.get('activeLights', ({ activeLights }) => { - if (!isNone(activeLights)) { - state.activeLights = activeLights; - } -}); - -chrome.storage.local.get('threshold', ({ threshold }) => { - if (!isNone(threshold)) { - state.threshold = threshold; - } - - kick = dancer.createKick({ - threshold: state.threshold, - onKick: function (mag, ratioKickMag) { - if (state.paused === false) { - simulateKick(mag, ratioKickMag); - } - } - }); - - kick.on(); -}); - -chrome.storage.local.get('beatDelay', ({ beatDelay }) => { - if (!isNone(beatDelay)) { - state.beatDelay = beatDelay; - } -}); - -chrome.storage.local.get('hueRange', ({ hueRange }) => { - if (!isNone(hueRange)) { - state.hueRange = hueRange; - } -}); - -chrome.storage.local.get('brightnessRange', ({ brightnessRange }) => { - if (!isNone(brightnessRange)) { - state.brightnessRange = brightnessRange; - } -}); - -chrome.storage.local.get('bridgeIp', ({ bridgeIp }) => { - if (!isNone(bridgeIp)) { - state.bridgeIp = bridgeIp; - } -}); - -chrome.storage.local.get('bridgeUsername', ({ bridgeUsername }) => { - if (!isNone(bridgeUsername)) { - state.bridgeUsername = bridgeUsername; - } -}); - -chrome.storage.local.get('lightsData', ({ lightsData }) => { - if (!isNone(lightsData)) { - state.lightsData = lightsData; - } -}); - -// add listeners for appliation state change -chrome.storage.onChanged.addListener(function ({ activeLights, threshold, beatDelay, hueRange, brightnessRange, bridgeIp, bridgeUsername, lightsData }) { - if (activeLights) { - state.activeLights = activeLights.newValue; - } - - if (threshold) { - state.threshold = threshold.newValue; - kick.set({ threshold: state.threshold }); - } - - if (beatDelay) { - state.beatDelay = beatDelay.newValue; - } - - if (hueRange) { - state.hueRange = hueRange.newValue; - } - - if (brightnessRange) { - state.brightnessRange = brightnessRange.newValue; - } - - if (bridgeIp) { - state.bridgeIp = bridgeIp.newValue; - } - - if (bridgeUsername) { - state.bridgeUsername = bridgeUsername.newValue; - } - - if (lightsData) { - state.lightsData = lightsData.newValue; - } -}) - -chrome.storage.local.set({ currentlyListenining: false }); -chrome.browserAction.setBadgeBackgroundColor({ color: [80, 80, 80, 255] }); - -let stopListening = function () { - chrome.browserAction.setBadgeText({ text: "" }); - chrome.storage.local.set({ currentlyListenining: false }); - - if (state.preMusicLightsDataCache) { - let updateLight = function (lightIndex) { - let xhr = new XMLHttpRequest(); - - xhr.open('PUT', 'http://' + state.bridgeIp + '/api/' + state.bridgeUsername + '/lights/' + lightIndex + '/state', true); - xhr.setRequestHeader('Content-Type', 'application/json'); - xhr.send(JSON.stringify({ - 'on': state.preMusicLightsDataCache[lightIndex].state.on, - 'hue': state.preMusicLightsDataCache[lightIndex].state.hue, - 'bri': state.preMusicLightsDataCache[lightIndex].state.bri - })); - }; - - for (let key in state.lightsData) { - if (state.lightsData.hasOwnProperty(key)) { - setTimeout(function () { - updateLight(key); - }, 1000); - } - } - } -}; - -chrome.runtime.onMessageExternal.addListener( - function (request, sender, sendResponse) { - sendResponse({ installed: true }); - } -); - -chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) { - if (request.action === 'start-listening') { - chrome.tabCapture.capture({ - audio: true, - video: false - }, function (_stream) { - let error = null; - - if (!_stream) { - error = chrome.runtime.lastError.message; - } else { - stream = _stream; - dancer.load(_stream, 3); - chrome.storage.local.set({ currentlyListenining: true }); - chrome.browserAction.setBadgeText({ text: "♪" }); - state.preMusicLightsDataCache = state.lightsData; - - stream.getTracks()[0].onended = function () { - chrome.storage.local.set({ isListenining: false }); - - stopListening(); - }; - } - - sendResponse({ error }); - - return true; - }); - } else if (request.action === 'stop-listening' && stream !== null) { - stream.getTracks()[0].stop(); - stream = null; - - stopListening(); - } - - return true; -}); - -// core function that simulates a random light on kick (beat) -let simulateKick = (/*mag, ratioKickMag*/) => { - chrome.runtime.sendMessage({ action: 'button-bump' }); - - let color = null, - _stimulateLight = (lightIndex, brightness, hue) => { - let options = { bri: brightness, transitiontime: 1 }, - xhr = new XMLHttpRequest(); - - if (!isNone(hue)) { - options.hue = hue; - } - - if (state.lightsData[lightIndex].state.on === false) { - options.on = true; - } - - xhr.open('PUT', 'http://' + state.bridgeIp + '/api/' + state.bridgeUsername + '/lights/' + lightIndex + '/state', true); - xhr.setRequestHeader('Content-Type', 'application/json'); - xhr.send(JSON.stringify(options)); - }, - timeToBriOff = 80; - - if (state.activeLights.length > 0) { - let lightBopIndex = Math.floor(Math.random() * state.activeLights.length); - - // let's try not to select the same light twice in a row - if (state.activeLights.length > 1) { - while (lightBopIndex === state.lastLightBopIndex) { - lightBopIndex = Math.floor(Math.random() * state.activeLights.length); - } - } - - let light = state.activeLights[lightBopIndex]; - state.lastLightBopIndex = lightBopIndex; - - color = Math.floor(Math.random() * (state.hueRange[1] - state.hueRange[0] + 1) + state.hueRange[0]); - - setTimeout(() => { - _stimulateLight(light, state.brightnessRange[1], color); - setTimeout(function () { - _stimulateLight(light, state.brightnessRange[0]) - }, timeToBriOff); - }, state.beatDelay); - } - - state.paused = true; - setTimeout(function () { - state.paused = false; - }, 200); -}; \ No newline at end of file diff --git a/chrome/public/dancer.js b/chrome/public/dancer.js deleted file mode 100644 index 18a86d8..0000000 --- a/chrome/public/dancer.js +++ /dev/null @@ -1,519 +0,0 @@ -'use strict'; - -(function () { - - var Dancer = function () { - this.audioAdapter = new Dancer.adapters.webaudio(this); - this.events = {}; - this.sections = []; - this.bind('update', update); - }; - - Dancer.version = 'X.X.X'; - Dancer.adapters = {}; - - Dancer.prototype = { - - load: function (source, boost) { - this.audio = this.audioAdapter.load(source, boost); - - return this; - }, - - /* Actions */ - createKick: function (options) { - return new Dancer.Kick(this, options); - }, - - bind: function (name, callback) { - if (!this.events[name]) { - this.events[name] = []; - } - this.events[name].push(callback); - return this; - }, - - unbind: function (name) { - if (this.events[name]) { - delete this.events[name]; - } - return this; - }, - - trigger: function (name) { - var _this = this; - if (this.events[name]) { - this.events[name].forEach(function (callback) { - callback.call(_this); - }); - } - return this; - }, - - // Returns the magnitude of a frequency or average over a range of frequencies - getFrequency: function (freq, endFreq) { - var sum = 0; - if (endFreq !== undefined) { - for (var i = freq; i <= endFreq; i++) { - sum += this.getSpectrum()[i]; - } - return sum / (endFreq - freq + 1); - } else { - return this.getSpectrum()[freq]; - } - }, - - getWaveform: function () { - return this.audioAdapter.getWaveform(); - }, - - getSpectrum: function () { - return this.audioAdapter.getSpectrum(); - }, - - /* Sections */ - - after: function (time, callback) { - var _this = this; - this.sections.push({ - condition: function () { - return _this.getTime() > time; - }, - callback: callback - }); - return this; - }, - - before: function (time, callback) { - var _this = this; - this.sections.push({ - condition: function () { - return _this.getTime() < time; - }, - callback: callback - }); - return this; - }, - - between: function (startTime, endTime, callback) { - var _this = this; - this.sections.push({ - condition: function () { - return _this.getTime() > startTime && _this.getTime() < endTime; - }, - callback: callback - }); - return this; - }, - - onceAt: function (time, callback) { - var - _this = this, - thisSection = null; - this.sections.push({ - condition: function () { - return _this.getTime() > time && !this.called; - }, - callback: function () { - callback.call(this); - thisSection.called = true; - }, - called: false - }); - // Baking the section in the closure due to callback's this being the dancer instance - thisSection = this.sections[this.sections.length - 1]; - return this; - } - }; - - function update() { - for (var i in this.sections) { - if (this.sections[i].condition && this.sections[i].condition()) - this.sections[i].callback.call(this); - } - } - - window.Dancer = Dancer; -})(); - -(function (Dancer) { - - var CODECS = { - 'mp3': 'audio/mpeg;', - 'ogg': 'audio/ogg; codecs="vorbis"', - 'wav': 'audio/wav; codecs="1"', - 'aac': 'audio/mp4; codecs="mp4a.40.2"' - }, - audioEl = document.createElement('audio'); - - Dancer.options = {}; - - Dancer.setOptions = function (o) { - for (var option in o) { - if (o.hasOwnProperty(option)) { - Dancer.options[option] = o[option]; - } - } - }; -})(window.Dancer); - -(function (undefined) { - var Kick = function (dancer, o) { - o = o || {}; - this.dancer = dancer; - this.frequency = o.frequency !== undefined ? o.frequency : [0, 5]; - this.threshold = o.threshold !== undefined ? o.threshold : 0.3; - this.decay = o.decay !== undefined ? o.decay : 0.02; - this.onKick = o.onKick; - this.offKick = o.offKick; - this.isOn = false; - this.currentThreshold = this.threshold; - this.previousMag = 0; - this.canUseRatio = true; - this.canUseRatioHandle = null; - - var _this = this; - this.dancer.bind('update', function () { - _this.onUpdate(); - }); - }; - - Kick.prototype = { - on: function () { - this.isOn = true; - return this; - }, - off: function () { - this.isOn = false; - return this; - }, - - set: function (o) { - o = o || {}; - this.frequency = o.frequency !== undefined ? o.frequency : this.frequency; - this.threshold = o.threshold !== undefined ? o.threshold : this.threshold; - this.decay = o.decay !== undefined ? o.decay : this.decay; - this.onKick = o.onKick || this.onKick; - this.offKick = o.offKick || this.offKick; - }, - - onUpdate: function () { - if (!this.isOn) { return; } - - var magnitude = this.maxAmplitude(this.frequency); - if (magnitude >= this.currentThreshold && magnitude >= this.threshold) { - this.currentThreshold = magnitude; - this.onKick && this.onKick.call(this.dancer, magnitude); - this.canUseRatio = false; - - if (this.canUseRatioHandle) { - clearTimeout(this.canUseRatioHandle); - this.canUseRatioHandle = null; - } - - var self = this; - this.canUseRatioHandle = setTimeout(function () { - self.canUseRatio = true; - }, 5000); - } else { - if (magnitude / this.previousMag > this.threshold * 5 && magnitude > 0.1 && this.canUseRatio) { - this.onKick && this.onKick.call(this.dancer, magnitude, magnitude / this.previousMag); - } else { - this.offKick && this.offKick.call(this.dancer, magnitude); - } - - this.currentThreshold -= this.decay; - this.previousMag = (magnitude > 0) ? magnitude : 0.0001; - } - }, - maxAmplitude: function (frequency) { - var max = 0, fft = this.dancer.getSpectrum(); - - // Sloppy array check - if (!frequency.length) { - return frequency < fft.length ? - fft[~~frequency] : - null; - } - - for (var i = frequency[0], l = frequency[1]; i <= l; i++) { - if (fft[i] > max) { max = fft[i]; } - } - return max; - } - }; - - window.Dancer.Kick = Kick; -})(); - -(function () { - var - SAMPLE_SIZE = 2048, - SAMPLE_RATE = 44100; - - var adapter = function (dancer) { - var context; - - if ('AudioContext' in window) { - context = new AudioContext(); - } else { - context = new webkitAudioContext(); - } - - this.dancer = dancer; - this.context = context; - }; - - adapter.prototype = { - - load: function (_source, boost) { - var _this = this; - this.source = this.context.createMediaStreamSource(_source); - - this.isLoaded = false; - this.progress = 0; - - if (this.proc) { - this.proc.onaudioprocess = null; - delete this.proc; - } - - this.proc = this.context.createScriptProcessor(SAMPLE_SIZE / 2, 1, 1); - - this.proc.onaudioprocess = function (e) { - _this.update.call(_this, e); - }; - - this.gain = this.context.createGain(); - - this.fft = new FFT(SAMPLE_SIZE / 2, SAMPLE_RATE, boost); - this.signal = new Float32Array(SAMPLE_SIZE / 2); - - connectContext.call(_this); - - return this.source; - }, - - getWaveform: function () { - return this.signal; - }, - - getSpectrum: function () { - return this.fft.spectrum; - }, - - update: function (e) { - var - buffers = [], - channels = e.inputBuffer.numberOfChannels, - resolution = SAMPLE_SIZE / channels, - sum = function (prev, curr) { - return prev[i] + curr[i]; - }, i; - - for (i = channels; i--;) { - buffers.push(e.inputBuffer.getChannelData(i)); - } - - for (i = 0; i < resolution; i++) { - this.signal[i] = channels > 1 ? - buffers.reduce(sum) / channels : - buffers[0][i]; - } - - this.fft.forward(this.signal); - this.dancer.trigger('update'); - } - }; - - function connectContext() { - this.source.connect(this.proc); - this.source.connect(this.gain); - this.gain.connect(this.context.destination); - this.proc.connect(this.context.destination); - - this.isLoaded = true; - this.progress = 1; - this.dancer.trigger('loaded'); - } - - Dancer.adapters.webaudio = adapter; - -})(); - - -/* - * DSP.js - a comprehensive digital signal processing library for javascript - * - * Created by Corban Brook on 2010-01-01. - * Copyright 2010 Corban Brook. All rights reserved. - * - */ - -// Fourier Transform Module used by DFT, FFT, RFFT -function FourierTransform(bufferSize, sampleRate, boost) { - this.bufferSize = bufferSize; - this.sampleRate = sampleRate; - this.bandwidth = 2 / bufferSize * sampleRate / 2; - this.boost = boost ? boost : 1; - - this.spectrum = new Float32Array(bufferSize / 2); - this.real = new Float32Array(bufferSize); - this.imag = new Float32Array(bufferSize); - - this.peakBand = 0; - this.peak = 0; - - /** - * Calculates the *middle* frequency of an FFT band. - * - * @param {Number} index The index of the FFT band. - * - * @returns The middle frequency in Hz. - */ - this.getBandFrequency = function (index) { - return this.bandwidth * index + this.bandwidth / 2; - }; - - this.setBoost = function (boost) { - this.boost = boost; - }; - - this.calculateSpectrum = function () { - var spectrum = this.spectrum, - real = this.real, - imag = this.imag, - boost = this.boost, - bSi = 2 / this.bufferSize, - sqrt = Math.sqrt, - rval, - ival, - mag; - - for (var i = 0, N = bufferSize / 2; i < N; i++) { - rval = real[i]; - ival = imag[i]; - mag = bSi * sqrt(rval * rval + ival * ival); - - if (mag > this.peak) { - this.peakBand = i; - this.peak = mag; - } - - spectrum[i] = mag * boost; - } - }; -} - -/** - * FFT is a class for calculating the Discrete Fourier Transform of a signal - * with the Fast Fourier Transform algorithm. - * - * @param {Number} bufferSize The size of the sample buffer to be computed. Must be power of 2 - * @param {Number} sampleRate The sampleRate of the buffer (eg. 44100) - * @param {Number} boost The coefficient - * - * @constructor - */ -function FFT(bufferSize, sampleRate, boost) { - FourierTransform.call(this, bufferSize, sampleRate, boost); - - this.reverseTable = new Uint32Array(bufferSize); - - var limit = 1; - var bit = bufferSize >> 1; - - var i; - - while (limit < bufferSize) { - for (i = 0; i < limit; i++) { - this.reverseTable[i + limit] = this.reverseTable[i] + bit; - } - - limit = limit << 1; - bit = bit >> 1; - } - - this.sinTable = new Float32Array(bufferSize); - this.cosTable = new Float32Array(bufferSize); - - for (i = 0; i < bufferSize; i++) { - this.sinTable[i] = Math.sin(-Math.PI / i); - this.cosTable[i] = Math.cos(-Math.PI / i); - } -} - -/** - * Performs a forward transform on the sample buffer. - * Converts a time domain signal to frequency domain spectra. - * - * @param {Array} buffer The sample buffer. Buffer Length must be power of 2 - * - * @returns The frequency spectrum array - */ -FFT.prototype.forward = function (buffer) { - // Locally scope variables for speed up - var bufferSize = this.bufferSize, - cosTable = this.cosTable, - sinTable = this.sinTable, - reverseTable = this.reverseTable, - real = this.real, - imag = this.imag, - spectrum = this.spectrum; - - var k = Math.floor(Math.log(bufferSize) / Math.LN2); - - if (Math.pow(2, k) !== bufferSize) { throw "Invalid buffer size, must be a power of 2."; } - if (bufferSize !== buffer.length) { throw "Supplied buffer is not the same size as defined FFT. FFT Size: " + bufferSize + " Buffer Size: " + buffer.length; } - - var halfSize = 1, - phaseShiftStepReal, - phaseShiftStepImag, - currentPhaseShiftReal, - currentPhaseShiftImag, - off, - tr, - ti, - tmpReal, - i; - - for (i = 0; i < bufferSize; i++) { - real[i] = buffer[reverseTable[i]]; - imag[i] = 0; - } - - while (halfSize < bufferSize) { - //phaseShiftStepReal = Math.cos(-Math.PI/halfSize); - //phaseShiftStepImag = Math.sin(-Math.PI/halfSize); - phaseShiftStepReal = cosTable[halfSize]; - phaseShiftStepImag = sinTable[halfSize]; - - currentPhaseShiftReal = 1; - currentPhaseShiftImag = 0; - - for (var fftStep = 0; fftStep < halfSize; fftStep++) { - i = fftStep; - - while (i < bufferSize) { - off = i + halfSize; - tr = (currentPhaseShiftReal * real[off]) - (currentPhaseShiftImag * imag[off]); - ti = (currentPhaseShiftReal * imag[off]) + (currentPhaseShiftImag * real[off]); - - real[off] = real[i] - tr; - imag[off] = imag[i] - ti; - real[i] += tr; - imag[i] += ti; - - i += halfSize << 1; - } - - tmpReal = currentPhaseShiftReal; - currentPhaseShiftReal = (tmpReal * phaseShiftStepReal) - (currentPhaseShiftImag * phaseShiftStepImag); - currentPhaseShiftImag = (tmpReal * phaseShiftStepImag) + (currentPhaseShiftImag * phaseShiftStepReal); - } - - halfSize = halfSize << 1; - } - - return this.calculateSpectrum(); -}; \ No newline at end of file diff --git a/chrome/public/manifest.json b/chrome/public/manifest.json deleted file mode 100644 index 86cbee2..0000000 --- a/chrome/public/manifest.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "manifest_version": 2, - "name": "Huegasm for Philips Hue Lights", - "short_name": "Huegasm", - "description": "Manage and synchronize your Philips Hue lights with the beat of your music.", - "version": "1.0.7", - "icons": { - "16": "16x16.png", - "48": "48x48.png", - "128": "128x128.png" - }, - "background": { - "scripts": [ - "dancer.js", - "background.js" - ] - }, - "browser_action": { - "default_icon": { - "16": "16x16.png", - "32": "32x32.png" - }, - "default_popup": "index.html", - "default_title": "Huegasm" - }, - "externally_connectable": { - "matches": [ - "http://www.huegasm.com/*", "http://localhost:*/*" - ] - }, - "permissions": [ - "activeTab", - "tabCapture", - "storage", - "https://ajax.googleapis.com/" - ] -} \ No newline at end of file