示例#1
0
void arctechDimInit(void) {

	protocol_register(&arctech_dimmer);
	protocol_set_id(arctech_dimmer, "arctech_dimmers");
	protocol_device_add(arctech_dimmer, "kaku_dimmer", "KlikAanKlikUit Dimmers");
	protocol_conflict_add(arctech_dimmer, "arctech_contact");
	protocol_plslen_add(arctech_dimmer, 300);
	arctech_dimmer->devtype = DIMMER;
	arctech_dimmer->hwtype = RF433;
	arctech_dimmer->pulse = 5;
	arctech_dimmer->rawlen = 148;
	arctech_dimmer->lsb = 3;

	options_add(&arctech_dimmer->options, 'd', "dimlevel", has_value, config_value, "^([0-9]{1}|[1][0-5])$");
	options_add(&arctech_dimmer->options, 'a', "all", no_value, 0, NULL);
	options_add(&arctech_dimmer->options, 'u', "unit", has_value, config_id, "^([0-9]{1}|[1][0-5])$");
	options_add(&arctech_dimmer->options, 'i', "id", has_value, config_id, "^([0-9]{1,7}|[1-5][0-9]{7}|6([0-6][0-9]{6}|7(0[0-9]{5}|10([0-7][0-9]{3}|8([0-7][0-9]{2}|8([0-5][0-9]|6[0-3]))))))$");
	options_add(&arctech_dimmer->options, 't', "on", no_value, config_state, NULL);
	options_add(&arctech_dimmer->options, 'f', "off", no_value, config_state, NULL);
	
	protocol_setting_add_number(arctech_dimmer, "min", 0);
	protocol_setting_add_number(arctech_dimmer, "max", 15);
	protocol_setting_add_string(arctech_dimmer, "states", "on,off");
	protocol_setting_add_number(arctech_dimmer, "readonly", 0);

	arctech_dimmer->parseBinary=&arctechDimParseBinary;
	arctech_dimmer->createCode=&arctechDimCreateCode;
	arctech_dimmer->printHelp=&arctechDimPrintHelp;
	arctech_dimmer->checkValues=&arctechDimCheckValues;
}
示例#2
0
void arctechSwInit(void) {

	protocol_register(&arctech_switch);
	protocol_set_id(arctech_switch, "archtech_switches");
	protocol_device_add(arctech_switch, "kaku_switch", "KlikAanKlikUit Switches");
	protocol_device_add(arctech_switch, "dio_switch", "D-IO (Chacon) Switches");
	protocol_device_add(arctech_switch, "nexa_switch", "Nexa Switches");
	protocol_device_add(arctech_switch, "coco_switch", "CoCo Technologies Switches");
	protocol_device_add(arctech_switch, "intertechno_switch", "Intertechno Switches");
	protocol_conflict_add(arctech_switch, "archtech_screens");
	protocol_plslen_add(arctech_switch, 303);
	protocol_plslen_add(arctech_switch, 251);
	arctech_switch->devtype = SWITCH;
	arctech_switch->hwtype = RX433;
	arctech_switch->pulse = 5;
	arctech_switch->rawlen = 132;
	arctech_switch->lsb = 3;

	options_add(&arctech_switch->options, 'a', "all", no_value, 0, NULL);
	options_add(&arctech_switch->options, 't', "on", no_value, config_state, NULL);
	options_add(&arctech_switch->options, 'f', "off", no_value, config_state, NULL);
	options_add(&arctech_switch->options, 'u', "unit", has_value, config_id, "^([0-9]{1}|[1][0-5])$");
	options_add(&arctech_switch->options, 'i', "id", has_value, config_id, "^([0-9]{1,7}|[1-5][0-9]{7}|6([0-6][0-9]{6}|7(0[0-9]{5}|10([0-7][0-9]{3}|8([0-7][0-9]{2}|8([0-5][0-9]|6[0-3]))))))$");

	protocol_setting_add_string(arctech_switch, "states", "on,off");
	protocol_setting_add_number(arctech_switch, "readonly", 0);
	
	arctech_switch->parseBinary=&arctechSwParseBinary;
	arctech_switch->createCode=&arctechSwCreateCode;
	arctech_switch->printHelp=&arctechSwPrintHelp;
}
示例#3
0
文件: impuls.c 项目: pschmitt/pilight
void impulsInit(void) {

	protocol_register(&impuls);
	protocol_set_id(impuls, "impuls");
	protocol_device_add(impuls, "impuls", "Impuls Switches");
	protocol_device_add(impuls, "select-remote", "SelectRemote Switches");
	protocol_plslen_add(impuls, 133);
	impuls->devtype = SWITCH;
	impuls->hwtype = RX433;
	impuls->pulse = 3;
	impuls->rawlen = 50;
	impuls->binlen = 12;

	options_add(&impuls->options, 's', "systemcode", has_value, config_id, "^(3[012]?|[012][0-9]|[0-9]{1})$");
	options_add(&impuls->options, 'u', "programcode", has_value, config_id, "^(3[012]?|[012][0-9]|[0-9]{1})$");
	options_add(&impuls->options, 't', "on", no_value, config_state, NULL);
	options_add(&impuls->options, 'f', "off", no_value, config_state, NULL);

	protocol_setting_add_string(impuls, "states", "on,off");
	protocol_setting_add_number(impuls, "readonly", 0);

	impuls->parseCode=&impulsParseCode;
	impuls->createCode=&impulsCreateCode;
	impuls->printHelp=&impulsPrintHelp;
}
示例#4
0
void homeEasyOldInit(void) {

	protocol_register(&home_easy_old);
	protocol_set_id(home_easy_old, "home_easy_old");
	protocol_device_add(home_easy_old, "home_easy_old", "Old Home Easy Switches");
	protocol_plslen_add(home_easy_old, 289);
	home_easy_old->devtype = SWITCH;
	home_easy_old->hwtype = RF433;
	home_easy_old->pulse = 3;
	home_easy_old->rawlen = 50;
	home_easy_old->binlen = 12;
	home_easy_old->lsb = 3;

	options_add(&home_easy_old->options, 's', "systemcode", has_value, config_id, "^(3[012]?|[012][0-9]|[0-9]{1})$");
	options_add(&home_easy_old->options, 'u', "unitcode", has_value, config_id, "^(3[012]?|[012][0-9]|[0-9]{1})$");
	options_add(&home_easy_old->options, 'a', "all", no_value, config_state, NULL);
	options_add(&home_easy_old->options, 't', "on", no_value, config_state, NULL);
	options_add(&home_easy_old->options, 'f', "off", no_value, config_state, NULL);

	protocol_setting_add_string(home_easy_old, "states", "on,off");	
	protocol_setting_add_number(home_easy_old, "readonly", 0);
	
	home_easy_old->parseBinary=&homeEasyOldParseBinary;
	home_easy_old->createCode=&homeEasyOldCreateCode;
	home_easy_old->printHelp=&homeEasyOldPrintHelp;
}
示例#5
0
void genSwitchInit(void) {

	protocol_register(&generic_switch);
	protocol_set_id(generic_switch, "generic_switch");
	protocol_device_add(generic_switch, "generic_switch", "Generic Switches");
	generic_switch->devtype = SWITCH;

	options_add(&generic_switch->options, 't', "on", no_value, config_state, NULL);
	options_add(&generic_switch->options, 'f', "off", no_value, config_state, NULL);
	options_add(&generic_switch->options, 'i', "id", has_value, config_id, "^([0-9]{1,})$");

	protocol_setting_add_string(generic_switch, "states", "on,off");
	protocol_setting_add_number(generic_switch, "readonly", 1);

	generic_switch->printHelp=&genSwitchPrintHelp;
	generic_switch->createCode=&genSwitchCreateCode;
}
示例#6
0
文件: relay.c 项目: 1000io/pilight
void relayInit(void) {

	protocol_register(&relay);
	protocol_set_id(relay, "relay");
	protocol_device_add(relay, "relay", "GPIO Connected Relays");
	relay->devtype = RELAY;
	relay->hwtype = HWRELAY;

	options_add(&relay->options, 't', "on", no_value, config_state, NULL);
	options_add(&relay->options, 'f', "off", no_value, config_state, NULL);
	options_add(&relay->options, 'g', "gpio", has_value, config_id, "^([0-9]{1}|1[0-9]|20)$");

	protocol_setting_add_string(relay, "default", "off");
	protocol_setting_add_string(relay, "states", "on,off");
	protocol_setting_add_number(relay, "readonly", 0);
	
	relay->createCode=&relayCreateCode;
	relay->printHelp=&relayPrintHelp;
}
示例#7
0
void conradRSLCnInit(void) {

	protocol_register(&conrad_rsl_contact);
	protocol_set_id(conrad_rsl_contact, "conrad_rsl_contact");
	protocol_device_add(conrad_rsl_contact, "conrad_rsl_contact", "Conrad RSL Contact Sensor");
	protocol_plslen_add(conrad_rsl_contact, 190);
	conrad_rsl_contact->devtype = SWITCH;
	conrad_rsl_contact->hwtype = RF433;
	conrad_rsl_contact->pulse = 5;
	conrad_rsl_contact->rawlen = 66;
	conrad_rsl_contact->binlen = 33;

	options_add(&conrad_rsl_contact->options, 'i', "id", has_value, config_id, "^(([0-9]|([1-9][0-9])|([1-9][0-9]{2})|([1-9][0-9]{3})|([1-9][0-9]{4})|([1-9][0-9]{5})|([1-9][0-9]{6})|((6710886[0-3])|(671088[0-5][0-9])|(67108[0-7][0-9]{2})|(6710[0-7][0-9]{3})|(671[0--1][0-9]{4})|(670[0-9]{5})|(6[0-6][0-9]{6})|(0[0-5][0-9]{7}))))$");
	options_add(&conrad_rsl_contact->options, 't', "opened", no_value, config_state, NULL);
	options_add(&conrad_rsl_contact->options, 'f', "closed", no_value, config_state, NULL);

	protocol_setting_add_string(conrad_rsl_contact, "states", "opened,closed");
	protocol_setting_add_number(conrad_rsl_contact, "readonly", 1);

	conrad_rsl_contact->parseCode=&conradRSLCnParseCode;
}