channel = data.get('channel')
strchannel = str(channel)
sleep_time = 1
for c in strchannel:
    if c == "0" :  hass.services.call('script', 'channel_0', {"entity_id":"script.channel_0"})
    if c == "1" :  hass.services.call('script', 'channel_1', {"entity_id":"script.channel_1"})
    if c == "2" :  hass.services.call('script', 'channel_2', {"entity_id":"script.channel_2"})
    if c == "3" :  hass.services.call('script', 'channel_3', {"entity_id":"script.channel_3"})
    if c == "4" :  hass.services.call('script', 'channel_4', {"entity_id":"script.channel_4"})
    if c == "5" :  hass.services.call('script', 'channel_5', {"entity_id":"script.channel_5"})
    if c == "6" :  hass.services.call('script', 'channel_6', {"entity_id":"script.channel_6"})
    if c == "7" :  hass.services.call('script', 'channel_7', {"entity_id":"script.channel_7"})
    if c == "8" :  hass.services.call('script', 'channel_8', {"entity_id":"script.channel_8"})
    if c == "9" :  hass.services.call('script', 'channel_9', {"entity_id":"script.channel_9"})
    time.sleep(sleep_time)
