1e92417804ddc8c5ea2eb9a5d857d0a8ce3e25ab,homeassistant/components/xiaomi_aqara.py,,,#,11

Before Change


SERVICE_REMOVE_DEVICE = "remove_device"

XIAOMI_AQARA_SERVICE_SCHEMA = vol.Schema({
    vol.Required(ATTR_GW_MAC): vol.All(cv.string,
                                       vol.Any(vol.Length(min=12, max=12),
                                               vol.Length(min=17, max=17)))
})

SERVICE_SCHEMA_PLAY_RINGTONE = XIAOMI_AQARA_SERVICE_SCHEMA.extend({
    vol.Required(ATTR_RINGTONE_ID): vol.Coerce(int),
    vol.Optional(ATTR_RINGTONE_VOL): vol.All(vol.Coerce(int),
                                             vol.Clamp(min=0, max=100))
})

SERVICE_SCHEMA_REMOVE_DEVICE = XIAOMI_AQARA_SERVICE_SCHEMA.extend({
    vol.Required(ATTR_DEVICE_ID): vol.All(cv.string,
                                          vol.Length(min=14, max=14))
})

SERVICE_TO_METHOD = {
    SERVICE_PLAY_RINGTONE: {"method": "play_ringtone_service",
                            "schema": SERVICE_SCHEMA_PLAY_RINGTONE},
    SERVICE_STOP_RINGTONE: {"method": "stop_ringtone_service"},
    SERVICE_ADD_DEVICE: {"method": "add_device_service"},
    SERVICE_REMOVE_DEVICE: {"method": "remove_device_service",
                            "schema": SERVICE_SCHEMA_REMOVE_DEVICE},
}


def _validate_conf(config):
    Validate a list of devices definitions.

After Change



SERVICE_SCHEMA_PLAY_RINGTONE = vol.Schema({
    vol.Required(ATTR_RINGTONE_ID):
        vol.All(vol.Coerce(int), vol.NotIn([9, 14, 15, 16, 17, 18, 19])),
    vol.Optional(ATTR_RINGTONE_VOL):
        vol.All(vol.Coerce(int), vol.Clamp(min=0, max=100))
})
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: home-assistant/home-assistant
Commit Name: 1e92417804ddc8c5ea2eb9a5d857d0a8ce3e25ab
Time: 2017-11-03
Author: paulus@paulusschoutsen.nl
File Name: homeassistant/components/xiaomi_aqara.py
Class Name:
Method Name:


Project Name: home-assistant/home-assistant
Commit Name: 8f774e9c531555cdf31d2ff5f955a9e27ad85404
Time: 2017-11-02
Author: paulus@paulusschoutsen.nl
File Name: homeassistant/components/xiaomi_aqara.py
Class Name:
Method Name:


Project Name: home-assistant/home-assistant
Commit Name: 9c603d932dfe77ae8b985f5918528b6cef6b4e99
Time: 2017-09-14
Author: snjoetw@gmail.com
File Name: homeassistant/components/alarm_control_panel/manual.py
Class Name:
Method Name: