Skip to content

Commit

Permalink
Add input binary sensors for switches (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
bieniu authored Jan 30, 2022
1 parent 7444998 commit 977009d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion python_scripts/shellies_discovery_gen2.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
KEY_VALUE_TEMPLATE: TPL_ENERGY,
}
DESCRIPTION_SENSOR_INPUT = {
KEY_ENABLED_BY_DEFAULT: True,
KEY_ENABLED_BY_DEFAULT: False,
KEY_STATE_TOPIC: TOPIC_INPUT,
KEY_VALUE_TEMPLATE: TPL_INPUT,
}
Expand Down Expand Up @@ -249,6 +249,7 @@
BUTTON_UPDATE_FIRMWARE: DESCRIPTION_UPDATE_FIRMWARE,
},
ATTR_INPUTS: 1,
ATTR_INPUT_BINARY_SENSORS: {SENSOR_INPUT: DESCRIPTION_SENSOR_INPUT},
ATTR_INPUT_EVENTS: [EVENT_SINGLE_PUSH, EVENT_DOUBLE_PUSH, EVENT_LONG_PUSH],
ATTR_RELAYS: 1,
ATTR_RELAY_BINARY_SENSORS: {SENSOR_OVERTEMP: DESCRIPTION_SENSOR_OVERTEMP},
Expand All @@ -260,6 +261,7 @@
BUTTON_UPDATE_FIRMWARE: DESCRIPTION_UPDATE_FIRMWARE,
},
ATTR_INPUTS: 1,
ATTR_INPUT_BINARY_SENSORS: {SENSOR_INPUT: DESCRIPTION_SENSOR_INPUT},
ATTR_INPUT_EVENTS: [EVENT_SINGLE_PUSH, EVENT_DOUBLE_PUSH, EVENT_LONG_PUSH],
ATTR_RELAYS: 1,
ATTR_RELAY_BINARY_SENSORS: {
Expand Down Expand Up @@ -292,6 +294,7 @@
BUTTON_UPDATE_FIRMWARE: DESCRIPTION_UPDATE_FIRMWARE,
},
ATTR_INPUTS: 1,
ATTR_INPUT_BINARY_SENSORS: {SENSOR_INPUT: DESCRIPTION_SENSOR_INPUT},
ATTR_INPUT_EVENTS: [EVENT_SINGLE_PUSH, EVENT_DOUBLE_PUSH, EVENT_LONG_PUSH],
ATTR_RELAYS: 1,
ATTR_RELAY_BINARY_SENSORS: {SENSOR_OVERTEMP: DESCRIPTION_SENSOR_OVERTEMP},
Expand All @@ -303,6 +306,7 @@
BUTTON_UPDATE_FIRMWARE: DESCRIPTION_UPDATE_FIRMWARE,
},
ATTR_INPUTS: 1,
ATTR_INPUT_BINARY_SENSORS: {SENSOR_INPUT: DESCRIPTION_SENSOR_INPUT},
ATTR_INPUT_EVENTS: [EVENT_SINGLE_PUSH, EVENT_DOUBLE_PUSH, EVENT_LONG_PUSH],
ATTR_RELAYS: 1,
ATTR_RELAY_BINARY_SENSORS: {
Expand All @@ -325,6 +329,7 @@
BUTTON_UPDATE_FIRMWARE: DESCRIPTION_UPDATE_FIRMWARE,
},
ATTR_INPUTS: 2,
ATTR_INPUT_BINARY_SENSORS: {SENSOR_INPUT: DESCRIPTION_SENSOR_INPUT},
ATTR_INPUT_EVENTS: [EVENT_SINGLE_PUSH, EVENT_DOUBLE_PUSH, EVENT_LONG_PUSH],
ATTR_RELAYS: 2,
ATTR_RELAY_BINARY_SENSORS: {SENSOR_OVERTEMP: DESCRIPTION_SENSOR_OVERTEMP},
Expand All @@ -336,6 +341,7 @@
BUTTON_UPDATE_FIRMWARE: DESCRIPTION_UPDATE_FIRMWARE,
},
ATTR_INPUTS: 2,
ATTR_INPUT_BINARY_SENSORS: {SENSOR_INPUT: DESCRIPTION_SENSOR_INPUT},
ATTR_INPUT_EVENTS: [EVENT_SINGLE_PUSH, EVENT_DOUBLE_PUSH, EVENT_LONG_PUSH],
ATTR_RELAYS: 2,
ATTR_RELAY_BINARY_SENSORS: {
Expand All @@ -358,6 +364,7 @@
BUTTON_UPDATE_FIRMWARE: DESCRIPTION_UPDATE_FIRMWARE,
},
ATTR_INPUTS: 4,
ATTR_INPUT_BINARY_SENSORS: {SENSOR_INPUT: DESCRIPTION_SENSOR_INPUT},
ATTR_INPUT_EVENTS: [EVENT_SINGLE_PUSH, EVENT_DOUBLE_PUSH, EVENT_LONG_PUSH],
ATTR_RELAYS: 4,
ATTR_RELAY_BINARY_SENSORS: {
Expand Down

0 comments on commit 977009d

Please sign in to comment.