Skip to content

Commit

Permalink
Update dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk committed Aug 4, 2018
1 parent 5a4ee32 commit 85be7b4
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 36 deletions.
4 changes: 1 addition & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
},
"extends": ["eslint:recommended", "google"],
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true
},
"ecmaVersion": 6,
"sourceType": "module"
},
"rules": {
Expand Down
36 changes: 18 additions & 18 deletions lib/homeassistant.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,28 +191,21 @@ const configurations = {
command_topic: true,
},
},
'switch_left': {
type: 'switch',
object_id: 'switch_left',
discovery_payload: {
payload_off: 'OFF',
payload_on: 'ON',
value_template: '{{ value_json.state_left }}',
command_topic: true,
command_topic_prefix: 'left',
},
},
'switch_right': {
};

const switchWithPostfix = (postfix) => {
return {
type: 'switch',
object_id: 'switch_right',
object_id: `switch_${postfix}`,
discovery_payload: {
payload_off: 'OFF',
payload_on: 'ON',
value_template: '{{ value_json.state_right }}',
value_template: `{{ value_json.state_${postfix} }}`,
command_topic: true,
command_topic_prefix: 'right',
command_topic_prefix: postfix,
json_attributes: [`button_${postfix}`],
},
},
};
};

// Map homeassitant configurations to devices.
Expand All @@ -223,7 +216,7 @@ const mapping = {
'WXKG03LM': [configurations.sensor_click],
'WXKG02LM': [configurations.sensor_click],
'QBKG04LM': [configurations.switch],
'QBKG03LM': [configurations.switch_left, configurations.switch_right],
'QBKG03LM': [switchWithPostfix('left'), switchWithPostfix('right')],
'WSDCGQ01LM': [configurations.sensor_temperature, configurations.sensor_humidity],
'WSDCGQ11LM': [configurations.sensor_temperature, configurations.sensor_humidity, configurations.sensor_pressure],
'RTCGQ01LM': [configurations.binary_sensor_occupancy],
Expand Down Expand Up @@ -281,7 +274,7 @@ const mapping = {
'SL 110 W': [configurations.light_brightness],
'AA68199': [configurations.light_brightness_colortemp],
'QBKG11LM': [configurations.switch, configurations.sensor_power],
'QBKG12LM': [configurations.switch_left, configurations.switch_right, configurations.sensor_power],
'QBKG12LM': [switchWithPostfix('left'), switchWithPostfix('right'), configurations.sensor_power],
'K2RGBW01': [configurations.light_brightness_colortemp_xy],
'9290011370': [configurations.light_brightness],
'DNCKATSW001': [configurations.switch],
Expand All @@ -300,6 +293,13 @@ const mapping = {
'AC03641': [configurations.light_brightness],
'FB56+ZSW05HG1.2': [configurations.switch],
'72922-A': [configurations.switch],
'AC03642': [configurations.light_brightness_colortemp],
'DNCKATSW002': [switchWithPostfix('left'), switchWithPostfix('right')],
'DNCKATSW003': [switchWithPostfix('left'), switchWithPostfix('right'), switchWithPostfix('center')],
'DNCKATSW004': [
switchWithPostfix('bottom_left'), switchWithPostfix('bottom_right'),
switchWithPostfix('top_left'), switchWithPostfix('top_right'),
],
};

// A map of all discoverd devices
Expand Down
30 changes: 15 additions & 15 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 85be7b4

Please sign in to comment.