Skip to content

Instantly share code, notes, and snippets.

View hi-im-milan's full-sized avatar

Milan Pandurov hi-im-milan

  • Zurich, Switzerland
View GitHub Profile
@hi-im-milan
hi-im-milan / countdown.cpp
Created February 8, 2015 14:39
CountdownCommand
void CountdownCommand::setCountdownValue(int _value){
value=_value;
}
int CountdownCommand::getCountdownValue() const {
return value;
}
/*Create template for object*/
Handle<ObjectTemplate> CountdownCommand::CreateTemplate(Isolate* isolate){
@hi-im-milan
hi-im-milan / countdowncommand
Created February 8, 2015 19:53
Exposing objects to JS example
void CountdownCommand::setCountdownValue(int _value){
value=_value;
}
int CountdownCommand::getCountdownValue() const {
return value;
}
string CountdownCommand::getName() const{
return "CountdownCommand";
@hi-im-milan
hi-im-milan / task1.js
Created February 14, 2015 23:08
JS test
var a=1;
var b=2;
var c=a+b;
function onRun(){
}
function onPause(){
}
Handle<Object> obj;
int argc;
Handle<Value> argv[argc];
if (resp!=NULL){
if (messageFactory->hasObject(resp->getName())){
obj=messageFactory->wrapObject(resp->getName(),getIsolate(),resp);
argc=1;
argv[0]=obj;
}else{
argc=0;
blueprint:
name: ZHA - Philips Hue Dimmer Switch Config - V2024.11.28 - milan
description: |
Control lights with a Philips Hue Dimmer Switch (only RWL020 (US) and RWL021 (EU), RWL022, the one that says 'hue' on the bottom, has a different button layout.)
This blueprint is a simplified version of stefanroelofs's `ZHA - Philis Hue Dimmer Switch V2', but this one has no default inputs and with full configuration available. This makes the remote easily configurable for purposes other than controlling lights.
If you are intending to just use it for use as a light switch, I recommend using his blueprint, which you can find at https://gist.github.com/stefanroelofs/775e2e0a3cdb3d72a9451fb247492d59
It includes customizable 'on' button behaviour and default setup of the dimmer buttons to dim as they normally would. To make the configuration available for other automations, I had to remove these very useful functionalities.