45649824ca65b49cc676393d660e8c18dd488acf,homeassistant/components/hangouts/const.py,,,#,10
Before Change
CONF_CONVERSATIONS = "conversations"
CONF_DEFAULT_CONVERSATIONS = "default_conversations"
CONF_COMMANDS = "commands"
CONF_WORD = "word"
CONF_EXPRESSION = "expression"
EVENT_HANGOUTS_COMMAND = "hangouts_command"
EVENT_HANGOUTS_CONNECTED = "hangouts_connected"
EVENT_HANGOUTS_DISCONNECTED = "hangouts_disconnected"
EVENT_HANGOUTS_USERS_CHANGED = "hangouts_users_changed"
EVENT_HANGOUTS_CONVERSATIONS_CHANGED = "hangouts_conversations_changed"
CONF_CONVERSATION_ID = "id"
CONF_CONVERSATION_NAME = "name"
SERVICE_SEND_MESSAGE = "send_message"
SERVICE_UPDATE = "update"
TARGETS_SCHEMA = vol.All(
vol.Schema({
vol.Exclusive(CONF_CONVERSATION_ID, "id or name"): cv.string,
vol.Exclusive(CONF_CONVERSATION_NAME, "id or name"): cv.string
}),
cv.has_at_least_one_key(CONF_CONVERSATION_ID, CONF_CONVERSATION_NAME)
)
MESSAGE_SEGMENT_SCHEMA = vol.Schema({
vol.Required("text"): cv.string,
vol.Optional("is_bold"): cv.boolean,
vol.Optional("is_italic"): cv.boolean,
vol.Optional("is_strikethrough"): cv.boolean,
vol.Optional("is_underline"): cv.boolean,
vol.Optional("parse_str"): cv.boolean,
vol.Optional("link_target"): cv.string
})
MESSAGE_SCHEMA = vol.Schema({
vol.Required(ATTR_TARGET): [TARGETS_SCHEMA],
vol.Required(ATTR_MESSAGE): [MESSAGE_SEGMENT_SCHEMA]
})
COMMAND_SCHEMA = vol.All(
// Basic Schema
vol.Schema({
vol.Exclusive(CONF_WORD, "trigger"): cv.string,
vol.Exclusive(CONF_EXPRESSION, "trigger"): cv.is_regex,
vol.Required(CONF_NAME): cv.string,
vol.Optional(CONF_CONVERSATIONS): [TARGETS_SCHEMA]
}),
// Make sure it"s either a word or an expression command
cv.has_at_least_one_key(CONF_WORD, CONF_EXPRESSION)
)
CONFIG_SCHEMA = vol.Schema({
DOMAIN: vol.Schema({
vol.Optional(CONF_COMMANDS, default=[]): [COMMAND_SCHEMA]
})
}, extra=vol.ALLOW_EXTRA)
After Change
INTENT_SCHEMA = vol.All(
// Basic Schema
vol.Schema({
vol.Required(CONF_SENTENCES): vol.All(cv.ensure_list, [cv.string]),
vol.Optional(CONF_CONVERSATIONS): [TARGETS_SCHEMA]
}),
)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 10
Instances
Project Name: home-assistant/home-assistant
Commit Name: 45649824ca65b49cc676393d660e8c18dd488acf
Time: 2018-08-27
Author: hobbypunk90@users.noreply.github.com
File Name: homeassistant/components/hangouts/const.py
Class Name:
Method Name:
Project Name: home-assistant/home-assistant
Commit Name: ab8c127a4a466f2c137239c0eb06c8143adea106
Time: 2018-11-18
Author: JeffLIrion@users.noreply.github.com
File Name: homeassistant/components/media_player/firetv.py
Class Name:
Method Name:
Project Name: home-assistant/home-assistant
Commit Name: a953601abdfe6ab1fc5b1026ec9fb72530201fcd
Time: 2018-08-27
Author: hobbypunk90@users.noreply.github.com
File Name: homeassistant/components/hangouts/const.py
Class Name:
Method Name: