Skip to content

Commit

Permalink
Merge pull request #1 from edfungus/master
Browse files Browse the repository at this point in the history
Pulling in edfungus new merges
  • Loading branch information
wickwire committed Apr 22, 2016
2 parents 6f5cf91 + 2780683 commit 12c9fd2
Show file tree
Hide file tree
Showing 16 changed files with 198 additions and 52 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -462,3 +462,21 @@ Example:
"title": "RGB Lights" [optional]
}
```

### Youtube Stream

![crouton-video-youtube](https://raw.githubusercontent.com/edfungus/Crouton/master/public/common/images/crouton-video-youtube.png) </br> (Thank you [wickwire](https://github.com/wickwire) for this addition) </br> Add a Youtube video or livestream to your dashboard. This is great for having a dashboard of various security cameras.

```json
Device - Crouton
Name: crouton-video-youtube

Example:
"youTubeStream": {
"values": {
"youtubeID": "GZnb3jQ2YZo" [required]
},
"card-type": "crouton-video-youtube", [required]
"title": "YouTube Stream" [optional]
}
```
79 changes: 46 additions & 33 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,48 +1,61 @@
{
"name": "Crouton",
"version": "1.0.0",
"name": "crouton",
"description": "MQTT IOT Dashboard",
"main": "app.js",
"authors": [
"Edmund Fung <[email protected]>"
],
"description": "MQTT IOT Dashboard",
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"public/common/bower",
"test",
"tests"
],
"dependencies": {
"font-awesome": "~4.4.0",
"polymer": "Polymer/polymer#^1.2.0",
"paper-card": "PolymerElements/paper-card#~1.0.6",
"paper-drawer-panel": "PolymerElements/paper-drawer-panel#~1.0.3",
"Materialize": "materialize#~0.97.1",
"paper-icon-button": "PolymerElements/paper-icon-button#~1.0.3",
"paper-header-panel": "PolymerElements/paper-header-panel#~1.0.5",
"paper-input": "PolymerElements/paper-input#~1.0.15",
"paper-button": "PolymerElements/paper-button#~1.0.8",
"paper-styles": "PolymerElements/paper-styles#~1.1.4",
"iron-form": "PolymerElements/iron-form#~1.0.9",
"paper-toast": "PolymerElements/paper-toast#~1.0.0",
"packery": "~1.4.3",
"draggabilly": "~1.2.4",
"paper-toggle-button": "PolymerElements/paper-toggle-button#~1.0.11",
"paper-fab": "PolymerElements/paper-fab#~1.1.0",
"fontawesome-iconset": "diego-d5000/fontawesome-iconset#~4.3.0",
"paper-dropdown-menu": "PolymerElements/paper-dropdown-menu#~1.1.0",
"paper-item": "PolymerElements/paper-item#~1.1.2",
"paper-listbox": "polymerelements/paper-listbox#~1.0.0",
"paper-menu": "PolymerElements/paper-menu#~1.2.0",
"web-animations-js": "~2.1.3",
"paper-slider": "PolymerElements/paper-slider#~1.0.8",
"chartist": "~0.9.5",
"paper-checkbox": "PolymerElements/paper-checkbox#~1.1.0"
},
"resolutions": {
"polymer": "^1.2.0",
"webcomponentsjs": "^0.7.2",
"web-animations-js": "~2.1.3"
"chartist": "*",
"ev-emitter": "~1.0.0",
"desandro-matches-selector": "~2.0.0",
"draggabilly": "*",
"fizzy-ui-utils": "~2.0.0",
"fontawesome-iconset": "edfungus/fontawesome-iconset",
"font-roboto": "PolymerElements/font-roboto#^1.0.1",
"font-awesome": "*",
"iron-a11y-announcer": "PolymerElements/iron-a11y-announcer#^1.0.0",
"iron-a11y-keys-behavior": "polymerelements/iron-a11y-keys-behavior#^1.0.0",
"iron-autogrow-textarea": "PolymerElements/iron-autogrow-textarea#^1.0.0",
"iron-ajax": "PolymerElements/iron-ajax#^1.0.0",
"iron-checked-element-behavior": "PolymerElements/iron-checked-element-behavior#^1.0.0",
"iron-collapse": "PolymerElements/iron-collapse#^1.0.0",
"iron-dropdown": "PolymerElements/iron-dropdown#^1.0.0",
"iron-form": "PolymerElements/iron-form",
"iron-image": "PolymerElements/iron-image#^1.2.0",
"iron-media-query": "PolymerElements/iron-media-query#^1.0.0",
"iron-input": "PolymerElements/iron-input#^1.0.0",
"iron-menu-behavior": "PolymerElements/iron-menu-behavior#^1.0.0",
"iron-range-behavior": "PolymerElements/iron-range-behavior#^1.0.0",
"jquery": ">=2.1.1",
"Materialize": "materialize#*",
"outlayer": "~2.0.0",
"packery": "*",
"paper-behaviors": "PolymerElements/paper-behaviors#^1.0.0",
"paper-button": "PolymerElements/paper-button",
"paper-card": "PolymerElements/paper-card",
"paper-checkbox": "PolymerElements/paper-checkbox",
"paper-drawer-panel": "PolymerElements/paper-drawer-panel",
"paper-dropdown-menu": "PolymerElements/paper-dropdown-menu",
"paper-header-panel": "PolymerElements/paper-header-panel",
"paper-fab": "PolymerElements/paper-fab",
"paper-icon-button": "PolymerElements/paper-icon-button",
"paper-item": "PolymerElements/paper-item",
"paper-listbox": "polymerelements/paper-listbox",
"paper-menu": "PolymerElements/paper-menu",
"paper-progress": "PolymerElements/paper-progress#^1.0.0",
"paper-slider": "PolymerElements/paper-slider",
"paper-toast": "PolymerElements/paper-toast",
"paper-toggle-button": "PolymerElements/paper-toggle-button",
"polymer": "Polymer/polymer#~1.4.0"
}
}
9 changes: 8 additions & 1 deletion clients/python_clients/all.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,14 @@
},
"max": 255,
"title": "RGB LED <3"
}
},
"youTubeStream": {
"values": {
"youtubeID": "GZnb3jQ2YZo"
},
"card-type": "crouton-video-youtube",
"title": "YouTube Stream"
}
},
"description": "Kroobar's IOT devices"
}
Expand Down
7 changes: 7 additions & 0 deletions clients/python_clients/cf_demo_client/crouton-test-bar-cf.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,13 @@ def update_values():
"high": 73,
"card-type": "crouton-chart-line",
"title": "Temperature (F)"
},
"youTubeStream": {
"values": {
"youtubeID": "GZnb3jQ2YZo"
},
"card-type": "crouton-video-youtube",
"title": "YouTube Stream"
}
},
"description": "Kroobar's IOT devices"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node app.js",
"postinstall": "node_modules/.bin/bower install"
"postinstall": "node_modules/bower/bin/bower install"
},
"author": "Edmund Fung",
"license": "MIT",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
link(rel="import", href="/static/common/bower/polymer/polymer.html")
link(rel="import", href="/app-render/framework/crouton-card/crouton-card.jade")


dom-module(id="crouton-video-youtube")
template
link(rel="stylesheet", href="crouton-video-youtube.css")
crouton-card
div.dragger
div.expand
iframe(src="{{youtubeURL}}" title="YouTube video player" allowfullscreen="1", class="style-scope google-youtube", id="player", frameborder="0", height="100%", width="100%")
div.titleDisplay {{displayStatusText}}

script.
(function() {
Polymer({
is: "crouton-video-youtube",
ready: function() {
},
properties: {
endPointJson: {
type: Object,
notify: true
}
},
attached: function(){
this.displayStatusText = this.endPointJson.title;
this.youtubeURL = "https://www.youtube.com/embed/" + this.endPointJson.values.youtubeID + "?playsinline=1&amp;controls=0&amp;autohide=0&amp;autoplay=1&amp;video-id=GZnb3jQ2YZo";
}
});
}());
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
@import "./public/common/css/style.less";

crouton-video-youtube{
width: @db-min-size;
min-width: @db-min-size;
height: @db-min-size;
min-height: @db-min-size;
display: table-row-group;

crouton-card {
text-align: center;
color: @fc-regular;

.expand {
margin: @dashboard-card-padding;
padding-top: @db-card-top-spacing;
}
}

.textDisplay {
font-size: @db-main-font-size;
margin-bottom: @db-space-under-main-text;
}

.unitDisplay {
font-size: @db-sub-font-size;
color: @fc-gray;
}

.titleDisplay {
font-size: @db-title-font-size;
bottom: @db-title-bottom;
left: 0px;
width: 100%;
position: absolute;
}
}
20 changes: 19 additions & 1 deletion public/app/documentation/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ Example:

</br> A simple line chart with multiple lines available. The *labels* corresponds to the x axis values and the *series* corresponds to the y axis values. Multiple sets of (x,y) values can be passed at once as long as the array length of labels and series are matched. The reason why series is multidimensional is so that multiple lines can be drawn where each array in series corresponds to a line. The *update* parameter is expected on update and holds a copy of *values* with the new *labels* and *series* within. *Max* refers to the maximum number of data points based on the x axis is shown. *low* and *high* refers to the maximum y values expected.

*It is suggested that labels and series be prepopulated with one set of (x,y) value for each line*
*It is suggested that labels and series be prepopulated with one set of (x,y) value for each line*

```json
Device -> Crouton
Expand Down Expand Up @@ -460,3 +460,21 @@ Example:
"title": "RGB Lights" [optional]
}
```

### Youtube Stream

![crouton-video-youtube](/static/common/images/crouton-video-youtube.png) </br> (Thank you [wickwire](https://github.com/wickwire) for this addition) </br> Add a Youtube video or livestream to your dashboard. This is great for having a dashboard of various security cameras.

```json
Device - Crouton
Name: crouton-video-youtube

Example:
"youTubeStream": {
"values": {
"youtubeID": "GZnb3jQ2YZo" [required]
},
"card-type": "crouton-video-youtube", [required]
"title": "YouTube Stream" [optional]
}
```
Loading

0 comments on commit 12c9fd2

Please sign in to comment.