Skip to content
Permalink
Browse files

initial commit

  • Loading branch information...
4ch1m committed Feb 1, 2017
1 parent c728d2b commit c4d6f017b672988f89de6b8bfd99809613ce3eaa
Showing with 5,600 additions and 0 deletions.
  1. +2 −0 .travis.yml
  2. +92 −0 README.md
  3. +86 −0 app/css/bootstrap_custom.css
  4. +5 −0 app/css/index.css
  5. +6 −0 app/css/minicolors_custom.css
  6. +45 −0 app/css/onoffswitch.css
  7. +9 −0 app/css/rangeslider_custom.css
  8. +51 −0 app/hbs/bridge-discovery.hbs
  9. +177 −0 app/hbs/bridges.hbs
  10. +246 −0 app/hbs/groups.hbs
  11. +218 −0 app/hbs/lights.hbs
  12. +115 −0 app/hbs/partials/basic-actions.hbs
  13. +1 −0 app/hbs/partials/icon-product.hbs
  14. +1 −0 app/hbs/partials/icon-pushlink.hbs
  15. +1 −0 app/hbs/partials/icon-question.hbs
  16. +1 −0 app/hbs/partials/icon-room.hbs
  17. +3 −0 app/hbs/partials/spinner.hbs
  18. +25 −0 app/hbs/pushlink.hbs
  19. +80 −0 app/hbs/quickactions.hbs
  20. +70 −0 app/hbs/sensors.hbs
  21. +34 −0 app/hbs/users.hbs
  22. +169 −0 app/i18n/en.json
  23. +24 −0 app/img/products/aura.svg
  24. +17 −0 app/img/products/beyond_ceiling_pendant_table.svg
  25. +17 −0 app/img/products/bloom.svg
  26. +27 −0 app/img/products/br30.svg
  27. +60 −0 app/img/products/br30_slim.svg
  28. +32 −0 app/img/products/bridge_v1.svg
  29. +32 −0 app/img/products/bridge_v2.svg
  30. +16 −0 app/img/products/ceiling_round.svg
  31. +18 −0 app/img/products/ceiling_square.svg
  32. +1,515 −0 app/img/products/entity.svg
  33. +15 −0 app/img/products/floor.svg
  34. +11 −0 app/img/products/go.svg
  35. +93 −0 app/img/products/gu10.svg
  36. +36 −0 app/img/products/gu10_perfectfit.svg
  37. +14 −0 app/img/products/hds.svg
  38. +413 −0 app/img/products/impulse.svg
  39. +22 −0 app/img/products/iris.svg
  40. +26 −0 app/img/products/lightstrip.svg
  41. +9 −0 app/img/products/motion_sensor.svg
  42. +12 −0 app/img/products/pendant_oval.svg
  43. +12 −0 app/img/products/pendant_round.svg
  44. +7 −0 app/img/products/pendant_square.svg
  45. +11 −0 app/img/products/phoenix_ceiling.svg
  46. +7 −0 app/img/products/phoenix_down.svg
  47. +17 −0 app/img/products/phoenix_pendant.svg
  48. +15 −0 app/img/products/phoenix_table.svg
  49. +14 −0 app/img/products/phoenix_wall.svg
  50. +13 −0 app/img/products/recessed.svg
  51. +27 −0 app/img/products/storylight.svg
  52. +15 −0 app/img/products/table.svg
  53. +9 −0 app/img/products/tap.svg
  54. +10 −0 app/img/products/white_and_color_e27.svg
  55. +15 −0 app/img/products/white_e27.svg
  56. +23 −0 app/img/pushlink/pushlink_bridgev1.svg
  57. +33 −0 app/img/pushlink/pushlink_bridgev2.svg
  58. +8 −0 app/img/rooms/bathroom.svg
  59. +10 −0 app/img/rooms/bedroom.svg
  60. +15 −0 app/img/rooms/carport.svg
  61. +12 −0 app/img/rooms/dining.svg
  62. +15 −0 app/img/rooms/driveway.svg
  63. +11 −0 app/img/rooms/frontdoor.svg
  64. +10 −0 app/img/rooms/garage.svg
  65. +16 −0 app/img/rooms/garden.svg
  66. +13 −0 app/img/rooms/gym.svg
  67. +12 −0 app/img/rooms/hallway.svg
  68. +6 −0 app/img/rooms/house.svg
  69. +10 −0 app/img/rooms/kids_bedroom.svg
  70. +12 −0 app/img/rooms/kitchen.svg
  71. +11 −0 app/img/rooms/living.svg
  72. +8 −0 app/img/rooms/nursery.svg
  73. +9 −0 app/img/rooms/office.svg
  74. +11 −0 app/img/rooms/other.svg
  75. +14 −0 app/img/rooms/recreation.svg
  76. +8 −0 app/img/rooms/terrace.svg
  77. +10 −0 app/img/rooms/toilet.svg
  78. +153 −0 app/index.html
  79. +114 −0 app/js/bridges.js
  80. +88 −0 app/js/common.js
  81. +114 −0 app/js/constants.js
  82. +127 −0 app/js/groups.js
  83. +239 −0 app/js/index.js
  84. +144 −0 app/js/initialize.js
  85. +96 −0 app/js/lights.js
  86. +74 −0 app/js/quickactions.js
  87. +30 −0 app/js/sensors.js
  88. +28 −0 app/js/users.js
  89. BIN huelectron.png
  90. +21 −0 license
  91. +48 −0 package.json
  92. BIN screenshots/bridges.png
  93. +18 −0 screenshots/create_gif.sh
  94. BIN screenshots/groups1.png
  95. BIN screenshots/groups2.png
  96. BIN screenshots/lights1.png
  97. BIN screenshots/lights2.png
  98. BIN screenshots/lights3.png
  99. BIN screenshots/lights4.png
  100. BIN screenshots/quickactions1.png
  101. BIN screenshots/quickactions2.png
  102. BIN screenshots/screenshots.gif
  103. BIN screenshots/sensors.png
  104. BIN screenshots/users.png
  105. +11 −0 zip_dist.sh
@@ -0,0 +1,2 @@
language: node_js
node_js: 6
@@ -0,0 +1,92 @@
![huElectron](https://raw.githubusercontent.com/4ch1m/huElectron/master/huelectron.png)

# huElectron

> An open-source and cross-platform app for the [Hue Lighting System](https://www2.meethue.com) from _Philips_ - built on [Electron](http://electron.atom.io).
## Screenshots

![screenshots](https://raw.githubusercontent.com/4ch1m/huElectron/master/screenshots/screenshots.gif)

## Motivation

While there are many mobile-apps available for the lighting system from _Philips_, only few "traditional" desktop-apps can be found.

Since most of these desktop-apps are closed-source and only available for _Windows_ / _Mac_, I've decided to create an open-source app which will run on all popular systems; including Linux.

Also this is my first _Electron_-app; so it served as some kind of playground for me. :wink:

## Features

The current feature-set includes:

* easy management of ...
* bridges
* lights
* groups
* sensors
* quick-actions (set state/color/brightness with one mouse-click)
* show detailed information about each light/group

## TODO

__huElectron__ is still at an early development stage; the following features will be implemented in future releases:

* manage schedules
* manage scenes
* manage rules
* manage portal services
* implement discovery of new lights
* implement discovery of new new sensors
* enhance bridge-management (zigbeeChannel, proxyPort, timeZone, etc.)
* enhance sensor-management (type, virtual sensor creation, etc.)

Oh, and although I've tried to make the app look somewhat decent by extensively using [Bootstrap](https://getbootstrap.com), of course there's always room for improvement/beautification.
So any help/contribution from web-design-wizards is highly welcome. :simple_smile:

## Binaries

Prebuilt binaries for all target platforms can be found in the [releases](https://github.com/4ch1m/huElectron/releases)-section of this repository.

## Build It Yourself

* Clone the repository:
```
git clone https://github.com/4ch1m/huElectron.git
```

* Change directory:
```
cd huElectron
```

* Install dependencies:
```
npm install
```

* Now either ...
* build the app for Linux, Mac, and Windows:
```
npm run build
```
(The freshly compiled binaries can then be found in the _dist_-folder.)

* or just start it right away:
```
npm start
```


## Author

:email: [Achim Seufert](mailto:contact@huelectron.achimonline.de)


## License

Please read the [license](license) file.

---

<a href="http://www.jetbrains.com/idea/" style="position: relative;display:block; width:88px; height:31px; border:0; margin:0;padding:0;text-decoration:none;text-indent:0;"><span style="margin: 0;padding: 0;position: absolute;top: 0;left: 4px;font-size: 10px; line-height: 12px;cursor:pointer; background-image:none;border:0;color: #acc4f9; font-family: trebuchet ms,arial,sans-serif;font-weight: normal;text-align:left;">Developed with&nbsp;</span><img src="http://www.jetbrains.com/idea/opensource/img/all/banners/idea88x31_blue.gif" alt="The best Java IDE" border="0"/></a>
@@ -0,0 +1,86 @@
.collapse-panel-heading .accordion-toggle:after {
font-family: 'Glyphicons Halflings';
content: '\e114';
float: right;
color: grey;
}

.collapse-panel-heading .accordion-toggle.collapsed:after {
content: '\e080';
}

.collapse-btn.btn:after {
font-family: 'Glyphicons Halflings';
content: '\e114';
float: right;
margin-left: 15px;
}

.collapse-btn.btn.collapsed:after {
content: '\e080';
}

.modal-header-success {
color:#fff;
padding:9px 15px;
border-bottom:1px solid #eee;
background-color: #5cb85c;
-webkit-border-top-left-radius: 5px;
-webkit-border-top-right-radius: 5px;
-moz-border-radius-topleft: 5px;
-moz-border-radius-topright: 5px;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}

.modal-header-warning {
color:#fff;
padding:9px 15px;
border-bottom:1px solid #eee;
background-color: #f0ad4e;
-webkit-border-top-left-radius: 5px;
-webkit-border-top-right-radius: 5px;
-moz-border-radius-topleft: 5px;
-moz-border-radius-topright: 5px;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}

.modal-header-danger {
color:#fff;
padding:9px 15px;
border-bottom:1px solid #eee;
background-color: #d9534f;
-webkit-border-top-left-radius: 5px;
-webkit-border-top-right-radius: 5px;
-moz-border-radius-topleft: 5px;
-moz-border-radius-topright: 5px;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}

.modal-header-info {
color:#fff;
padding:9px 15px;
border-bottom:1px solid #eee;
background-color: #5bc0de;
-webkit-border-top-left-radius: 5px;
-webkit-border-top-right-radius: 5px;
-moz-border-radius-topleft: 5px;
-moz-border-radius-topright: 5px;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}

.modal-header-primary {
color:#fff;
padding:9px 15px;
border-bottom:1px solid #eee;
background-color: #428bca;
-webkit-border-top-left-radius: 5px;
-webkit-border-top-right-radius: 5px;
-moz-border-radius-topleft: 5px;
-moz-border-radius-topright: 5px;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
@@ -0,0 +1,5 @@
html,
body {
padding: 22px;
margin: 0;
}
@@ -0,0 +1,6 @@
.minicolors-theme-default .minicolors-input {
height: 35px;
width: auto;
display: inline-block;
padding-left: 40px;
}
@@ -0,0 +1,45 @@
.onoffswitch {
position: relative; width: 90px;
-webkit-user-select:none; -moz-user-select:none; -ms-user-select: none;
}
.onoffswitch-checkbox {
display: none;
}
.onoffswitch-label {
display: block; overflow: hidden; cursor: pointer;
border: 2px solid #999999; border-radius: 20px;
}
.onoffswitch-inner {
display: block; width: 200%; margin-left: -100%;
transition: margin 0.3s ease-in 0s;
}
.onoffswitch-inner:before, .onoffswitch-inner:after {
display: block; float: left; width: 50%; height: 30px; padding: 0; line-height: 30px;
font-size: 14px; color: white; font-family: Trebuchet, Arial, sans-serif; font-weight: bold;
box-sizing: border-box;
}
.onoffswitch-inner:before {
content: "ON";
padding-left: 10px;
background-color: #34A7C1; color: #FFFFFF;
}
.onoffswitch-inner:after {
content: "OFF";
padding-right: 10px;
background-color: #EEEEEE; color: #999999;
text-align: right;
}
.onoffswitch-switch {
display: block; width: 18px; margin: 6px;
background: #FFFFFF;
position: absolute; top: 0; bottom: 0;
right: 56px;
border: 2px solid #999999; border-radius: 20px;
transition: all 0.3s ease-in 0s;
}
.onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-inner {
margin-left: 0;
}
.onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-switch {
right: 0px;
}
@@ -0,0 +1,9 @@
.rangeslider--horizontal {
margin-top: 10px;
height: 20px;
width: 100%;
}

.rangeslider__fill {
background: #34A7C1;
}
@@ -0,0 +1,51 @@
<h4>{{I18n 'bridges-discovery'}}</h4>

{{I18n 'bridges-choose'}}

<table class="table table-hover table-condensed">
<thead>
<tr>
<th>{{I18n 'bridges-column-id'}}</th>
<th>{{I18n 'bridges-column-ip'}}</th>
<th></th>
</tr>
</thead>
<tbody>
{{#each bridges}}
<tr>
<td>{{id}}</td>
<td>{{ip}}</td>
<td>
<button class="btn btn-primary" id="discovered-bridge-button-{{id}}">Connect</button>
<script>
$('#discovered-bridge-button-{{id}}').click(function() {
// try to log in again with the selected bridge/ip
let tempClient = new huE_common.huejay.Client({
host: '{{ip}}',
username: huE_common.config.get(CONFIG_KEYS.userName)
});
tempClient.bridge.isAuthenticated()
.then(() => {
// the user exists on that bridge
huE_common.config.set(CONFIG_KEYS.bridgeIp, '{{ip}}');
huE_common.config.set(CONFIG_KEYS.bridgeId, '{{id}}');
huE_common.huejayClient = tempClient;
huE_common.switchToMainContentElement('tabs');
$('.nav-tabs a:first').tab('show');
})
.catch(error => {
// not authorized with available credentials;
// create new user
huE_bridges.pingBridgeAndInitiatePushlink('{{ip}}', '{{id}}');
});
}
);
</script>
</td>
</tr>
{{/each}}
</tbody>
</table>
Oops, something went wrong.

0 comments on commit c4d6f01

Please sign in to comment.
You can’t perform that action at this time.