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

Added switch23 to support "POWER Remote / Steffen 1204380" #77

Closed TheRaspyDev closed 8 years ago

TheRaspyDev commented 8 years ago

Works with my Power Remote.

TheRaspyDev commented 8 years ago

The states of the DIP switches used for the HouseCode which are transmitted inversed in the protocol. To make the configuration of the HouseCode more intuitive, the inverted functions are used.

E.g. DIP switches of the HouseCode is UP,DOWN,DOWN,DOWN,UP (5 DIP switches). The HouseCode is transmitted as 01110 instead of 10001 -> The inverted function corrects this behaviour by giving the correct binary representation of the HouseCode. This simplifies the configuration for the user. -> 01110 will be interpreted as 17 which represents the "binary" states of the DIP switches.

Icesory commented 8 years ago

Instead do write a extra function you can use a second bit mapping with inverted states.

TheRaspyDev commented 8 years ago

Can you give me an example?

sweetpi commented 8 years ago

@TheRaspyDev You can use this:

binaryInverted = helper.map(binary, {'0': '1', '1': '0'});

Then use binaryInverted for the housecode and we can rid of the inverted helper functions.

TheRaspyDev commented 8 years ago

Created a new fork and pull request as there are too many changes to merge my three month old code. In the new pull request my switch is "switch 24" because "switch 23" was already used in the meantime by another developer.