pimatic / rfcontroljs

nodejs modul with protocol support for different 433mhz switches and weather stations for the RFControl Arduino library.
GNU General Public License v3.0
49 stars 54 forks source link

Support for weather sensor by german distributer TCM #60

Closed AnduriI closed 9 years ago

sweetpi commented 9 years ago

Hi @AnduriI,

thanks for the pull request. Please always edit the coffee files. The js files are generated from the coffee files by running gulp. Could you add the missing coffee files?

AnduriI commented 9 years ago

Hi @sweetpi,

I'm quite new to pimatic. To receive my weather sensors I just duplicated one of the weatherX.js and adopted it to fit my requirements. Could you please explain me how to do the "coffee things" needed? I never used coffee script.

sweetpi commented 9 years ago

No worries. Simply do the changes you have done to the js files for the coffee too. Coffeescript is just an alternative syntax for js (docs: http://coffeescript.org/). You can compile coffeescript to js by using gulp with the gulpscript which is part of the repo (docs: http://gulpjs.com/).

AnduriI commented 9 years ago

ok read a litte in the coffescript and gulp docs. But what coffee file to edit... ? I used the file in \pimatic-app\node_modules\pimatic-homeduino\node_modules\homeduino\node_modules\rfcontroljs\lib but there is no coffee file with content that looks like the protocols.

sweetpi commented 9 years ago

@AnduriI clone this repository instead and look in src instead of lib.

AnduriI commented 9 years ago

ok I created a new weather9.coffee and edited the controller.coffee same way as with the .js But I didn't get the compiling working. I'm a windows user, so not that familiar with all this linux stuff. Without step-by-step tutorial I wouldn't got pimatic working... :-) Maybe the compiling is not necessary or you can give me a good tut-link where to copy to files for compiling and so on?

sweetpi commented 9 years ago

Looks almost right, you can test compilation online: http://js2.coffee/.

Make sure you indent correctly (2 spaces)

AnduriI commented 9 years ago

OK I checked the idents, didn't knew that was important. Don't know how to exactly use the js2.coffe website. I tried with my js code, but this thing give me a complete different layout with variable definitons as t0 = undefined instead of the var t0 in js. Is it necessary in coffee to predefine your variables?

sweetpi commented 9 years ago

Is it necessary in coffee to predefine your variables?

no. I've fixed the indentions, merged and published your changes :)