@service(DOMAIN, SERVICE_FLASH)
def flash_service(hass, call):
 if (not TARGET_ID):
  return
 if core.is_on(hass, TARGET_ID):
  core.turn_off(hass, TARGET_ID)
  time.sleep(10)
  core.turn_on(hass, TARGET_ID)
 else:
  core.turn_on(hass, TARGET_ID)
  time.sleep(10)
  core.turn_off(hass, TARGET_ID)

@ service ( DOMAIN , SERVICE_FLASH ) def flash_service ( hass , call ) : if ( not TARGET_ID ) : return if core . is_on ( hass , TARGET_ID ) : core . turn_off ( hass , TARGET_ID ) time . sleep ( 10 ) core . turn_on ( hass , TARGET_ID ) else : core . turn_on ( hass , TARGET_ID ) time . sleep ( 10 ) core . turn_off ( hass , TARGET_ID )
service that will toggle the target .