Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions Thermostat/web-service/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<script src="https://www.gstatic.com/firebasejs/3.4.1/firebase.js"></script>
<script>
// Initialize Firebase
var config = {
apiKey: "AIzaSyCbypyfXPs0URlzy6N8Wo8EGZ_4xk4Eby4",
authDomain: "thermostat-1d90c.firebaseapp.com",
databaseURL: "https://thermostat-1d90c.firebaseio.com",
storageBucket: "thermostat-1d90c.appspot.com",
messagingSenderId: "1038669911500"
};
var mainApp = firebase.initializeApp(config);
var tempRef = firebase.database().ref('temp/');
tempRef.on('value', function(shapshot) {
onNewTemp(shapshot.val());
});
pushNewTemp = function(temp){
tempRef.set(temp);
}
onNewTemp = function(temp){
console.log(temp);
//Your code here
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@silvan9145 this method will be called whenever the value changes on the server. So if you put code here to update your website we should be good. Let me know if your having any troubles. With this or with git. I've put this on a new branch so you'll have to checkout this branch. Feel free to ping me.

}
</script>