2017-03-14 23:55:33 +00:00
|
|
|
"""Zwave discovery schemas."""
|
|
|
|
from . import const
|
|
|
|
|
2017-03-23 15:37:20 +00:00
|
|
|
DEFAULT_VALUES_SCHEMA = {
|
2017-03-14 23:55:33 +00:00
|
|
|
'power': {
|
2017-06-14 12:41:20 +00:00
|
|
|
const.DISC_SCHEMAS: [
|
|
|
|
{const.DISC_COMMAND_CLASS: [const.COMMAND_CLASS_SENSOR_MULTILEVEL],
|
|
|
|
const.DISC_INDEX: [const.INDEX_SENSOR_MULTILEVEL_POWER]},
|
|
|
|
{const.DISC_COMMAND_CLASS: [const.COMMAND_CLASS_METER],
|
|
|
|
const.DISC_INDEX: [const.INDEX_METER_POWER]},
|
|
|
|
],
|
2017-03-14 23:55:33 +00:00
|
|
|
const.DISC_OPTIONAL: True,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
DISCOVERY_SCHEMAS = [
|
|
|
|
{const.DISC_COMPONENT: 'binary_sensor',
|
|
|
|
const.DISC_GENERIC_DEVICE_CLASS: [
|
2018-03-07 08:29:24 +00:00
|
|
|
const.GENERIC_TYPE_ENTRY_CONTROL,
|
2017-03-14 23:55:33 +00:00
|
|
|
const.GENERIC_TYPE_SENSOR_ALARM,
|
|
|
|
const.GENERIC_TYPE_SENSOR_BINARY,
|
|
|
|
const.GENERIC_TYPE_SWITCH_BINARY,
|
|
|
|
const.GENERIC_TYPE_METER,
|
|
|
|
const.GENERIC_TYPE_SENSOR_MULTILEVEL,
|
|
|
|
const.GENERIC_TYPE_SWITCH_MULTILEVEL,
|
|
|
|
const.GENERIC_TYPE_SENSOR_NOTIFICATION,
|
|
|
|
const.GENERIC_TYPE_THERMOSTAT],
|
2017-03-23 15:37:20 +00:00
|
|
|
const.DISC_VALUES: dict(DEFAULT_VALUES_SCHEMA, **{
|
2017-03-14 23:55:33 +00:00
|
|
|
const.DISC_PRIMARY: {
|
|
|
|
const.DISC_COMMAND_CLASS: [const.COMMAND_CLASS_SENSOR_BINARY],
|
|
|
|
const.DISC_TYPE: const.TYPE_BOOL,
|
2017-08-06 15:31:32 +00:00
|
|
|
const.DISC_GENRE: const.GENRE_USER,
|
|
|
|
},
|
|
|
|
'off_delay': {
|
|
|
|
const.DISC_COMMAND_CLASS: [const.COMMAND_CLASS_CONFIGURATION],
|
|
|
|
const.DISC_INDEX: [9],
|
|
|
|
const.DISC_OPTIONAL: True,
|
2017-03-14 23:55:33 +00:00
|
|
|
}})},
|
|
|
|
{const.DISC_COMPONENT: 'climate',
|
2018-07-18 10:20:02 +00:00
|
|
|
const.DISC_GENERIC_DEVICE_CLASS: [
|
|
|
|
const.GENERIC_TYPE_THERMOSTAT,
|
|
|
|
const.GENERIC_TYPE_SENSOR_MULTILEVEL],
|
2017-03-23 15:37:20 +00:00
|
|
|
const.DISC_VALUES: dict(DEFAULT_VALUES_SCHEMA, **{
|
2017-03-14 23:55:33 +00:00
|
|
|
const.DISC_PRIMARY: {
|
|
|
|
const.DISC_COMMAND_CLASS: [
|
|
|
|
const.COMMAND_CLASS_THERMOSTAT_SETPOINT],
|
|
|
|
},
|
|
|
|
'temperature': {
|
|
|
|
const.DISC_COMMAND_CLASS: [const.COMMAND_CLASS_SENSOR_MULTILEVEL],
|
2017-06-14 12:41:20 +00:00
|
|
|
const.DISC_INDEX: [const.INDEX_SENSOR_MULTILEVEL_TEMPERATURE],
|
2017-03-14 23:55:33 +00:00
|
|
|
const.DISC_OPTIONAL: True,
|
|
|
|
},
|
|
|
|
'mode': {
|
|
|
|
const.DISC_COMMAND_CLASS: [const.COMMAND_CLASS_THERMOSTAT_MODE],
|
|
|
|
const.DISC_OPTIONAL: True,
|
|
|
|
},
|
|
|
|
'fan_mode': {
|
|
|
|
const.DISC_COMMAND_CLASS: [
|
|
|
|
const.COMMAND_CLASS_THERMOSTAT_FAN_MODE],
|
|
|
|
const.DISC_OPTIONAL: True,
|
|
|
|
},
|
|
|
|
'operating_state': {
|
|
|
|
const.DISC_COMMAND_CLASS: [
|
|
|
|
const.COMMAND_CLASS_THERMOSTAT_OPERATING_STATE],
|
|
|
|
const.DISC_OPTIONAL: True,
|
|
|
|
},
|
|
|
|
'fan_state': {
|
|
|
|
const.DISC_COMMAND_CLASS: [
|
|
|
|
const.COMMAND_CLASS_THERMOSTAT_FAN_STATE],
|
|
|
|
const.DISC_OPTIONAL: True,
|
|
|
|
},
|
|
|
|
'zxt_120_swing_mode': {
|
|
|
|
const.DISC_COMMAND_CLASS: [const.COMMAND_CLASS_CONFIGURATION],
|
|
|
|
const.DISC_INDEX: [33],
|
|
|
|
const.DISC_OPTIONAL: True,
|
|
|
|
}})},
|
|
|
|
{const.DISC_COMPONENT: 'cover', # Rollershutter
|
|
|
|
const.DISC_GENERIC_DEVICE_CLASS: [
|
|
|
|
const.GENERIC_TYPE_SWITCH_MULTILEVEL,
|
|
|
|
const.GENERIC_TYPE_ENTRY_CONTROL],
|
|
|
|
const.DISC_SPECIFIC_DEVICE_CLASS: [
|
|
|
|
const.SPECIFIC_TYPE_CLASS_A_MOTOR_CONTROL,
|
|
|
|
const.SPECIFIC_TYPE_CLASS_B_MOTOR_CONTROL,
|
|
|
|
const.SPECIFIC_TYPE_CLASS_C_MOTOR_CONTROL,
|
|
|
|
const.SPECIFIC_TYPE_MOTOR_MULTIPOSITION,
|
|
|
|
const.SPECIFIC_TYPE_SECURE_BARRIER_ADDON,
|
|
|
|
const.SPECIFIC_TYPE_SECURE_DOOR],
|
2017-03-23 15:37:20 +00:00
|
|
|
const.DISC_VALUES: dict(DEFAULT_VALUES_SCHEMA, **{
|
2017-03-14 23:55:33 +00:00
|
|
|
const.DISC_PRIMARY: {
|
|
|
|
const.DISC_COMMAND_CLASS: [const.COMMAND_CLASS_SWITCH_MULTILEVEL],
|
|
|
|
const.DISC_GENRE: const.GENRE_USER,
|
|
|
|
},
|
|
|
|
'open': {
|
|
|
|
const.DISC_COMMAND_CLASS: [const.COMMAND_CLASS_SWITCH_MULTILEVEL],
|
2017-06-14 12:41:20 +00:00
|
|
|
const.DISC_INDEX: [const.INDEX_SWITCH_MULTILEVEL_BRIGHT],
|
2017-03-14 23:55:33 +00:00
|
|
|
const.DISC_OPTIONAL: True,
|
|
|
|
},
|
|
|
|
'close': {
|
|
|
|
const.DISC_COMMAND_CLASS: [const.COMMAND_CLASS_SWITCH_MULTILEVEL],
|
2017-06-14 12:41:20 +00:00
|
|
|
const.DISC_INDEX: [const.INDEX_SWITCH_MULTILEVEL_DIM],
|
2017-03-14 23:55:33 +00:00
|
|
|
const.DISC_OPTIONAL: True,
|
|
|
|
}})},
|
2017-07-30 04:40:56 +00:00
|
|
|
{const.DISC_COMPONENT: 'cover', # Garage Door Switch
|
2017-03-14 23:55:33 +00:00
|
|
|
const.DISC_GENERIC_DEVICE_CLASS: [
|
|
|
|
const.GENERIC_TYPE_SWITCH_MULTILEVEL,
|
|
|
|
const.GENERIC_TYPE_ENTRY_CONTROL],
|
|
|
|
const.DISC_SPECIFIC_DEVICE_CLASS: [
|
|
|
|
const.SPECIFIC_TYPE_CLASS_A_MOTOR_CONTROL,
|
|
|
|
const.SPECIFIC_TYPE_CLASS_B_MOTOR_CONTROL,
|
|
|
|
const.SPECIFIC_TYPE_CLASS_C_MOTOR_CONTROL,
|
|
|
|
const.SPECIFIC_TYPE_MOTOR_MULTIPOSITION,
|
|
|
|
const.SPECIFIC_TYPE_SECURE_BARRIER_ADDON,
|
|
|
|
const.SPECIFIC_TYPE_SECURE_DOOR],
|
2017-03-23 15:37:20 +00:00
|
|
|
const.DISC_VALUES: dict(DEFAULT_VALUES_SCHEMA, **{
|
2017-03-14 23:55:33 +00:00
|
|
|
const.DISC_PRIMARY: {
|
2017-07-30 04:40:56 +00:00
|
|
|
const.DISC_COMMAND_CLASS: [const.COMMAND_CLASS_SWITCH_BINARY],
|
2017-03-14 23:55:33 +00:00
|
|
|
const.DISC_GENRE: const.GENRE_USER,
|
|
|
|
}})},
|
2017-07-30 04:40:56 +00:00
|
|
|
{const.DISC_COMPONENT: 'cover', # Garage Door Barrier
|
|
|
|
const.DISC_GENERIC_DEVICE_CLASS: [
|
|
|
|
const.GENERIC_TYPE_SWITCH_MULTILEVEL,
|
|
|
|
const.GENERIC_TYPE_ENTRY_CONTROL],
|
|
|
|
const.DISC_SPECIFIC_DEVICE_CLASS: [
|
|
|
|
const.SPECIFIC_TYPE_CLASS_A_MOTOR_CONTROL,
|
|
|
|
const.SPECIFIC_TYPE_CLASS_B_MOTOR_CONTROL,
|
|
|
|
const.SPECIFIC_TYPE_CLASS_C_MOTOR_CONTROL,
|
|
|
|
const.SPECIFIC_TYPE_MOTOR_MULTIPOSITION,
|
|
|
|
const.SPECIFIC_TYPE_SECURE_BARRIER_ADDON,
|
|
|
|
const.SPECIFIC_TYPE_SECURE_DOOR],
|
|
|
|
const.DISC_VALUES: dict(DEFAULT_VALUES_SCHEMA, **{
|
|
|
|
const.DISC_PRIMARY: {
|
|
|
|
const.DISC_COMMAND_CLASS: [const.COMMAND_CLASS_BARRIER_OPERATOR],
|
|
|
|
const.DISC_INDEX: [const.INDEX_BARRIER_OPERATOR_LABEL],
|
|
|
|
}})},
|
2017-07-29 20:24:15 +00:00
|
|
|
{const.DISC_COMPONENT: 'fan',
|
|
|
|
const.DISC_GENERIC_DEVICE_CLASS: [
|
|
|
|
const.GENERIC_TYPE_SWITCH_MULTILEVEL],
|
|
|
|
const.DISC_SPECIFIC_DEVICE_CLASS: [
|
|
|
|
const.SPECIFIC_TYPE_FAN_SWITCH],
|
|
|
|
const.DISC_VALUES: dict(DEFAULT_VALUES_SCHEMA, **{
|
|
|
|
const.DISC_PRIMARY: {
|
|
|
|
const.DISC_COMMAND_CLASS: [const.COMMAND_CLASS_SWITCH_MULTILEVEL],
|
|
|
|
const.DISC_INDEX: [const.INDEX_SWITCH_MULTILEVEL_LEVEL],
|
|
|
|
const.DISC_TYPE: const.TYPE_BYTE,
|
|
|
|
}})},
|
2017-03-14 23:55:33 +00:00
|
|
|
{const.DISC_COMPONENT: 'light',
|
|
|
|
const.DISC_GENERIC_DEVICE_CLASS: [
|
|
|
|
const.GENERIC_TYPE_SWITCH_MULTILEVEL,
|
|
|
|
const.GENERIC_TYPE_SWITCH_REMOTE],
|
|
|
|
const.DISC_SPECIFIC_DEVICE_CLASS: [
|
|
|
|
const.SPECIFIC_TYPE_POWER_SWITCH_MULTILEVEL,
|
|
|
|
const.SPECIFIC_TYPE_SCENE_SWITCH_MULTILEVEL,
|
|
|
|
const.SPECIFIC_TYPE_NOT_USED],
|
2017-03-23 15:37:20 +00:00
|
|
|
const.DISC_VALUES: dict(DEFAULT_VALUES_SCHEMA, **{
|
2017-03-14 23:55:33 +00:00
|
|
|
const.DISC_PRIMARY: {
|
|
|
|
const.DISC_COMMAND_CLASS: [const.COMMAND_CLASS_SWITCH_MULTILEVEL],
|
2017-06-14 12:41:20 +00:00
|
|
|
const.DISC_INDEX: [const.INDEX_SWITCH_MULTILEVEL_LEVEL],
|
2017-03-14 23:55:33 +00:00
|
|
|
const.DISC_TYPE: const.TYPE_BYTE,
|
|
|
|
},
|
2017-04-03 18:56:48 +00:00
|
|
|
'dimming_duration': {
|
|
|
|
const.DISC_COMMAND_CLASS: [const.COMMAND_CLASS_SWITCH_MULTILEVEL],
|
2017-06-14 12:41:20 +00:00
|
|
|
const.DISC_INDEX: [const.INDEX_SWITCH_MULTILEVEL_DURATION],
|
2017-04-03 18:56:48 +00:00
|
|
|
const.DISC_OPTIONAL: True,
|
|
|
|
},
|
2017-03-14 23:55:33 +00:00
|
|
|
'color': {
|
|
|
|
const.DISC_COMMAND_CLASS: [const.COMMAND_CLASS_SWITCH_COLOR],
|
2017-06-14 12:41:20 +00:00
|
|
|
const.DISC_INDEX: [const.INDEX_SWITCH_COLOR_COLOR],
|
2017-03-14 23:55:33 +00:00
|
|
|
const.DISC_OPTIONAL: True,
|
|
|
|
},
|
|
|
|
'color_channels': {
|
|
|
|
const.DISC_COMMAND_CLASS: [const.COMMAND_CLASS_SWITCH_COLOR],
|
2017-06-14 12:41:20 +00:00
|
|
|
const.DISC_INDEX: [const.INDEX_SWITCH_COLOR_CHANNELS],
|
2017-03-14 23:55:33 +00:00
|
|
|
const.DISC_OPTIONAL: True,
|
|
|
|
}})},
|
|
|
|
{const.DISC_COMPONENT: 'lock',
|
|
|
|
const.DISC_GENERIC_DEVICE_CLASS: [const.GENERIC_TYPE_ENTRY_CONTROL],
|
|
|
|
const.DISC_SPECIFIC_DEVICE_CLASS: [
|
2018-08-06 09:10:26 +00:00
|
|
|
const.SPECIFIC_TYPE_DOOR_LOCK,
|
2017-03-14 23:55:33 +00:00
|
|
|
const.SPECIFIC_TYPE_ADVANCED_DOOR_LOCK,
|
2018-03-07 08:29:24 +00:00
|
|
|
const.SPECIFIC_TYPE_SECURE_KEYPAD_DOOR_LOCK,
|
|
|
|
const.SPECIFIC_TYPE_SECURE_LOCKBOX],
|
2017-03-23 15:37:20 +00:00
|
|
|
const.DISC_VALUES: dict(DEFAULT_VALUES_SCHEMA, **{
|
2017-03-14 23:55:33 +00:00
|
|
|
const.DISC_PRIMARY: {
|
|
|
|
const.DISC_COMMAND_CLASS: [const.COMMAND_CLASS_DOOR_LOCK],
|
2017-06-14 12:41:20 +00:00
|
|
|
const.DISC_INDEX: [const.INDEX_DOOR_LOCK_LOCK],
|
2017-03-14 23:55:33 +00:00
|
|
|
},
|
|
|
|
'access_control': {
|
|
|
|
const.DISC_COMMAND_CLASS: [const.COMMAND_CLASS_ALARM],
|
2017-06-14 12:41:20 +00:00
|
|
|
const.DISC_INDEX: [const.INDEX_ALARM_ACCESS_CONTROL],
|
2017-03-14 23:55:33 +00:00
|
|
|
const.DISC_OPTIONAL: True,
|
|
|
|
},
|
|
|
|
'alarm_type': {
|
|
|
|
const.DISC_COMMAND_CLASS: [const.COMMAND_CLASS_ALARM],
|
2017-06-14 12:41:20 +00:00
|
|
|
const.DISC_INDEX: [const.INDEX_ALARM_TYPE],
|
2017-03-14 23:55:33 +00:00
|
|
|
const.DISC_OPTIONAL: True,
|
|
|
|
},
|
|
|
|
'alarm_level': {
|
|
|
|
const.DISC_COMMAND_CLASS: [const.COMMAND_CLASS_ALARM],
|
2017-06-14 12:41:20 +00:00
|
|
|
const.DISC_INDEX: [const.INDEX_ALARM_LEVEL],
|
2017-03-14 23:55:33 +00:00
|
|
|
const.DISC_OPTIONAL: True,
|
|
|
|
},
|
|
|
|
'v2btze_advanced': {
|
|
|
|
const.DISC_COMMAND_CLASS: [const.COMMAND_CLASS_CONFIGURATION],
|
|
|
|
const.DISC_INDEX: [12],
|
|
|
|
const.DISC_OPTIONAL: True,
|
|
|
|
}})},
|
|
|
|
{const.DISC_COMPONENT: 'sensor',
|
2017-03-23 15:37:20 +00:00
|
|
|
const.DISC_VALUES: dict(DEFAULT_VALUES_SCHEMA, **{
|
2017-03-14 23:55:33 +00:00
|
|
|
const.DISC_PRIMARY: {
|
|
|
|
const.DISC_COMMAND_CLASS: [
|
|
|
|
const.COMMAND_CLASS_SENSOR_MULTILEVEL,
|
|
|
|
const.COMMAND_CLASS_METER,
|
|
|
|
const.COMMAND_CLASS_ALARM,
|
2018-09-27 10:34:42 +00:00
|
|
|
const.COMMAND_CLASS_SENSOR_ALARM,
|
|
|
|
const.COMMAND_CLASS_INDICATOR],
|
2017-03-14 23:55:33 +00:00
|
|
|
const.DISC_GENRE: const.GENRE_USER,
|
|
|
|
}})},
|
|
|
|
{const.DISC_COMPONENT: 'switch',
|
|
|
|
const.DISC_GENERIC_DEVICE_CLASS: [
|
2018-06-09 13:34:36 +00:00
|
|
|
const.GENERIC_TYPE_METER,
|
2017-03-14 23:55:33 +00:00
|
|
|
const.GENERIC_TYPE_SENSOR_ALARM,
|
|
|
|
const.GENERIC_TYPE_SENSOR_BINARY,
|
|
|
|
const.GENERIC_TYPE_SWITCH_BINARY,
|
|
|
|
const.GENERIC_TYPE_ENTRY_CONTROL,
|
|
|
|
const.GENERIC_TYPE_SENSOR_MULTILEVEL,
|
|
|
|
const.GENERIC_TYPE_SWITCH_MULTILEVEL,
|
|
|
|
const.GENERIC_TYPE_SENSOR_NOTIFICATION,
|
|
|
|
const.GENERIC_TYPE_GENERIC_CONTROLLER,
|
|
|
|
const.GENERIC_TYPE_SWITCH_REMOTE,
|
|
|
|
const.GENERIC_TYPE_REPEATER_SLAVE,
|
|
|
|
const.GENERIC_TYPE_THERMOSTAT,
|
|
|
|
const.GENERIC_TYPE_WALL_CONTROLLER],
|
2017-03-23 15:37:20 +00:00
|
|
|
const.DISC_VALUES: dict(DEFAULT_VALUES_SCHEMA, **{
|
2017-03-14 23:55:33 +00:00
|
|
|
const.DISC_PRIMARY: {
|
|
|
|
const.DISC_COMMAND_CLASS: [const.COMMAND_CLASS_SWITCH_BINARY],
|
|
|
|
const.DISC_TYPE: const.TYPE_BOOL,
|
|
|
|
const.DISC_GENRE: const.GENRE_USER,
|
|
|
|
}})},
|
|
|
|
]
|